[Bug 996668] Re: Should run fsck before mounting casper-rw

Launchpad Bug Tracker 996668 at bugs.launchpad.net
Fri Sep 14 11:20:31 UTC 2012


Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: casper (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to casper in Ubuntu.
https://bugs.launchpad.net/bugs/996668

Title:
  Should run fsck before mounting casper-rw

Status in “casper” package in Ubuntu:
  Confirmed

Bug description:
  If you crash your pendrive system, casper-rw can be corrupted.
  casper should check using fsck before mounting casper-rw to
  catch this and allow users to fix the problem if it cannot be fixed
  automatically.

  Here's a patch that I think will do the trick for the ext2/3/4 file-systems
  at least.  I coppied e2fsck.static to the ramdisk and put it in sbin.

  greearb at v-ubuntu-12-04:/tmp/ramdisk/scripts$ diff -u ~/casper.orig casper
  --- /home/greearb/casper.orig	2012-05-08 09:09:43.012658969 -0700
  +++ casper	2012-05-08 10:43:20.016662223 -0700
  @@ -441,6 +441,14 @@
           fi
       fi
   
  +    if [ "_${cow_fstype}" = "_ext2" -o "_${cow_fstype}" = "_ext3" -o "_${cow_fstype}" = "_ext4" ]
  +	then
  +	[ "$quiet" != "y" ] && log_warning_msg "Running e2fsck on ${cowdevice}, fstype: ${cow_fstype}"
  +	e2fsck -p ${cowdevice} || panic "ERROR: File system corruption on ${cowdevice}.  Run: e2fsck ${cowdevice}"
  +    else
  +	[ "$quiet" != "y" ] && log_warning_msg "Not running fsck on ${cowdevice}, only ext2/2/4 fsck supported: ${cow_fstype}"
  +    fi
  +
       mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || panic "Can not mount $cowdevice on /cow"
   
       case ${UNIONFS} in

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/casper/+bug/996668/+subscriptions




More information about the foundations-bugs mailing list