Set up DVD-RAM in PCLinuxOS

by ClareOldie

In my previous article, I described how to set up packet writing in PCLinuxOS. This allowed me to use CD-RW media with a UDF file system for true Read/Write functions.

Flushed with success, I began to wonder about DVD-RAM. I had purchased an external drive which was RAM-compatible and also LightScribe compatible, but that is for another day. A couple of weeks ago I purchased three DVD-RAM media for testing. Today I actually got around to trying this out.

I was very discouraged when I put the RAM media in the drive - nothing, absolutely nothing! I spent considerable time trying to figure out what I was doing wrong and what was required.

Oh how simple it all was! The following is an account of what I did, preceded by a small bit of general information.

A DVD-RAM media can be regarded just like a removable HDD. When you get the media it is blank, so you need to Format it before use. It appears that Linux will use a DVD-RAM formatted in any of its known formats. So which to chose? I had decided against FAT, had used UDF on the Packet-Writing project, so I decided to format the media just as I would a HDD - as ext2fs.

The next part caused me some stress. I was doing this on my main computer, still running .93, and could not afford to lose either the OS or my data. I could have (and probably should have) moved the external drive to my test machine running 2007 TR3. I didn't bother, but I wouldn't recommend that to others. I checked the entries in /etc/fstab to make sure I used the correct device. I certainly didn't want to format my HDD!

Once I had the required information, and had double checked it, the rest was simplicity itself. My fstab file looked like this:-

none /proc proc defaults 0 0
none /proc/bus/usb usbfs defaults 0 0
none /dev/pts devpts mode=0620 0 0
/dev/sda5 / ext3 defaults 1 1
/dev/sda6 /home ext3 defaults 1 2
/dev/sda7 /mnt/music ext3 users,rw,auto,exec 0 0
/dev/sda2 swap swap defaults 0 0
/dev/sr0 /mnt/cdrom auto users,exec,noauto 0 0
/dev/hda /mnt/cdrom1 auto users,exec,noauto,utf8,iocharset=iso8859-15 0 0
/dev/pktcdvd/0 /media/packetcd0 udf noauto,rw,users 0 0

Device hda is an internal DVD drive which is not RAM-capable. Device /dev/sr0 is my external RAM-capable drive and the entry /dev/pktcdvd/0 is the entry for the packet writing referred to above. So the device to use was /dev/sr0.

Next I opened a terminal and used su to get to root. From there, I typed in the format command and the device that was to be formatted. Believe me, I checked this a couple of times before I hit the 'enter' key. The following is the output from the terminal:-

[root@localhost:user] mke2fs -b 2048 /dev/sr0
mke2fs 1.39 (29-May-2006)
/dev/sr0 is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
561152 inodes, 2236704 blocks
111835 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=540016640
137 block groups
16384 blocks per group, 16384 fragments per group
4096 inodes per group
Superblock backups stored on blocks:
    16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816, 1327104,
    2048000

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost:user]

The first line is the command I entered and the second line tells me what version of the format (make file system) command PCLinuxOS is using. As I had specified the complete media (about 4.3 GB) the programme asked if I wished to format it completely (and not partition it). I said yes. After that it just reported back as it progressed, until it finished and gave me the root prompt again. I exited the terminal, but couldn't see how to use the media. All it took was to eject it and reinsert the media. It automatically mounted when inserted and I got the usual pop-up asking if I would like to Open the device. I did and it was empty except for the usual Lost & Found directory. I had a new 4.3 GB drive in my machine!

As I had created/formatted the drive as root, it of course had root only access and I found I could not save to it as user. I chose to change permissions using the GUI, so I switched user to root, and having logged in, I navigated to /mnt/cdrom and changed the permissions. I then unmounted the drive before switching back to my user account. The unmounting of the drive is extremely important, as the drive is only written to as Linux decides, not immediately when you issue a command. When I got back to my user account I was able to use the drive just as I would a normal partition on my HDD. I can move files to the drive just by dropping them onto the desktop icon. So far all is operating very well.

While researching this project I saw a warning to the effect that the drive should be properly unmounted before shutting down. This probably has to do with ensuring that all writes to the drive are completed before shutdown.

I also saw a reference that the DVD-RAM media should be bootable. I haven't yet tried this, but it should be fun to try.

Also it may be more beneficial to format the media as UDF. This file system, I believe, will try to use the whole area of the media equally and not concentrate its writing in one area, thus limiting the life of the media. The DVD-RAM media can sustain many more writes than a DVD-RW media and so are more suitable for daily use.

That's it folks. I haven't had much time to play with this but it seems to be very successful. The only negative I know about is the cost of the media. They are quite a bit dearer than DVD-RW which can be used for Packet Writing.

I had fun doing this and wish you all the best, if you should try it for yourselves.

Top