summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Harris <rconradharris@gmail.com>2012-02-13 16:11:17 -0600
committerRick Harris <rconradharris@gmail.com>2012-02-13 17:03:47 -0600
commitd8a2bda822662f3ebc25f8e92d03ae1cf0676be8 (patch)
tree09aa6928a0c50d4f001ccd39a3ba5c8be9a960ef
parent271768076406fd1ebfb7001546fea63dba39188a (diff)
downloadnova-d8a2bda822662f3ebc25f8e92d03ae1cf0676be8.tar.gz
nova-d8a2bda822662f3ebc25f8e92d03ae1cf0676be8.tar.xz
nova-d8a2bda822662f3ebc25f8e92d03ae1cf0676be8.zip
Fsck disk before removing journal
Fixes bug 931743 Change-Id: Ibf257ca74432f8e6387ffae58f6b38477de59272
-rw-r--r--nova/virt/xenapi/vm_utils.py13
1 files changed, 3 insertions, 10 deletions
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,