Should run fsck before mounting casper-rw
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
casper (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
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@
--- /home/greearb/
+++ 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
I have a better fix for this, posted here:
https:/ /bugs.launchpad .net/ubuntu/ +source/ upstart/ +bug/125702