Re: Weird effect of mount command in F23
On Tue, Oct 20, 2015 at 07:12:36PM +0200, Joachim Backes wrote: > On 20.10.2015 17:41, Richard Ryniker wrote: > >I suspect you suffer from software that wants to help you and "Do the > >right thing." > > > > Exactly. When mounting HD's, *one* mount command is enough for > achieving this, but for removable optical media (like CD's), I need > at least 2 commands, if the media is not loaded. That's what I don't > understand. Accessing the device node is apparently causing the tray to close. Why do you not close the tray first with the button on the drive before trying the mount? > >If you try to mount a device with no media, mount might simply fail (no > >media present). Instead, at least for optical drives, it presumes the > >desired media might be available in the tray and requests the device to > >load media, then tries again to mount a file system from this device. > > This is exactly my question: why mount is able to load the media, > but doesn't include it correctly into the filesystem? It seems like it doesn't wait long enough for the tray to close before giving up. You can try closing the tray first with this command: eject -t From man eject: -t, --trayclose With this option the drive is given a CD-ROM tray close command. Not all devices support this command. and then do the mount, perhaps with a "sleep" in there: eject -t sleep 5 mount ... -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
On Tue, Oct 20, 2015 at 4:53 AM, Joachim Backes < joachim.bac...@rhrk.uni-kl.de> wrote: > 2. sudo mount /dev/sr0 /mnt > then the CD will be inserted, but immeditaly after it inserted, an error > message appears: > mount: no medium found on /dev/sr0 > https://github.com/torvalds/linux/blob/master/drivers/cdrom/cdrom.c When you try to mount the drive, "open_for_data" is called. If the tray is open, the kernel will try to close it. It will then check to see if there is a disc in the drive. What happens at that point varies from drive to drive. Most drive, I believe, and certainly the ones I have access to, will not respond to the status request until they finish checking for media. On those drives, a single mount command will succeed. If your drive responds to the status request before it finishes scanning for media, then the mount command will fail. It's not a kernel bug, it's your drive. You can work around that by calling "eject -t " before mounting the drive. You might also need a delay after calling that command, since your drive seems to respond before it finishes scanning for media. -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
>> I do not like to sacrifice well-defined, predictable behavior for >> convenience > >Convenience is what users need! > >> but others may argue this default behavior serves the >> greater good. > >What is the *greater good*? I think the perceived "good" is that users can load a disk and have a useful default action occur automatically. A music CD causes a media player such as rhythmbox to start, media with camera images starts shotwell, a disk with a mountable filesystem induces a mount operation over /run/media/... and so on. The casual or inexperienced user does not need to know the name "rhythmbox" or understand the mount command (and have the necessary privilege to execute it). This automatic activity can make different environments similar, and therefore easier for users. For example, KDE might launch amarok instead of rhythmbox (used by GNOME) for a music CD. From the user perspective, load a CD and the application to play it is automatically started; doesn't matter whether he uses GNOME, KDE, mate, cinnamon, whatever. For many users, this may be the most convenient behavior. For you and me, not. -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
On 20.10.2015 17:41, Richard Ryniker wrote: I suspect you suffer from software that wants to help you and "Do the right thing." Exactly. When mounting HD's, *one* mount command is enough for achieving this, but for removable optical media (like CD's), I need at least 2 commands, if the media is not loaded. That's what I don't understand. If you try to mount a device with no media, mount might simply fail (no media present). Instead, at least for optical drives, it presumes the desired media might be available in the tray and requests the device to load media, then tries again to mount a file system from this device. This is exactly my question: why mount is able to load the media, but doesn't include it correctly into the filesystem? When the drive status changes from empty to loaded, a udev event occurs that can trigger another piece of software that wants to "Do the right thing." I suspect your initial problem results from conflict between these two programs. You're right! The original mount request fails, whatever operation started by udev completes, and when you issue a second mount request (for the now-loaded optical drive) there is no udev event to get in the way and the mount succeeds. I do not like to sacrifice well-defined, predictable behavior for convenience Convenience is what users need! but others may argue this default behavior serves the greater good. What is the *greater good*? Kind regards Joachim Backes -- Fedora release 23 (Twenty Three) Kernel-4.2.3-300.fc23.x86_64 Joachim Backes http://www-user.rhrk.uni-kl.de/~backes/ -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
I suspect you suffer from software that wants to help you and "Do the right thing." If you try to mount a device with no media, mount might simply fail (no media present). Instead, at least for optical drives, it presumes the desired media might be available in the tray and requests the device to load media, then tries again to mount a file system from this device. When the drive status changes from empty to loaded, a udev event occurs that can trigger another piece of software that wants to "Do the right thing." I suspect your initial problem results from conflict between these two programs. The original mount request fails, whatever operation started by udev completes, and when you issue a second mount request (for the now-loaded optical drive) there is no udev event to get in the way and the mount succeeds. I do not like to sacrifice well-defined, predictable behavior for convenience, but others may argue this default behavior serves the greater good. -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
On 20.10.2015 14:30, Ed Greshko wrote: On 10/20/2015 08:21 PM, Joachim Backes wrote: Then how to check in a bash script when a CD is really mounted? Check the return code of the mount command? [root@meimei ~]# mount /dev/sr0 /mnt mount: no medium found on /dev/sr0 [root@meimei ~]# echo $? 32 Hi Ed, $? = 32 helped. Thanks for the hint. Kind regards Joachim Backes -- Fedora release 23 (Twenty Three) Kernel-4.2.3-300.fc23.x86_64 Joachim Backes http://www-user.rhrk.uni-kl.de/~backes/ -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
On 10/20/2015 08:21 PM, Joachim Backes wrote: > Then how to check in a bash script when a CD is really mounted? Check the return code of the mount command? [root@meimei ~]# mount /dev/sr0 /mnt mount: no medium found on /dev/sr0 [root@meimei ~]# echo $? 32 [root@meimei ~]# mount /dev/sr0 /mnt mount: /dev/sr0 is write-protected, mounting read-only [root@meimei ~]# echo $? 0 -- In reality, some people should stick to running Windows and others should stay away from computers altogether. -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
On 20.10.2015 14:06, Ed Greshko wrote: On 10/20/2015 07:53 PM, Joachim Backes wrote: Anybody has seen this in F23: 1. eject CD (/dev/sr0) 2. sudo mount /dev/sr0 /mnt then the CD will be inserted, but immeditaly after it inserted, an error message appears: mount: no medium found on /dev/sr0 A kernel problem? Kind regards Joachim Backes Same thing happens on F22. Of course if you want a few moments and try again it works. I never would have thought to do it this way. Then how to check in a bash script when a CD is really mounted? That is my original problem :-) Kind regards Joachim Backes -- Fedora release 23 (Twenty Three) Kernel-4.2.3-300.fc23.x86_64 Joachim Backes http://www-user.rhrk.uni-kl.de/~backes/ -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test
Re: Weird effect of mount command in F23
On 10/20/2015 07:53 PM, Joachim Backes wrote: > Anybody has seen this in F23: > > 1. eject CD (/dev/sr0) > 2. sudo mount /dev/sr0 /mnt > > then the CD will be inserted, but immeditaly after it inserted, an error > message appears: > > mount: no medium found on /dev/sr0 > > A kernel problem? > > Kind regards > > Joachim Backes > Same thing happens on F22. Of course if you want a few moments and try again it works. I never would have thought to do it this way. -- In reality, some people should stick to running Windows and others should stay away from computers altogether. -- test mailing list test@lists.fedoraproject.org To unsubscribe: https://admin.fedoraproject.org/mailman/listinfo/test