Comment 4 for bug 122568

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

I have figured this problem out. Here is the cause:

$ ls -l /dev/mapper
total 0
crw-rw---- 1 root root 10, 63 2007-08-08 04:56 control
lrwxrwxrwx 1 root root 7 2007-08-08 04:56 hda1 -> ../dm-0
lrwxrwxrwx 1 root root 7 2007-08-08 04:56 hda2 -> ../dm-1
lrwxrwxrwx 1 root root 7 2007-08-08 04:56 hda3 -> ../dm-2

devicemapper is mapping a device to all partitions, causing them to be flagged as exclusively opened already. Any attempt to exclusive open one of these mapped-to partitions, of course, will fail with EBUSY.

Mounting /dev/dm-0 instead of /dev/hda1 works.

There is still a problem though:

$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2007-08-08 08:56 00e53ae4-19e4-4d16-acc4-276230ea12c9 -> ../../dm-9
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 0a9c2edd-80ba-4f7c-991d-d184952c486d -> ../../dm-14
lrwxrwxrwx 1 root root 10 2007-08-08 08:56 12b8250a-d031-4ee1-b486-5e67478d06b4 -> ../../hda1
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 361d6c3f-6abf-42eb-aed9-356cdc7a3d8b -> ../../dm-17
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 47762031-03d7-4cff-844b-c69a26855304 -> ../../dm-11
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 7df7bb45-c3ff-47c1-8df6-744e54e4d7b5 -> ../../dm-20
lrwxrwxrwx 1 root root 10 2007-08-08 08:56 810241ed-7ce2-4428-94bf-80a10128c589 -> ../../dm-6
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 adb550b4-5c89-4163-8acc-31c68b7c3e98 -> ../../dm-15
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 db694a16-155d-4a82-b0b3-1c6ed149a7e5 -> ../../dm-19
lrwxrwxrwx 1 root root 11 2007-08-08 08:56 e01a3d48-e59c-46d4-a4d4-99c54cedba4c -> ../../dm-16
lrwxrwxrwx 1 root root 10 2007-08-08 08:56 FFFF-FFFF -> ../../hda2

As you can see (third entry above), the udev "/dev/disk/by-uuid/" code is using the partition device, not the mapped device mapper device. This is why even mounting by UUID:

UUID=12b8250a-d031-4ee1-b486-5e67478d06b4 /boot ext3 defaults 0 2

fails, which was the source of my original problem.