I’m trying to install a multi-disk (cd’s) program and I’ve run into a snag. It’s a windows program so I’m using Wine. The installer is asking for the second disk of a two disk set. However, the program won’t release the drive so it won’t open. I’ve searched a bit and discovered the command “eject” but it tells me I’m not root so I can’t do that. I’m also worried about the consequences of typing a command I’m not familiar with (as root). I don’t want to unmount the drive if that will disable it when I’m not confident I could remount it given my lack of expertise. I just want to eject the disk. Any way to do this?
I tried the “straightened paper clip in the little hole on the drive” method. It didn’t work. It knocks the drive out somehow and I had to cancel the installation to get it working again. Not helpful. Thank you for your attention.
As I am not a Wine user, I can not help you there (hope someone will come to the rescue soon). But one thing is sure to me: the “straightened paper clip in the little hole on the drive” is a very last resort, way after using *eject *as root.
First, some info. I’m running 11.2 on fairly new hardware. I’ve had this system for less than 6 months and I bought it new. And I can’t replace this program I’m afraid. I didn’t mount the drive manually in my initial installation, but learning to mount drives manually is something that it wouldn’t hurt for me to learn to do. So I’m going to look that up. Just so you know, that response I’m getting from typing “eject” in a terminal is:
umount: /dev/sr0 is not in the fstab (and you are not root)
eject: unmount of `/dev/sr0’ failed
A search for parts of that line lead to me to a web page where they explain that message. The page is helpful, but it doesn’t make clear enough for me what I would need to do if the “eject” command disables the functionality of my cd/dvd drive. I need to be able to cope with that before I run the “eject” command as root. So I’m going to do some more searching and see. But any help would be appreciated.
*eject *does of course do first an *umount. *One does not tear out devices without telling the OS.
*umount *can only succeed if there is no process that hs a file open within that partition. That includes processes tha have their working directory there. E.g. you can not unmount /home if there is still a file manager showing the contents of /home/pietje/.
umount (and mount) can only be done by root, so doing an *umount *as normal user is futile.
to see what is mounted (and where) do (can be done as normal user)
(un)mounting does not need* /etc/fstab *per se. /etc/fstab is primaraly used to define what must be mounted when doing
which is done in the first place at boot.
A handy side effect of /etc/fstab is that when you use *mount, *not giving it all the parameters it needs, it will look in /etc/fstab. If it can find an entry that fits, it wwill take the missing parameters from there.
One (root) can always mount during the lifetime of the system either by using the mechanism of 6) above or by fully providing the needed parameter fields. After a succesfull mount one can see this with mount (no options, etc) as in 4) above. Nothing is changed in */etc/fstab *by (un)mounting. It is a configuration file.
Mounting of hot plugged mass storage devices is done by root as mentioned. That means that a process ‘running as root’ must do this. That is not true for all of the Dolphins and other strange beasts you run from your desktop. It is done by the HAL daemon (hald). This daemon does talk to your desktop program (and vv.).
It is best to umount (and eject) devices that are mounted by HAL again using HAL. This is normaly done via several possibilities in the GUI (e.g. from My computer on the desktop, or from a file manager). I had never any problems doing this, but I am stiill on openSUSE 10.3 and KDE 3.5 and reading several threads I have the idea that several things are broken here.
You can of course (as root) *umount *a device mounted by HAL. But only when it is unused (as in 2) above). Maybe HAL wil be confused because its own administration ( in /media/.hal-mtab and /media/.hal-mtab-lock) is bogus now. Removing those files (when there are no more HAL mounted partitions) will help.
Thank you for your reply. I actually tried the “eject” command. Did it from root. It didn’t work because it was busy:
linux-afta:/media/COD1 # eject
umount: /media/COD1: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
eject: unmount of `/dev/sr0' failed
I tried the two suggested commands. lsof gave me way too much information. “fuser” gave me some information about its options, and some things to work with, but I realize I don’t know what the “8” and the “1” in parenthesis mean in this context. I tried a few of the options listed for fuser as they seemed harmless:
No process specification given
Usage: fuser -fuv ] -a | -s ] -4 | -6 ] -c | -m | -n SPACE ] -k -i ] -w ] -SIGNAL ]] NAME...
Show which processes use the named files, sockets, or filesystems.
-a display unused files too
-c Same as -m (for POSIX compatibility)
-f silently ignored (for POSIX compatibility)
-i ask before killing (ignored without -k)
-k kill processes accessing the named file
-l list available signal names
-m show all processes using the named filesystems or block device
-n SPACE search in this name space (file, udp, or tcp)
-s silent operation
-SIGNAL send this signal instead of SIGKILL
-u display user IDs
-v verbose output
-w kill only processes with write access
-V display version information
-4 search IPv4 sockets only
-6 search IPv6 sockets only
- reset options
I didn’t get anywhere though. I don’t know enough about this stuff.
I would also like to shake the suspicion that in order to open the drive (and insert the next cd) I might need to kill all the operations running from that drive, including the installation program asking for the next cd, which defeats the purpose of doing this of course.
I’m not installing the software but I am learning a lot, which is more useful in the long run.
Also, I did a quick search in “My Computer”. It told me to “right click for other options such as mount” when I mouse over the cd drive, but it doesn’t give me any such options when I do right click. Again, I would guess that’s because of the processes running there.
I will look for more info about HAL. I don’t know anything about it.
The numbers in lsof(8) and fuser(1) are not parameters, but the sections of the man pages wher their man page is. Section 1 are the normal user commands and Section 8 are the system management commands (mostly root only).
Often is does not matter because there is only an entry of that name in one of the sections and man will take that one. When there are more you can tell man which one (ever did *man man *?). When looking at a man page you will see this also in the heading:
lsof - list open files
I am indeed afraid that you installation software does not release the CD before it is asking for a new one. This being a Windows install it could be that that is normal behaviour in Windows. I never understood Windows.
In short you could (as root) try:
to get a list of processes still attached to all inside it.
Thanks a lot. I had read about man and “man man” last night. But I hadn’t picked up that bit of information. I’ll do some digging around at winehq also. They’ve helped me with another problem recently.