Skip to content
Snippets Groups Projects
Commit f5634b9a authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Use forceall in e2fsck if available

Before shrinking a filesystem use the e2fsck -y if the underlined
guestfs library supports it.
parent a38447ba
No related branches found
No related tags found
No related merge requests found
...@@ -293,7 +293,12 @@ class Image(object): ...@@ -293,7 +293,12 @@ class Image(object):
return self.size return self.size
part_dev = "%s%d" % (self.guestfs_device, last_part['part_num']) part_dev = "%s%d" % (self.guestfs_device, last_part['part_num'])
self.g.e2fsck_f(part_dev)
if self.check_guestfs_version(1, 15, 17) >= 0:
self.g.e2fsck(part_dev, forceall=1)
else:
self.g.e2fsck_f(part_dev)
self.g.resize2fs_M(part_dev) self.g.resize2fs_M(part_dev)
out = self.g.tune2fs_l(part_dev) out = self.g.tune2fs_l(part_dev)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment