diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-02-14 00:46:37 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-02-14 00:46:37 +0000 |
| commit | 498a8064aa4fc699c01a7975bad2025b5f2c4541 (patch) | |
| tree | cd9799f6ddccf610730899cfcf2fb0f58b71cac1 | |
| parent | 46e194fdb1ad3675490fd22a6d71e6db7225a4f2 (diff) | |
| parent | d8a2bda822662f3ebc25f8e92d03ae1cf0676be8 (diff) | |
Merge "Fsck disk before removing journal"
| -rw-r--r-- | nova/virt/xenapi/vm_utils.py | 13 |
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, |
