FreeBSD

Mount CDROM on FreeBSD

This is a quick tutorial on mounting CD Roms on a FreeBSD system with the mount command-line utility. What this command does, is that it triggers the mount system process to put together the receptors for a new device installed on the system.

Let’s see how CD Roms are mounted in a FreeBSD system.

Mounting CD Roms on FreeBSD with /etc/fstab file

The file located in /etc/fstab can show the CDROM drives currently linked to your system. To see the contents of the file, login as a root user, and type in the command below:

$ mount


Switch directories for the file to /cdrom, to see the contents of the CD. Issue the commands below:

$ cd /cdrom
$ ls

As mentioned earlier, the estab file can list the Cdroms connected to your system. To see this list, use the mount command without any additional switches:

$ mount

Searching for the CD ROMs and mounting it

To look up the CDRoms on your system, type out the command below:

$ dmesg | egrep -i 'cd|dvd'


Alternatively, you can use egrep /var/run/dmesg.boot to look up the cdroms:

$ egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot

You can also use the camcontrol command to display the name of CD Rom:

$ camcontrol devlist


Type in the command below to generate /media/cdrom directory:

$ mkdir -p /media/cdrom


Then mount the CD Rom with the command below:

$ mount_cd9660 /dev/cd0 /media/cdrom


Alternatively, you can use the following command:

$ mount -t cd9660 /dev/cd0 /media/cdrom

This should mount the CD Rom nice and easy.

Wrapping up

I hope the tutorial helped you mount the CD Rom on your FreeBSD system.

About the author

Younis Said

I am a freelancing software project developer, a software engineering graduate and a content writer. I love working with Linux and open-source software.