diff options
-rw-r--r-- | pyanaconda/storage/__init__.py | 4 | ||||
-rw-r--r-- | pyanaconda/storage/formats/fs.py | 20 |
2 files changed, 18 insertions, 6 deletions
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 3dde12de0..54e9844b0 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -2371,7 +2371,7 @@ def mountExistingSystem(fsset, rootDevice, # check for dirty filesystems dirtyDevs = [] for device in fsset.mountpoints.values(): - if not hasattr(device.format, "isDirty"): + if not hasattr(device.format, "needsFSCheck"): continue try: @@ -2380,7 +2380,7 @@ def mountExistingSystem(fsset, rootDevice, # we'll catch this in the main loop continue - if device.format.isDirty: + if device.format.needsFSCheck: log.info("%s contains a dirty %s filesystem" % (device.path, device.format.type)) dirtyDevs.append(device.path) diff --git a/pyanaconda/storage/formats/fs.py b/pyanaconda/storage/formats/fs.py index e1b13155d..b977a1850 100644 --- a/pyanaconda/storage/formats/fs.py +++ b/pyanaconda/storage/formats/fs.py @@ -644,7 +644,7 @@ class FS(DeviceFormat): raise NotImplementedError("FS does not implement writeRandomUUID") @property - def isDirty(self): + def needsFSCheck(self): return False @property @@ -816,6 +816,11 @@ class Ext2FS(FS): _fsProfileSpecifier = "-T" partedSystem = fileSystemType["ext2"] + def __init__(self, *args, **kwargs): + self.dirty = False + self.errors = False + super(Ext2FS, self).__init__(*args, **kwargs) + def _fsckFailed(self, rc): for errorCode in self._fsckErrors.keys(): if rc & errorCode: @@ -869,7 +874,10 @@ class Ext2FS(FS): for line in buf.splitlines(): if line.startswith("Block size:"): blockSize = int(line.split(" ")[-1]) - break + + if line.startswith("Filesystem state:"): + self.dirty = "not clean" in line + self.errors = "with errors" in line if blockSize is None: raise FSError("failed to get block size for %s filesystem " @@ -909,8 +917,8 @@ class Ext2FS(FS): return self._minInstanceSize @property - def isDirty(self): - return isys.ext2IsDirty(self.device) + def needsFSCheck(self): + return self.dirty or self.errors @property def resizeArgs(self): @@ -933,6 +941,10 @@ class Ext3FS(Ext2FS): # things they should know the implications of their chosen block size. _maxSize = 16 * 1024 * 1024 + @property + def needsFSCheck(self): + return self.errors + register_device_format(Ext3FS) |