summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-05-07 18:41:57 -0500
committerDavid Lehman <dlehman@redhat.com>2009-05-08 10:04:34 -0500
commit514c28ffa3bfe764a560dc84a38674ca72402fc3 (patch)
tree4a538e27f08a12e060e14436d22ccc83a0a080c6 /storage
parent6bc92d3cd825ccae15d1d281a0157b4af75a38db (diff)
downloadanaconda-514c28ffa3bfe764a560dc84a38674ca72402fc3.tar.gz
anaconda-514c28ffa3bfe764a560dc84a38674ca72402fc3.tar.xz
anaconda-514c28ffa3bfe764a560dc84a38674ca72402fc3.zip
Run tune2fs on newly formatted ext[34] filesystems. (#495476)
Diffstat (limited to 'storage')
-rw-r--r--storage/formats/fs.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index c4cb1ca92..abecf739a 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -765,6 +765,28 @@ class Ext2FS(FS):
_migratefs = "tune2fs"
_defaultMigrateOptions = ["-j"]
+ def doMigrate(self, intf=None):
+ FS.doMigrate(self, intf=intf)
+ self.tuneFS()
+
+ def doFormat(self, *args, **kwargs):
+ FS.doFormat(self, *args, **kwargs)
+ self.tuneFS()
+
+ def tuneFS(self):
+ if not isys.ext2HasJournal(self.device):
+ # only do this if there's a journal
+ return
+
+ try:
+ rc = iutil.execWithRedirect("/usr/sbin/tune2fs",
+ ["-c0", "-i0",
+ "-ouser_xattr,acl", self.device],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5")
+ except Exception as e:
+ log.error("failed to run tune2fs on %s: %s" % (self.device, e))
+
@property
def minSize(self):
""" Minimum size for this filesystem in MB. """