projects
/
snf-image-creator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a38447b
)
Use forceall in e2fsck if available
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Thu, 22 Aug 2013 13:46:39 +0000
(16:46 +0300)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Thu, 22 Aug 2013 13:46:39 +0000
(16:46 +0300)
Before shrinking a filesystem use the e2fsck -y if the underlined
guestfs library supports it.
image_creator/image.py
patch
|
blob
|
history
diff --git
a/image_creator/image.py
b/image_creator/image.py
index
686fad6
..
7eb8ad8
100644
(file)
--- a/
image_creator/image.py
+++ b/
image_creator/image.py
@@
-293,7
+293,12
@@
class Image(object):
return self.size
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)
out = self.g.tune2fs_l(part_dev)