≡ Menu

FreeBSD Mount CDROM / DVD Drive From The Command Prompt

How do I mount the CDROM from FreeBSD shell or command line?

You need to use mount command. The mount utility calls the mount system call to prepare and graft a special device or the remote node (rhost:path) on to the file system tree at the point node. If either special or node are not provided, the appropriate information is taken from the fstab file.

Option #1: Use /etc/fstab

In most cases /etc/fstab lists your CDROM drive so all you have do is type the following command (login as the root):
# mount /cdrom
Now change directory to /cdrom to access the contains of CD / DVD:
# cd /cdrom
# ls

The system maintains a list of currently mounted file systems. If no arguments are given to mount, this list is printed:
# mount

Option #2: Find device and mount it

Type the following command to find out your cdrom device names:
# dmesg | egrep -i 'cd|dvd'
OR directly query /var/run/dmesg.boot to get correct information:
# egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot
Sample outputs:

cd0 at ata1 bus 0 scbus1 target 0 lun 0
cd0:  Removable CD-ROM SCSI-0 device 
cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes)

Another option is to run camcontrol command under FreeBSD:
# camcontrol devlist

<Seagate HARDDISK 1.0>             at scbus0 target 0 lun 0 (ada0,pass0)
<Sony CD-ROM 1.0>                  at scbus1 target 0 lun 0 (cd0,pass1)

You need to mount /dev/cd0 at /media/cdrom directory. First, use mkdir command to create /media/cdrom directory:
# mkdir -p /media/cdrom
To mount cdrom type:
# mount_cd9660 /dev/cd0 /media/cdrom
# mount -t cd9660 /dev/cd0 /media/cdrom

Share this tutorial on:

Like this? Follow us on Twitter OR support us by using Patreon

{ 5 comments… add one }
  • arzeth July 6, 2010, 6:23 pm

    For FreeBSD 8 (mine is 8.1-RC2)
    1. Make sure /media/cdrom folder exists.
    2. mount -t cd9660 /dev/acd0 /media/cdrom

  • Finn Espen Gundersen April 9, 2012, 11:40 pm

    For FreeBSD 9.0
    mount -t cd9660 /dev/cd0 /media/cdrom

  • me November 4, 2012, 2:44 pm

    nice information AND TOTALLY USELESS …

    thank you replies that actually help

  • Netgod January 15, 2013, 1:30 am

    mount: /media/cdrom: No such file or directory

  • draico March 19, 2013, 5:16 am

    yo pude montarlo creando primero el directorio media que contendra al cdrom o dvdrom en mi caso use el dvdrom y luego lo monte y me funciono perfectamente, me fue de mucha utilidad este tutorial, muchas gracias

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , ,