Why does /cdrom folder exist? Shouldn't it be /media/cdrom or /mnt/cdrom?

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.


Solution 1:

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
...

Solution 2:

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.

Solution 3:

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.