8

A quick one... I noticed this folder in / on Kubuntu 15.10:

drwxrwxr-x 2 root root 4.0K Dec 12 02:33 cdrom

Why is it there and how is it used? Shouldn't CD-ROMs be (auto-)mounted in /media by udisks2 (or manually wherever I want them)? My current system doesn't have an optical drive, so I can't test this for myself. I just came across it while identifying folders in / to exclude in my rsync script.

1
  • 1
    /cdrom is used for read-only chroot/Live-DVD/pendrive ISO
    – alecxs
    Dec 29, 2022 at 11:14

1 Answer 1

6

I think it's there since ancient times and probably for various compatibility reasons.

Some explanation from CD-ROMs subchapter of The Linux Cookbook follows here:

Like the /floppy directory, the use of the /cdrom directory is a standard practice and convenient, but not necessary -- you can mount disks in whatever empty directory you like. (You could even, for example, mount discs from the CD-ROM drive to /floppy and mount floppy disks to /cdrom, but why would anyone do that!)

Also, I found this post on Ask Ubuntu that has the ultimate answer to your question:

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.

3
  • 1
    While this doesn't explain how /cdrom is used in modern distros, kudos for digging up that link. Searching for "/cdrom" on Google or the StackExchange sites is an excercise in futility...
    – user534159
    Jan 1, 2016 at 1:17
  • 2
    Commenting on the edit: very nice find! I googled for quite a while but failed to discover that one. The comments are pretty funny ("folder sometimes turns into a link") but I think it's safe to say that /cdrom has been kept as a legacy mount point, and can be ignored by most users of recent distributions. I guess, in time, it will just go where /floppy went :)
    – user534159
    Jan 1, 2016 at 4:14
  • Much like the media themselves; /cdrom is as used as /floppy. sudo rmdir /cdrom to allow single char autocomplete on softlink /code. (Tested after digging through attic to find a CD-ROM, found a USB floppy drive - curious to know if install on a machine with an IDE floppy would yield /floppy)
    – earcam
    Jul 26, 2017 at 22:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .