-   Linux - General (
-   -   CD unmounting (

Paul_assheton 04-08-2002 03:59 AM

CD unmounting
Hi there,

This is probably a stupid question but I am having some trouble unmounting CD's on one of my computers.

The computer is running RedHat 7.1 and when I try to unmount a cd I get the "umount: /mnt/cdrom: device is busy" error. This is after I have killed the shell that I mounted and looked at the CD with. Fuser returns no processes using the filesystem and there is no X server running. The problem occurs everytime I try to use a CD on this particular computer.

Is there a way of umounting a file system even if it is being used? CD's are read only so there is no danger of loosing cashed write information.



acid_kewpie 04-08-2002 04:07 AM

it's *extremely* likely that somewhere in your system you are in the mounted directory, make sure you only have one single bash session running, and you are in your home directory and NOTHING is using the driver in any possible way. you could even drop down to single user mode (run "init 1") to make stupidly sure that you're not there at all.

Paul_assheton 04-09-2002 02:25 AM

I have checked and I can see no process running that is using the CD. If I insert a cd and mount it, look at it (ls /mnt/cdrom not moving dir), then attempt to unmount it, it refuses to unmount.

Are there any system level processes that are known for grabbing CD drivers? The problem is more irritating than anything because I have to reboot it to get the CD out.



linuxcool 04-09-2002 03:02 AM

Try running lsof. This will list what files are open. See if any of them are accessing the cdrom.

From man page of lsof:


An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream or a network file (Internet socket, NFS file or UNIX domain socket.)

Paul_assheton 04-09-2002 05:38 AM

Interesting command. Not one that I have run into before. Unfortunatly it produced no reference to the CD. I tried searching for mnt, cdrom and hdc (I tried hda, hdb and hdd too). Still the CD will not eject!



Sixpax 04-09-2002 11:44 AM

what fuser syntax are you using?

try "fuser -mk /mnt/cdrom".

also, please post your /etc/fstab.

Thymox 04-09-2002 11:51 AM

I had a similar problem for a while. It was the supermount option being funny. It would automagically mount the CD when I put it in the drive, and yet would not tell me that it was already mounted when I try to 'mount /mnt/cdrom'. Because it was waiting for an eject command (as opposed to an umount command), it would not let me umount it. In the end I just got rid of supermounting...

Paul_assheton 04-12-2002 03:01 AM

Sorry for the delay in responding.

Yes I am using fuser -mk /mnt/cdrom to no effect.

Here is the fstab

LABEL=/ / ext2 defaults 1 1
/dev/hda3 /data1 ext2 defaults 1 2
/dev/sda1 /data3 ext2 defaults 1 2
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
none /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
/dev/hda2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/sdb1 /data2 ext2 defaults 1 2
/dev/hdb1 /data4 ext2 defaults 1 2

Sorry about the format. I dont know how to format tables in this forum system.



linuxcool 04-12-2002 03:29 AM

Try changing this line:

/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0

To this:

/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0

And make sure that /dev/cdrom points to the correct device. Do ls -l /dev/cdrom to see where it points.

Manish 04-12-2002 04:53 AM

I think there is a "force" option with umount.

Paul_assheton 04-12-2002 07:25 AM

Thanks for the suggestions.

The force (-f) option in umount I have already tried and had no effect. It says in the man page that this is for non responding nfs mounts.

As to the changes to the /etc/fstab, the computer is an importent resource server so I will wait until Monday when it gets its scheduled weekly reboot to I try it!! I will let you know how it goes.



Sixpax 04-12-2002 11:56 AM

You can change /etc/fstab without rebooting.

Paul_assheton 04-15-2002 04:15 AM

I did change the fstab but the CD was still stuck in the drive and the changes made will not have any effect untill the drive is remounted.

I rebooted the computer this morning and got the damn disk out. I then tried the drive with the changes to fstab. So far so good. I could get the disk out again! Looks like the change to the fstab has helped.

Thanks for all the help


kylo8787 04-15-2002 01:40 PM

mount it with

mount -t iso9660 /dev/xxx /xxx

the xxx is are the device and where to mount it

to unmount it do a
mount /cdrom or whatever

also you cannot open the cdrom when the drive is mounted

linuxcool 04-16-2002 02:37 AM

You're welcome. :)

All times are GMT -5. The time now is 03:42 PM.