Monday, December 3, 2007

file: DRAG me into CD/RW :)

Its high time we must bid bye-byes to cdrecord and growisofs...!

Until yesterday were were using the ISO9660 filesystem for burning the CDs and DVDs. But from now, its an oblivion.... welcome UDF.. Universal Disk Format..!
UDF lets us write datas incrementally to a mounted filessytem.

For this to work you should have the udftools package installed on your system, one blank cdrw, distribution of linux with a 2.6 kernel ( i tested in RHEL 5.0 ).

you can get the udftools package from here

here we goooooooo

Step 1:
Insert the blank cdrw into the drive and using the cdrwtool command which
we got from the udftools package, we are doing to blank the cdrw first..
Assuming your cd-burner is connected as secondary master..(/dev/hdc)

#cdrwtool -d /dev/hdc -t 4 -l 3 -q
( man cdrwtool )
this would blank the cdrw. Please be patient, it might take SOME time..!

Step 2:
We need to associate the blank formatted media with a packet device using the command pktsetup.

#pktsetup dragme /dev/hdc

Step 3:
Now we need to format the media with the udf filesystem,

#mkudffs --media-type=cdrw --udfrev=0x0150 /dev/pktcdvd/dragme

Step 4:
Now we need to make a mountpoint, let me give it as /drag-n-drop
#mkdir /drag-n-drop

#mount -t udf -o rw /dev/pktcdvd/dragme /drag-n-drop

#chmod 777 /drag-n-drop
(If you want local uses also to drag-n-drop something into it)

Now try some drag and dropping into that mountpoint

Now about the unmounting,

Its always safe to sync before unmouting,
So,
#sync
#umount /dev/pktcdvd/dragme

Then we can release the device /dev/pktcdvd/dragme from the packet device association.

#pktsetup -d /dev/pktcdvd/dragme

NOTE: Its always good to mount the packet device with noatime mount option if you want to ignore the number of rewrites in your media.

Now if you want to mount this media in other machine,
make a packet device with pktsetup and associate it with the device of your cd-drive

#pktsetup dragger /dev/hdd

This will map /dev/pktcdvd/dragger with /dev/hdd
Now you can mount the packet device and use it
#mount -t udf /dev/pktcdvd/dragger /mnt

~mj0vy

No comments: