From d8a2bda822662f3ebc25f8e92d03ae1cf0676be8 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Mon, 13 Feb 2012 16:11:17 -0600 Subject: Fsck disk before removing journal Fixes bug 931743 Change-Id: Ibf257ca74432f8e6387ffae58f6b38477de59272 --- nova/virt/xenapi/vm_utils.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'nova') diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 97e40f3ab..fc371b531 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -1433,20 +1433,13 @@ def _resize_part_and_fs(dev, start, old_sectors, new_sectors): dev_path = utils.make_dev_path(dev) partition_path = utils.make_dev_path(dev, partition=1) + # Replay journal if FS wasn't cleanly unmounted + utils.execute('e2fsck', '-f', partition_path, run_as_root=True) + # Remove ext3 journal (making it ext2) utils.execute('tune2fs', '-O ^has_journal', partition_path, run_as_root=True) - # fsck the disk - # - # NOTE(sirp): using -p here to automatically repair filesystem, is - # this okay? - # - # Exit Code 1 = File system errors corrected - # 2 = File system errors corrected, system needs a reboot - utils.execute('e2fsck', '-f', '-p', partition_path, run_as_root=True, - check_exit_code=[0, 1, 2]) - if new_sectors < old_sectors: # Resizing down, resize filesystem before partition resize utils.execute('resize2fs', partition_path, '%ds' % size, -- cgit