13

Can somebody explain the logic behind Ubuntu's cdrom folder in root? (/cdrom)

I recall it used to be /media/cdrom or /mnt/cdrom before (in different distros perhaps)?

thanks.

2
  • Which version of Ubuntu are you referring to?
    – Cry Havok
    Nov 17 '10 at 17:32
  • mmmm. I currently use Ubuntu 10.10 64 bit. I'm new to linux world as well. :)
    – Stann
    Nov 17 '10 at 17:33
8

If you do a detailed listing of the root directory, you will see that /cdrom is just a link to /media/cdrom - a shortcut for convenience.

$ ls -l /
total 120
drwxr-xr-x   2 root root  4096 2010-11-11 01:23 bin
drwxr-xr-x   3 root root  4096 2010-10-21 18:51 boot
lrwxrwxrwx   1 root root    11 2009-11-19 09:25 cdrom -> media/cdrom
...
5
  • hmm. In my case it's an actual folder though. .. drwxr-xr-x 2 root root 4096 2010-11-12 01:50 cdrom
    – Stann
    Nov 17 '10 at 18:34
  • No, it is a link to a folder but it looks like a folder from the file manager. /cdrom and /media/cdrom are effectively the same place.
    – dv3500ea
    Nov 17 '10 at 18:37
  • mmm...looks like a folder to me though.... Otherwise when you do $ ls -l command I would see something like this cdrom -> media/cdrom (which I don't see). And when you right click on it in Nautilus it says that it's a "folder" and not a "link to a folder". What distro do you use? I though I've messed up somehting myself, but then I've openede xubuntu 10.10 in VirtualBox - and there is cdrom folder as well. But anyway - not a biggie:) Thanks for response
    – Stann
    Nov 17 '10 at 18:44
  • @Andre: I am using Ubuntu 10.10. No idea why your system would be different. Nov 17 '10 at 20:49
  • @HamishDowner This no longer holds true in Ubuntu 16.04. There is no symbolic link when drive is empty. It's just a regular empty directory as far as I can tell. Apr 17 '17 at 0:33
4

While /mnt/ and /media/ are common places to mount devices, the device location can be just about anywhere. /cdrom/ was probably chosen for either brevity or legacy support.

1

Andre

For me, it doesn't become a link until something is in /media/cdrom, and that's weird.

I'm sure there's a reason why this is done, most likely for "brevity or legacy support" but the linking/unlinking part is quite strange. In past versions of Ubuntu these folders were constantly linked (last I checked was Intrepid maybe)....

I'm presently trying to hunt down the script that does this black magic in order to discover it's dark secrets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.