I experience this problem in Oneiric, and I have pinned it down:

The problem vanishes when I make fsck wait for some time before it accesses a 
device which is given by a logical link to the "real" device node, for example 
/dev/disk/by-uuid/<something>.
In my specific case the device is encrypted and /etc/fstab lists that same uuid.

Given these circumstances fsck seemingly tries to be clever and somehow tracks 
all logical links.
On encrypted devices fsck and cryptsetup RACE each other.
When cryptsetup sets up the decrypt device dm-<some integer>, it creates a link 
/dev/mapper/<some name>_unformatted, which it a little later renames to 
/dev/mapper/<some name> (seemingly in order to "activate it", which it already 
WAS when created as the /dev/dm-<some integer> node).
Sometimes fsck even starts before the /dev/mapper/<some name>_unformatted links 
exists !


THIS IS A TOOL INTERACTION BUG, which can either be fixed in
a) mountall (or udev ?), in case it is responsible for invoking fsck too soon.
or
b) fsck, which should maybe not access the device prematurely and should not be 
surprised if ANY link to the real device node is renamed
or
c) in cryptsetup (in /lib/cryptsetup/cryptdisks.functions ?), which should not 
naively rename links to created devices.


This is the WORKAROUND, which I hate, so I really ask for a fix near a), b), c) 
(see above):
1) cp -a /sbin/fsck /sbin/fsck.util-linux
and
2) replace /sbin/fsck with the following script:

--------------------------------------------- SNIP ------------------
#!/bin/sh

FSCK=$0.util-linux

sleep 1

echo `date` $0: now calling "\"$FSCK $*\"" ...

fsckStatus=0
$FSCK $* || fsckStatus=$?

if [ $fsckStatus -eq 0 ]; then
  statusText="success."
else
  statusText="ERROR $fsckStatus !"
fi

echo `date` $0: status of "\"$FSCK $*\"": $statusText

exit $fsckStatus
--------------------------------------------- SNAP ------------------

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

Title:
  mountall: fatal error: cannot open /dev/mapper/crypthome_unformatted

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to