Hello all, Robert Milasan [2015-01-12 9:39 +0100]: > 1. add a CD/DVD into the driver > 2. mount the driver: mount /dev/sr0 /mnt/my_cd (ensure you don't > use the Gnome/KDE auto-mounting or reproduce this in a server setup) > 3. eject the media (using the hardware button) and add a new one media > (different disk) > 4. ls /mnt/my_cd (it will be an empty output or the previous media) > > Is this expected?
no, it's not. It's been several years since I've actually had a CD drive and looked at this stuff, but this is how it is *supposed* to work today: - Mounting (manually or through udisks) keeps the kernel default policy of locking the door, so that users can't yank out a mounted medium. - *When* the tray is locked (the default), pressing the eject button is supposed to cause a change event with DISK_EJECT_REQUEST. - udev rules (60-cdrom_id.rules) picks that up and calls "eject /dev/srX" on the device; the eject program takes care to unmount everything before physical ejection. Note that the kernel will *not* generate DISK_EJECT_REQUEST uevents if the tray is not locked. Your case sounds exactly like that? I suggest running "udevadm monitor -e --udev", then press the eject button while a CD is mounted, and check whether you get such an uevent. Then clean up (umount, etc.), re-mount, and this time manually lock with "sudo hdparm -L 1 /dev/sr0", and check how it works then? Then you could compare hdparm -L vs. /lib/udev/cdrom_id --lock-media; maybe the former works but not the latter? Or do both report an error that the drive might not support locking? Until a few years ago I've never seen a drive which didn't, but who knows what modern drives do.. > Also, I remember a while back (long time ago) that once you added a > media into the driver and it was properly mounted, you couldn't > eject the media until you unmounted the media. Right, because we didn't have the kernel (or userspace in udisks, as it was before that) polling for eject button presses. But users (IMHO rightfully) complained about the non-working button, and with the current system it's indeed so much more natural (if it works :) ). Martin -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
signature.asc
Description: Digital signature
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel