|
|
Linux and DVD RAM
DVDRAM is a really useful storage medium, but only if you can get a filesystem onto it. There seems to be three practical options on Linux.
-
UDF: its used by DVD-RAM based consumer video recorders
-
EXT2: it works, but its slow. Mounting with 'noatime' might help.
-
reiserfs: the 'net tells me it should work
-
FAT32: I couldn't get this to work.
In each case, I've got some key questions.
All the detail is below, but in summary, UDF offers the best capacity and acceptable write speeds. EXT2 is faster, but it can't hold as much. ReiserFS is pretty sluggish, and thats with no logs being written. Its not best suited for this medium.
|
UDF |
ReiserFS |
EXT2 |
| speed (bytes/sec) |
1561255.59 |
1201957.65 |
1820073.16 |
| speed (% of EXT2) |
85.78% |
66.04% |
100.00% |
| available capacity (kb) |
4472064 |
4456680 |
4202746 |
| capacity (% of UDF) |
100.00% |
99.66% |
93.98% |
UDF
UDF is the obvious candidate. There are claims abound on-line that Linux supports UDF. However, you're best not to try to use it on 2.6 kernels below 2.6.17 - an overflow bug was found in the code, and it was limited to file sizes of 1gb between 2.6.17 and 2.6.21.
udf broken in the kernel
I can't say I had a huge amount of luck with SuSE 10.3, which has kernel 2.6.22. I tried it on a new server with a serial ATA DVDRAM drive, and it'll only mount the disks read only, initially, requiring the disk to be remounted read-write ( mount -o remount,rw ). Then, I couldn't create a file above 300mb, and it refused to create new filesystems.
There was a bug in the mount command which could cause issues when multiple filesystem types are specified in the mount command. This is discussed in the thread linked below; will be interesting to see if I can reproduce the other issue on a SATA DVD RAM drive later ..
mount bug (opens in a new window)
I've been flirting a lot with ubuntu since then, particularly on desktops. To save a rebuild, I tried the live CD (8.04, kernel 2.6.24) initially - on a machine with two DVD writers. It wouldn't mount the UDF disk or, for that matter, NFS. This looks like a limitation of the live disk.
A clean install of ubuntu 8.04 impresses quickly. It detects and mounts udf formatted disks, it mounts them read-write and the mount point is defined with UDF as an option.
ben@pegasus:~$ df -k /dev/scd0
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/scd0 4472320 354 4471966 1% /media/cdrom0
ben@pegasus:~$ grep cdrom0 /etc/mtab
/dev/scd0 /media/cdrom0 udf rw,nosuid,nodev,utf8,user=ben 0 0
ben@pegasus:~$ grep scd /etc/fstab
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
|
First test disk was formatted by a consumer DVD video writer. ubuntu has presented all the directories, including root, as unwritable, which was the first hurdle.
May 15 20:12:38 pegasus kernel: [ 7412.428141] UDF-fs INFO UDF 0.9.8.1 (2004/29/09) Mounting volume 'DVD_VIDEO_RECORDER',
timestamp 2006/10/30 08:26 (103c)
|
ben@pegasus:/media/cdrom0$ touch zerofile.test
touch: cannot touch `zerofile.test': Permission denied
ben@pegasus:/media/cdrom0$ sudo chmod 777 .
[sudo] password for ben:
ben@pegasus:/media/cdrom0$ ls -al
total 4
drwxrwxrwx 3 4294967295 4294967295 88 2006-10-30 07:26 .
drwxr-xr-x 3 root root 96 2008-04-22 18:48 ..
dr-xr-xr-x 2 4294967295 4294967295 196 2006-10-30 07:26 DVD_RTAV
|
To check it doesn't hit a low file size limit and see what the speed is like, I try 1gb first.
ben@pegasus:/media/cdrom0$ date; dd if=/dev/zero of=zerofile.test bs=1k count=`expr 1024 \* 1024` ; date
Thu May 15 19:19:27 BST 2008
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 1299.74 s, 826 kB/s
Thu May 15 19:41:07 BST 2008
|
Rather than wait over an hour to see if it'll write 4gb, it seemed worth seeing if there was quicker way to hit any hard coded limits. Default behaviour appears to be asynchronous mounting; setting it not to update access time (noatime) is also tipped as a way to speed some filesystems up, as they don't have to update the file entry in the directory so often.
ben@pegasus:/$ grep scd0 /etc/mtab
/dev/scd0 /media/cdrom0 udf rw,nosuid,nodev,utf8,user=ben 0 0
ben@pegasus:/$ sudo mount -o remount,noatime,async /dev/scd0
ben@pegasus:/$ grep scd0 /etc/mtab
/dev/scd0 /media/cdrom0 udf rw,nosuid,nodev,noatime,utf8 0 0
ben@pegasus:/media/cdrom0$ date; dd if=/dev/zero of=zerofile.test bs=1k count=`expr 1 \* 1024 \* 1024` ; date
Thu May 15 20:15:38 BST 2008
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 554.827 s, 1.9 MB/s
Thu May 15 20:24:57 BST 2008
ben@pegasus:/media/cdrom0$ date; dd if=/dev/zero of=zerofile.test bs=1k count=`expr 4 \* 1024 \* 1024` ; date
Thu May 15 20:36:37 BST 2008
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 2750.97 s, 1.6 MB/s
Thu May 15 21:22:28 BST 2008
|
Next key test is creation of a UDF file system. Installation of the tools package presents some things to investigate.
ben@pegasus:~$ sudo apt-get install udftools
[sudo] password for ben:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
pmount
The following NEW packages will be installed
udftools
Setting up udftools (1.0.0b3-13) ...
Not starting udftools packet writing: No devices listed in /etc/default/udftools
|
mkudffs is then installed, dated February 2002. Reviewing the options:
-
default UDF revision 0x0201 (latest release available in this toolset)
-
default block size 2048
-
allocaton strategy is based on media type
-
--media-type=dvdram would seem to make sense
ben@pegasus:/$ sudo mkudffs --media-type=dvdram /dev/scd0
[sudo] password for ben:
start=0, blocks=16, type=RESERVED
start=16, blocks=3, type=VRS
start=19, blocks=237, type=USPACE
start=256, blocks=1, type=ANCHOR
start=257, blocks=16, type=PVDS
start=273, blocks=1, type=LVID
start=274, blocks=2236173, type=PSPACE
start=2236447, blocks=1, type=ANCHOR
start=2236448, blocks=239, type=USPACE
start=2236687, blocks=16, type=RVDS
start=2236703, blocks=1, type=ANCHOR
|
May 15 21:58:36 pegasus kernel: [13769.499655] UDF-fs INFO UDF 0.9.8.1 (2004/29/09) Mounting volume 'LinuxUDF',
timestamp 2008/05/15 21:57 (103c)
|
ben@pegasus:/$ df -k /media/cdrom0
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/scd0 4472346 282 4472064 1% /media/cdrom0
|
ReiserFS
Googling for the latest turned up an interesting suggestion - using reiserfs.
The post I found said to use the 'nolog' option, but neither mkreiserfs or reiserfstune seem to have one. However, it looks like it maybe an option at mount time.
reiserfs options - google cache (opens in a new window)
Commands, output, and syslog output follows, showing creating of the filesystem, the automounter attempting to use UDF and ISO9660 (as per the configured default mount settings) and then an explicit mount command.
/dev/scd0 is entire device, not just one partition!
Use -f to force over
ben@pegasus:/$ sudo /sbin/mkreiserfs -f --block-size 2048 --label test /dev/scd0
mkreiserfs 3.6.19 (2003 www.namesys.com)
(credit to Vladimir Saveliev, Alexander Lyamin abbreviated)
/dev/scd0 is entire device, not just one partition!
Continue (y/n):y
Guessing about desired format.. Kernel 2.6.24-16-generic is running.
Format 3.6 with standard journal
Count of blocks on the device: 2236704
Number of blocks consumed by mkreiserfs formatting process: 8364
Blocksize: 2048
Hash function used to sort names: "r5"
Journal Size 8193 blocks (first block 34)
Journal Max transaction length 512
inode generation number: 0
UUID: 7ff9d06d-0e0d-439e-8c8e-6c29a25a3dd6
LABEL: test
Initializing journal - 0%....20%....40%....60%....80%....100%
Syncing..ok
ben@pegasus:/$ sudo mount /dev/scd0 -t reiserfs -o noatime,nolog,rw /media/cdrom0
ben@pegasus:/$ df -k /media/cdrom0
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/scd0 4473132 16452 4456680 1% /media/cdrom0
|
May 15 22:05:23 pegasus kernel: [14175.837095] UDF-fs: No partition found (2)
May 15 22:05:23 pegasus kernel: [14176.614181] ISOFS: Unable to identify CD-ROM format.
May 15 22:07:06 pegasus kernel: [14279.520943] ReiserFS: sr0: found reiserfs format "3.6" with standard journal
May 15 22:07:06 pegasus kernel: [14279.521882] ReiserFS: sr0: using ordered data mode
May 15 22:07:06 pegasus kernel: [14279.626624] ReiserFS: sr0: journal params: device sr0, size 8192, journal first block 34,
max trans len 512, max batch 450, max commit age 30, max trans age 30
May 15 22:07:06 pegasus kernel: [14279.633521] ReiserFS: sr0: checking transaction log (sr0)
May 15 22:07:11 pegasus kernel: [14283.936962] ReiserFS: sr0: Using r5 hash to sort names
May 15 22:07:11 pegasus kernel: [14283.937298] ReiserFS: sr0: warning: Created .reiserfs_priv on sr0 - reserved for xattr storage.
|
ben@pegasus:/$ cd /media/cdrom0
ben@pegasus:/media/cdrom0$ sudo chmod 1777 .
ben@pegasus:/media/cdrom0$ date; dd if=/dev/zero of=zerofile.test bs=1k count=`expr 4 \* 1024 \* 1024` ; date
Thu May 15 22:10:43 BST 2008
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 3573.31 s, 1.2 MB/s
Thu May 15 23:10:16 BST 2008
|
ext2
EXT2 left memories of sluggishness - will be interesting to see if noatime helps. Capacity seems a little short, so slightly less data will be written.
ben@pegasus:~$ sudo mke2fs -b 2048 -L ext2_dvdram /dev/scd0
mke2fs 1.40.8 (13-Mar-2008)
/dev/scd0 is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=ext2_dvdram
OS type: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
280576 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
2048 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 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
ben@pegasus:~$ sudo mount /dev/scd0 -t ext2 -o noatime,rw /media/cdrom0
ben@pegasus:~$ cd /media/cdrom0
ben@pegasus:/media/cdrom0$ sudo chmod 1777 .
ben@pegasus:/media/cdrom0$ df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/scd0 4437700 11284 4202746 1% /media/cdrom0
ben@pegasus:/media/cdrom0$ date; dd if=/dev/zero of=zerofile.test bs=1k count=`expr 4 \* 1024 \* 1000` ; date
Sat May 17 16:45:40 BST 2008
4096000+0 records in
4096000+0 records out
4194304000 bytes (4.2 GB) copied, 2304.47 s, 1.8 MB/s
Sat May 17 17:24:05 BST 2008
|
Remounting (udf?)
ubuntu - using ReiserFS, and sync vs. nosync
Printed and hosted by Prater Raines Ltd, 98 Sandgate High Street, Folkestone CT20 3BY.
Published and promoted by Ben Prescott, 14, St James's Square, Bournemouth, BH5 2BX. All rights reserved.
The views expressed are solely those of the author, not of the service provider.
|