How to properly mount a DVD-R/W drive and how to use it from the command line?

O. Hartmann ohartman at mail.uni-mainz.de
Thu Oct 6 05:52:13 PDT 2005


Olaf Greve wrote:
> Hi,
> 
> This'll surely be a really novice question, but I'd like to get it right 
> in one go, and RTFM-ing using Google somehow didn't produce uniform 
> enough results for my likings. :)
> 
> The situation: I just installed FreeBSD 5.4-Release AMD64 on my new 
> machine (though the question is most likely not specific to the AMD64 
> version, I guess), and upon installation time the machine had a DVD-ROM 
> / CD-RW drive. Yesterday I received a new drive, being a DVD-RW drive, 
> and I replaced the previous one with the new one. O.k., no problem so 
> far, and the BIOS seems to properly identify the drive.
> 
> When booting the machine, the drive is -I think- identified as "DVDW" as 
> /dev/acd0, and the mountpoint it (re!)uses is /cdrom.
> 
> Now, this is where the issue lies. When putting a CD-ROM in the drive, 
> and trying to access it through the /cdrom mountpoint I get an empty 
> directory listing (not correct) and when manually trying to do the 
> following:
> mount /dev/acd0 /cdrom
> I get the error (on all CD-ROMs):
> mount: /dev/acd0 on /cdrom: incorrect super block
> 
> Now, the entry in /etc/fstab for this device is set to:
> /dev/acd0     /cdrom    cd9660    ro,noauto    0    0
> 
> Which is fine for a CD-ROM drive.
> 
> However: what should the proper settings be for a DVD-RW drive? Surely 
> at least the 'ro' flag is incorrect, but is that all?
> Also: are there other locations where I should tell FBSD (and if so: 
> how) about the presence of the new drive?
> 
> Finally: I do not intent to run X on the machine, as it'll be a 
> webserver only (well, incl. DB stuff etc.), and the drive is intended 
> for being used to make remote back-ups on DVD-RW (yes: someone will 
> physically swap the DVDs when necessary ;) ). What I'd like to know is 
> what the easiest/best ways are to do so from the command-line. Does 
> anyone have some scripts for this? Or perhaps some pointers to a good 
> (preferrably free) program or tutorial?
> 
> As always: thanks in advance for your time, and your answers. :)
> 
> Cheers,
> Olafo

Hello Olafo.
As I can see, Uli replied the right answer, you forgot to specify the 
filesystem type. but if there is a proper fstab-entry, like this:

/dev/acd0               /cdrom                  cd9660  ro,noauto   0 0

then it should work properly by typing

mount /cdrom

In my case, I utilize amd(8) to automatically mount a disk. This ma be 
an option to you.
I also do backups on DVD+RW, but this is a more 'tricky' job if it is 
done the automated way.
One possible way is to use 'growisofs' (found in 
ports/sysutils/dvd+rw-tools). But this tool needs 'root' or some 
workarounds when used via 'sudo' (you can not use growisofs via sudo the 
direct way!).

Another way is to use 'burncd(8)', but it only works with dvd+rw for me 
and burncd is definitely broken for some CD-R/CD-RW drives/formats 
(burncd isn't capable closing the session properly, so for CD-R/CD-RW 
you should use 'cdrecord' from ports/sysutils/cdrtools). For me, burncd 
operates on my NEC DVD+RW drive properly, but you need ISO Images to 
burn on DVD+RW/DVD+R (growisofs uses a built-in 'dd' to burn 'on the 
fly', which is preferable in some ways).
An Advantage of burncd(8) is: it works with sudo(8) and it is part of 
the FreeBSd OS. Disadvantage: it seems to have poor maintenance and does 
not work properly with some drives. Assuming you have made a ISO image 
with mkisofs (also found in ports/sysutils/cdrtools), you can burn as a 
normal user via sudo via:

sudo burncd -f /dev/acd0 dvdrw /path/to/datafile

Hope this helped a little bit. There are sophisticated ways of doing 
backups via DVD-+RW/DVD-+R with shell scripts, so use the search 
function of the mailing lists.

Oliver



More information about the freebsd-questions mailing list