From ed5305f2765d6f33e0f3ed16221ef312038889ee Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Tue, 14 Aug 2001 19:37:06 +0000 Subject: per sct's request, turn off forced fscks for ext3 filesystems after the fs has been created/migrated and ensuring that there actually is a journal on the fs --- fsset.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'fsset.py') diff --git a/fsset.py b/fsset.py index b2e0e2bb6..5f6be0e60 100644 --- a/fsset.py +++ b/fsset.py @@ -316,7 +316,20 @@ class extFileSystem(FileSystemType): entry.mountpoint) if rc: raise SystemError - + + # this is only for ext3 filesystems, but migration is a method + # of the ext2 fstype + def removeForcedFsck(self, entry, message, chroot='/'): + devicePath = entry.device.setupDevice(chroot) + + # if no journal, don't turn off the fsck + if not isys.ext2HasJournal(devicePath, makeDevNode = 0): + return + + rc = iutil.execWithRedirect("/usr/sbin/tune2fs", + ["tunefs", "-c0", "-i0", devicePath], + stdout = "/dev/tty5", + stderr = "/dev/tty5") class ext2FileSystem(extFileSystem): def __init__(self): @@ -325,7 +338,6 @@ class ext2FileSystem(extFileSystem): self.partedFileSystemType = parted.file_system_type_get("ext2") self.migratetofs = ['ext3'] - def migrateFileSystem(self, entry, message, chroot='/'): devicePath = entry.device.setupDevice(chroot) @@ -365,6 +377,8 @@ class ext2FileSystem(extFileSystem): if rc == 0: sys.exit(0) entry.fsystem = entry.origfsystem + else: + extFileSystem.removeForcedFsck(self, entry, message, chroot) fileSystemTypeRegister(ext2FileSystem()) @@ -389,6 +403,10 @@ class ext3FileSystem(extFileSystem): isys.mount(device, mountpoint, fstype = "ext3", readOnly = readOnly) + def formatDevice(self, entry, progress, chroot='/'): + extFileSystem.formatDevice(self, entry, progress, chroot) + extFileSystem.removeForcedFsck(self, entry, progress, chroot) + fileSystemTypeRegister(ext3FileSystem()) class raidMemberDummyFileSystem(FileSystemType): -- cgit