Bug 605356

Summary: regression for /dev/live symlink
Product: Red Hat Enterprise Linux 6 Reporter: Joey Boggs <jboggs>
Component: dracutAssignee: Harald Hoyer <harald>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: apevec, atodorov, pknirsch, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dracut-004-25.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 605358 (view as bug list) Environment:
Last Closed: 2010-11-10 20:19:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 605358    
Attachments:
Description Flags
patch to mount the cdrom in the /dev/.initramfs namespace none

Comment 2 Harald Hoyer 2010-06-17 17:45:06 UTC
 /sbin/udevadm trigger --action=add

does this work?

Comment 3 RHEL Program Management 2010-06-17 17:53:26 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 Joey Boggs 2010-06-17 18:18:33 UTC
nothing new came from adding: /sbin/udevadm trigger --action=add

Comment 5 Harald Hoyer 2010-06-17 20:03:32 UTC
What exactly is the rule involved?

Comment 6 Joey Boggs 2010-06-18 12:20:42 UTC
Actually I left out some information. With version 147-2.18+ If I boot with rdbreak=pre-pivot the /dev/live link does exist in the emergency shell, it just disappears when the system fully boots if that helps

The rules involved are just the regular dmsquash ones, or did I misunderstand what you were asking?

dracut/modules.d/90dmsquash-live/dmsquash-live-genrules.sh

Comment 7 Alan Pevec 2010-06-21 15:01:44 UTC
Those rules are present only in initramfs, aren't they?
So udev trigger running in rootfs doesn't see them and wipes the symlinks?

Comment 8 Harald Hoyer 2010-06-21 15:56:59 UTC
(In reply to comment #4)
> nothing new came from adding: /sbin/udevadm trigger --action=add    

so, to prove the concept:

 /sbin/udevadm trigger --action=change

will work then?

Comment 9 Joey Boggs 2010-06-21 16:39:31 UTC
still didnt leave /dev/live when adding --action=change

Comment 10 Harald Hoyer 2010-06-21 17:25:43 UTC
are you reverting this change will make it work again?

-       /sbin/udevadm trigger
+       /sbin/udevadm trigger --type=subsystems --action=add
+       /sbin/udevadm trigger --type=devices --action=add

Nearly impossible..

Comment 11 Harald Hoyer 2010-06-21 17:26:09 UTC
s/are you reverting/are you sure, reverting/

Comment 12 Joey Boggs 2010-06-21 17:28:37 UTC
the section in start_udev looks like:

#        /sbin/udevadmin trigger --action=add
        /sbin/udevadm trigger --type=subsystems --action=add
        /sbin/udevadm trigger --type=devices --action=add
        /sbin/udevadm trigger --action=change

Comment 13 Harald Hoyer 2010-06-21 18:05:43 UTC
(In reply to comment #12)
> the section in start_udev looks like:
> 
> #        /sbin/udevadmin trigger --action=add
>         /sbin/udevadm trigger --type=subsystems --action=add
>         /sbin/udevadm trigger --type=devices --action=add
>         /sbin/udevadm trigger --action=change    

first test:
         /sbin/udevadm trigger 

second test:
         /sbin/udevadm trigger --action=change    

third test:
         /sbin/udevadm trigger --action=add


... not all together!

Comment 14 Joey Boggs 2010-06-21 20:55:31 UTC
Tried all of those separately and was not able to get /dev/live to appear when using 147-2.18+. the first test we tried a few days ago seemed to work fine so I went back and retested /sbin/udevadm trigger. Which failed.

After that I went back to the host I was building my udev rpms on and grabbed the 147-2.17.src.rpm and added in the 2 udevadm lines that were in 147-2.18:

>         /sbin/udevadm trigger --type=subsystems --action=add
>         /sbin/udevadm trigger --type=devices --action=add

Those work when added to 2-17, so it's something else that changed between 147-2.17 and 18. nothing stands out to me in the diff between between the src rpms other than modified already existing patch files.

Comment 15 Harald Hoyer 2010-06-22 08:14:07 UTC
The most probable change in start_udev, which could affect this is:

-rm -fr $udev_root/.udev > "$udev_root/null" 2>&1

which removed the removal of the udev database, which was a necessary change for device-mapper.

So, udev now knows about the old /dev/live symlink and removes it upon new actions, because the rule for the symlink, which is in the initramfs does not exist anymore.

A possible fix would be to write the /dev/live rule to /dev/.udev/rules.d in the initramfs, so it would survive the retrigger.

Assigning to dracut.

Comment 21 Harald Hoyer 2010-06-23 12:17:28 UTC
oh.. you might have a buggy cdrom.. is the symlink present after you poll the cdrom with:

# echo change >  /sys/block/sr0/uevent

??

Comment 22 Harald Hoyer 2010-06-23 12:18:08 UTC
also you might check:

# udevadm info --query=all --name=/dev/sr0

Comment 23 Alan Pevec 2010-06-23 12:48:55 UTC
(In reply to comment #21)
> oh.. you might have a buggy cdrom..
possible, it's QEMU emulated CD-ROM:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: QEMU     Model: QEMU DVD-ROM     Rev: 0.12
  Type:   CD-ROM                           ANSI  SCSI revision: 05

> is the symlink present after you poll the cdrom with:
> # echo change >  /sys/block/sr0/uevent

neither /dev/live nor /dev/disk/by-label/ovirt-node-image showed up

Comment 24 Alan Pevec 2010-06-23 12:49:40 UTC
(In reply to comment #22)
> # udevadm info --query=all --name=/dev/sr0    

P: /devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0
N: sr0
S: block/11:0
S: scd0
S: disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0
E: MAJOR=11
E: MINOR=0
E: DEVNAME=/dev/sr0
E: DEVTYPE=disk
E: SUBSYSTEM=block
E: MPATH_SBIN_PATH=/sbin
E: ID_CDROM=1
E: ID_SCSI=1
E: ID_VENDOR=QEMU
E: ID_VENDOR_ENC=QEMU\x20\x20\x20\x20
E: ID_MODEL=QEMU_DVD-ROM
E: ID_MODEL_ENC=QEMU\x20DVD-ROM\x20\x20\x20\x20
E: ID_REVISION=0.12
E: ID_TYPE=cd
E: ID_BUS=scsi
E: ID_PATH=pci-0000:00:01.1-scsi-1:0:0:0
E: ACL_MANAGE=1
E: DEVLINKS=/dev/block/11:0 /dev/scd0 /dev/disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0

Comment 25 Alan Pevec 2010-06-23 22:45:17 UTC
(In reply to comment #23)
> (In reply to comment #21)
> > oh.. you might have a buggy cdrom..
> possible, it's QEMU emulated CD-ROM:

...or maybe not, I got the same behaviour on a physical machine with Plextor DVD-ROM which is unlikely to be buggy.

Comment 26 Harald Hoyer 2010-06-24 09:58:18 UTC
ok, that's odd... what's the output of:

# /lib/udev/cdrom_id /dev/sr0
# udevadm test $(readlink -f /sys/block/sr0)

Comment 27 Alan Pevec 2010-06-24 11:26:29 UTC
Looks we're finally onto something:

# /lib/udev/cdrom_id /dev/sr0
unable to open '/dev/sr0

open("/dev/sr0", O_RDONLY|O_EXCL|O_NONBLOCK) = -1 EBUSY (Device or resource busy)

...LiveCD is of course mounted by dmsquash-live dracut script.
I just wonder how come that blkid /dev/sr0 works??

# udevadm test $(readlink -f /sys/block/sr0)
run_command: calling: test
udevadm_test: version 147
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/10-console.rules' as rules file
parse_file: reading '/lib/udev/rules.d/10-dm.rules' as rules file
add_rule: name empty, node creation suppressed
parse_file: reading '/lib/udev/rules.d/11-dm-lvm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/13-dm-disk.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-isdn.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-multipath.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-redhat.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-net.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-raw.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-option-modem-modeswitch.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/64-device-mapper.rules' as rules file
parse_file: reading '/lib/udev/rules.d/64-md-raid.rules' as rules file
parse_file: reading '/lib/udev/rules.d/65-md-incremental.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-hid2hci.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/lib/udev/rules.d/79-fstab_import.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-kvm.rules' as rules file
parse_file: reading '/lib/udev/rules.d/88-clock.rules' as rules file
parse_file: reading '/etc/udev/rules.d/90-hal.rules' as rules file
parse_file: reading '/etc/udev/rules.d/91-drm-modeset.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-dm-notify.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/etc/udev/rules.d/98-kexec.rules' as rules file
parse_file: reading '/dev/.udev/rules.d/99-live-mount.rules' as rules file
parse_file: reading '/etc/udev/rules.d/99-vdsm.rules' as rules file
udev_rules_new: rules use 25428 bytes tokens (2119 * 12 bytes), 15528 bytes buffer
udev_rules_new: temporary index used 16140 bytes (807 * 20 bytes)
udev_device_new_from_syspath: device 0x8d28a0 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0'
udev_device_new_from_syspath: device 0x8d2a80 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0'
udev_device_read_db: device 0x8d2a80 filled with db file data
udev_rules_apply_to_event: PROGRAM '/sbin/multipath -c /dev/sr0' /lib/udev/rules.d/40-multipath.rules:11
util_run_program: '/sbin/multipath -c /dev/sr0' started
util_run_program: '/sbin/multipath' (stdout) '/dev/sr0 is not a valid multipath device path'
util_run_program: '/sbin/multipath -c /dev/sr0' returned with exitcode 1
udev_rules_apply_to_event: RUN 'socket:/org/kernel/dm/multipath_event' /lib/udev/rules.d/40-multipath.rules:16
udev_rules_apply_to_event: LINK 'block/11:0' /lib/udev/rules.d/50-udev-default.rules:3
udev_rules_apply_to_event: GROUP 6 /lib/udev/rules.d/50-udev-default.rules:76
udev_rules_apply_to_event: GROUP 11 /lib/udev/rules.d/50-udev-default.rules:84
udev_rules_apply_to_event: LINK 'scd0' /lib/udev/rules.d/50-udev-default.rules:84
udev_rules_apply_to_event: IMPORT 'cdrom_id --export /dev/sr0' /lib/udev/rules.d/60-cdrom_id.rules:9
util_run_program: 'cdrom_id --export /dev/sr0' started
cdrom_id[1202]: custom logging function 0x1302010 registered

cdrom_id[1202]: unable to open '/dev/sr0'

util_run_program: '/lib/udev/cdrom_id' (stderr) 'unable to open '/dev/sr0''
util_run_program: 'cdrom_id --export /dev/sr0' returned with exitcode 1
udev_device_new_from_syspath: device 0x8f7d20 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0'
udev_device_new_from_syspath: device 0x8f82e0 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0'
udev_device_new_from_syspath: device 0x8f84b0 has devpath '/devices/pci0000:00/0000:00:01.1/host1'
udev_device_new_from_syspath: device 0x904e60 has devpath '/devices/pci0000:00/0000:00:01.1'
udev_device_new_from_syspath: device 0x905090 has devpath '/devices/pci0000:00'
udev_rules_apply_to_event: IMPORT 'scsi_id --export --whitelisted -d /dev/sr0' /lib/udev/rules.d/60-persistent-storage.rules:37
util_run_program: 'scsi_id --export --whitelisted -d /dev/sr0' started
scsi_id[1203]: custom logging function 0x1be6010 registered

scsi_id[1203]: 11:0: page 0 not available.

util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_SCSI=1'
util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_VENDOR=QEMU'
util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_VENDOR_ENC=QEMU\x20\x20\x20\x20'
util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_MODEL=QEMU_DVD-ROM'
util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_MODEL_ENC=QEMU\x20DVD-ROM\x20\x20\x20\x20'
util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_REVISION=0.12'
util_run_program: '/lib/udev/scsi_id' (stdout) 'ID_TYPE=cd'
util_run_program: 'scsi_id --export --whitelisted -d /dev/sr0' returned with exitcode 0
udev_rules_apply_to_event: IMPORT 'path_id /devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' /lib/udev/rules.d/60-persistent-storage.rules:56
util_run_program: 'path_id /devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' started
path_id[1204]: custom logging function 0xc9e010 registered

path_id[1204]: device 0xc9e0e0 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0'

path_id[1204]: device 0xc9e3a0 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0'

path_id[1204]: device 0xc9e730 has devpath '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0'

path_id[1204]: device 0xc9ea40 has devpath '/devices/pci0000:00/0000:00:01.1/host1'

path_id[1204]: device 0xc9ed40 has devpath '/devices/pci0000:00/0000:00:01.1'

path_id[1204]: device 0xc9f030 has devpath '/devices/pci0000:00'

util_run_program: '/lib/udev/path_id' (stdout) 'ID_PATH=pci-0000:00:01.1-scsi-1:0:0:0'
util_run_program: 'path_id /devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' returned with exitcode 0
udev_rules_apply_to_event: LINK 'disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0' /lib/udev/rules.d/60-persistent-storage.rules:57
udev_rules_apply_to_event: LINK 'cdrom' /etc/udev/rules.d/70-persistent-cd.rules:8
udev_rules_apply_to_event: RUN 'socket:@/org/freedesktop/hal/udev_event' /etc/udev/rules.d/90-hal.rules:2
udev_event_execute_rules: no node name set, will use kernel supplied name 'sr0'
udev_device_update_db: created db file for '/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' in '/dev/.udev/db/block:sr0'
udev_node_add: creating device node '/dev/sr0', devnum=11:0, mode=0660, uid=0, gid=11
udev_node_mknod: preserve file '/dev/sr0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/sr0, 060660, uid=0, gid=11
node_symlink: preserve already existing symlink '/dev/block/11:0' to '../sr0'
link_find_prioritized: found '/sys/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' claiming '/dev/.udev/links/scd0'
link_update: creating link '/dev/scd0' to '/dev/sr0'
node_symlink: preserve already existing symlink '/dev/scd0' to 'sr0'
link_find_prioritized: found '/sys/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' claiming '/dev/.udev/links/disk\x2fby-path\x2fpci-0000:00:01.1-scsi-1:0:0:0'
link_update: creating link '/dev/disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0' to '/dev/sr0'
node_symlink: preserve already existing symlink '/dev/disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0' to '../../sr0'
link_find_prioritized: found '/sys/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0' claiming '/dev/.udev/links/cdrom'
link_update: creating link '/dev/cdrom' to '/dev/sr0'
node_symlink: preserve already existing symlink '/dev/cdrom' to 'sr0'
udevadm_test: UDEV_LOG=6
udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0
udevadm_test: MAJOR=11
udevadm_test: MINOR=0
udevadm_test: DEVNAME=/dev/sr0
udevadm_test: DEVTYPE=disk
udevadm_test: ACTION=add
udevadm_test: SUBSYSTEM=block
udevadm_test: MPATH_SBIN_PATH=/sbin
udevadm_test: DEVLINKS=/dev/block/11:0 /dev/scd0 /dev/disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0 /dev/cdrom
udevadm_test: ID_CDROM=1
udevadm_test: ID_SCSI=1
udevadm_test: ID_VENDOR=QEMU
udevadm_test: ID_VENDOR_ENC=QEMU\x20\x20\x20\x20
udevadm_test: ID_MODEL=QEMU_DVD-ROM
udevadm_test: ID_MODEL_ENC=QEMU\x20DVD-ROM\x20\x20\x20\x20
udevadm_test: ID_REVISION=0.12
udevadm_test: ID_TYPE=cd
udevadm_test: ID_BUS=scsi
udevadm_test: ID_PATH=pci-0000:00:01.1-scsi-1:0:0:0
udevadm_test: ACL_MANAGE=1
udevadm_test: GENERATED=1
udevadm_test: run: 'socket:/org/kernel/dm/multipath_event'
udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event'

Comment 28 Harald Hoyer 2010-06-24 12:18:30 UTC
(In reply to comment #27)
> Looks we're finally onto something:
> 
> # /lib/udev/cdrom_id /dev/sr0
> unable to open '/dev/sr0
> 
> open("/dev/sr0", O_RDONLY|O_EXCL|O_NONBLOCK) = -1 EBUSY (Device or resource
> busy)
> 
> ...LiveCD is of course mounted by dmsquash-live dracut script.

Huh? cdrom_id should not use O_EXCL, if it finds, that the device is mounted..

# mount |grep sr1
/dev/sr1 on /mnt type iso9660 (ro)
# /lib/udev/cdrom_id /dev/sr1
ID_CDROM=1
ID_CDROM_CD_R=1
ID_CDROM_CD_RW=1
ID_CDROM_DVD=1
ID_CDROM_DVD_R=1
ID_CDROM_DVD_RW=1
ID_CDROM_DVD_RAM=1
ID_CDROM_DVD_PLUS_R=1
ID_CDROM_DVD_PLUS_RW=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1
ID_CDROM_MEDIA_SESSION_COUNT=1
ID_CDROM_MEDIA_TRACK_COUNT=1
ID_CDROM_MEDIA_TRACK_COUNT_DATA=1

works for me..

what is 
# cat /proc/self/mountinfo
?

Comment 29 Alan Pevec 2010-06-24 15:49:19 UTC
(In reply to comment #28)
> Huh? cdrom_id should not use O_EXCL, if it finds, that the device is mounted..

It's mounted before switching root so it's not visible in /proc/self/mountinfo, but it's definitely in use since root is on ISO ( ISO -> LiveOS/squashfs.img -> LiveOS/ext3fs.img )
# losetup -a
/dev/loop0: [0001]:5876 (/osmin.img)
/dev/loop1: [0700]:2 (/squashfs.osmin/osmin)
/dev/loop2: [0b00]:1938 (/sysroot/LiveOS/squashfs.img)
/dev/loop3: [0702]:3 (/squashfs/LiveOS/ext3fs.img)
/dev/loop4: [0001]:5906 (/overlay)

Why would cdrom_id ever need O_EXCL, i.e. what about:

- fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));
+ fd = open(node, O_RDONLY|O_NONBLOCK);

Comment 30 Harald Hoyer 2010-06-25 08:34:31 UTC
(In reply to comment #29)
> (In reply to comment #28)
> > Huh? cdrom_id should not use O_EXCL, if it finds, that the device is mounted..
> 
> It's mounted before switching root so it's not visible in /proc/self/mountinfo,

Why should the kernel drop this mount out of its table after the switch_root?

Please show me /proc/self/mountinfo

> but it's definitely in use since root is on ISO ( ISO -> LiveOS/squashfs.img ->
> LiveOS/ext3fs.img )
> # losetup -a
> /dev/loop0: [0001]:5876 (/osmin.img)
> /dev/loop1: [0700]:2 (/squashfs.osmin/osmin)
> /dev/loop2: [0b00]:1938 (/sysroot/LiveOS/squashfs.img)
> /dev/loop3: [0702]:3 (/squashfs/LiveOS/ext3fs.img)
> /dev/loop4: [0001]:5906 (/overlay)
> 
> Why would cdrom_id ever need O_EXCL, i.e. what about:
> 
> - fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));
> + fd = open(node, O_RDONLY|O_NONBLOCK);    

That's because of disk burning.

Comment 31 Harald Hoyer 2010-06-25 08:35:46 UTC
and /proc/mounts

Comment 32 Harald Hoyer 2010-06-25 09:28:16 UTC
ok.. tried it myself and mounted the cdrom.

/proc/self/mountinfo does not contain the info... /proc/mounts does.

Comment 33 Harald Hoyer 2010-06-25 12:52:22 UTC
Created attachment 426879 [details]
patch to mount the cdrom in the /dev/.initramfs namespace

Can you try this patch please?

# cd /usr/share/dracut
# patch -p1 < <path to patch>

and try with a new initramfs?

Comment 34 Harald Hoyer 2010-06-25 12:53:43 UTC
this patch is an addition to the first patch

Comment 35 Alan Pevec 2010-06-28 07:45:24 UTC
*** Bug 605358 has been marked as a duplicate of this bug. ***

Comment 36 Alan Pevec 2010-06-28 22:03:22 UTC
(In reply to comment #33)
> # cd /usr/share/dracut
> # patch -p1 < <path to patch>
> 
> and try with a new initramfs?    

For livecd you can't just rebuild initramfs, ISO needs to be rebuilt with the patched dracut in the repository. I did a scratch build with both dracut-ae5ec68355f580ca4b86aa35fbbcbb0ed0900bb6.patch and dmsquash-mount.patch from comment 33.
In the image I can see /usr/share/dracut/modules.d/90dmsquash-live/dmsquash-live-root is patched and there's /dev/.initramfs/live but nothing mounted there => cdrom_id still tries&fails exclusive open => no /dev/disk/by-label/<CDLABEL> => no /dev/live

We'll keep working on this BZ to fix LiveCDs in general, but as a matter of urgency I'll do a workaround for RHEVH/ovirt-node in bug 605358.

Comment 41 Harald Hoyer 2010-07-09 09:34:35 UTC
Developed a fix and ready to commit, if the flags turn on +.

Alan, I had to add "device-mapper" to the minimal kickstart.

Comment 43 Harald Hoyer 2010-07-09 11:11:05 UTC
dracut-004-25.el6


btw, is the custom dracut.conf really necessary?

Comment 46 Alexander Todorov 2010-08-11 16:11:57 UTC
On a snap #10 LiveCD

# ls -l /dev/live
lrwxrwxrwx. 1 root root 3 11 авг 16,00 /dev/live -> sr0

# blkid /dev/sr0
/dev/sr0: LABEL="RHEL6.0-20100807.0-Workstation-x" TYPE="iso9660" 

# ls -l /dev/disk/by-label/
lrwxrwxrwx. 1 root root 11 11 Aug 16,00 _RHEL6.0-2010080 -> ../../loop3
lrwxrwxrwx. 1 root root  9 11 Aug 16,00 RHEL6.0-20100807.0-Workstation-x -> ../../sr0


With previous snapshots there was no /dev/live or a link to /dev/sr0. Moving to VERIFIED.

Comment 47 releng-rhel@redhat.com 2010-11-10 20:19:21 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.