Bug 497377 - livecd-tools should do at least a final fsck on the created image
livecd-tools should do at least a final fsck on the created image
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: livecd-tools (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-23 11:43 EDT by Eric Sandeen
Modified: 2009-07-21 14:31 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 498475 (view as bug list)
Environment:
Last Closed: 2009-07-21 14:31:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Sandeen 2009-04-23 11:43:00 EDT
To catch things like bug #496982 before the corrupted images make it out to the user, I think that the __resize_filesystem and __resize_to_minimal methods should fsck the filesystem post-resize, or at least a fsck of the final image should happen some time prior to the process completion, and the whole endeavour should fail if a fsck is not clean...

I hacked up a patch something like:

--- imgcreate/fs.py.orig	2009-04-14 13:05:52.000000000 -0500
+++ imgcreate/fs.py.	2009-04-23 10:35:29.610358871 -0500
@@ -395,8 +395,9 @@
             self.disk.expand(size)
 
         self.__fsck()
-
         resize2fs(self.disk.lofile, size)
+        self.__fsck()
+
         return size
 
     def __create(self):
@@ -453,6 +454,7 @@
                 top = t
             else:
                 bot = t
+        self.__fsck()
         return top
 
     def resparse(self, size = None):

and it caught the corruption mentioned in bug #496982, although it didn't stop the process.

Even if this can't be formally added pre-f11-GA, I'd strongly recommend that the livecd image be hand-fsck'd before we ship it.

Thanks!

-Eric
Comment 1 Jeremy Katz 2009-04-23 12:37:58 EDT
Added in git.  And if we want to stop the process on certain return codes from fsck, just let me know what the exit codes to die on are.
Comment 2 Eric Sandeen 2009-04-23 12:45:58 EDT
       The  exit  code  returned by e2fsck is the sum of the following condi-
       tions:
            0    - No errors
            1    - File system errors corrected
            2    - File system errors corrected, system should
                   be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - E2fsck canceled by user request
            128  - Shared library error

I think I'd say anything other than 0 should stop the process, unless you think otherwise... maybe with a way to override it for "corrected" errors, since in the end the person running this tool can't control the kernel bugs ;)
Comment 3 Chris Shoemaker 2009-05-19 18:59:53 EDT
as long as we're checking error statuses, maybe we should check that the umount before the resize is actually successful (for example, that it didn't refuse to unmount because of open files).
Comment 4 Bug Zapper 2009-06-09 10:28:02 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Jeremy Katz 2009-07-21 14:31:33 EDT
Closing out bug that's been in MODIFIED for a while.

Note You need to log in before you can comment on or make changes to this bug.