------------------------------------------------------------------------ Tracey DeLaney Harvard-Smithsonian tdelaney@cfa.harvard.edu * Center for Astrophysics Phone: (617) 496-1985 * * * * 60 Garden Street, MS 67 Fax: (617) 496-7969 * * Cambridge, MA 02138 USA ------------------------------------------------------------------------ I found a nice explanation for setting up udf writing at http://w1.894.telia.com/~u89404340/packet.html and http://cvs.linuxfromscratch.org/index.cgi/hints/Attic/cdrw-hint.txt?rev=1.3 basically: 1. need to patch the kernel 2. need the packet writing tools 3. need to set everything up properly The usenet archive is pretty useful if you have problems http://lists.suse.com/archive/packet-writing/ note that these newer versions support writing to CD as well as DVD the whole process is (borrowing hints heavily from sources above): 1. get the appropriate kernel patch at http://w1.894.telia.com/~u89404340/patches/packet/ for kernel 2.6.8 specifically http://w1.894.telia.com/~u89404340/patches/packet/2.6/packet-2.6.8.patch.bz2 2. Become superuser and move to your linux source directory, then apply the patch with: 'patch -Np1 -i packet-2.6.8.patch' 3. Now run 'make xconfig', or whatever version of kernel config you use such as 'make menuconfig' Go to the section on 'Block Devices' and select: Packet writing on CD/DVD media Now go to the section on 'File systems' and select the following: UDF files systems support (read only) UDF write support (DANGEROUS) Despite the note on this latter option saying it only applies to fixed disks and DVD-RAM, the patch will make it work with CD-RW too! Select 'Save and Exit' 4. build your new kernel with: 'make bzImage' 4. then copy the resulting kernel to /boot as, say, vmlinuz-2.4.19-UDF. 5. If you are using modules, you now need to 'make modules' 'make modules_install' The packet writing module is called pktcdvd.o. 6. set up your boot loader to be able to boot either your old kernel or this new one. (Always keep the old kernel bootable, just in case...) 7. Now reboot with the new kernel, it should be almost identical to your old one. 8. if you built the packet driver as a module and you have kernel < 2.6.8, you need to add: alias block-major-97 pktcdvd to your /etc/modules.conf file or /etc/modprobe.conf depending on linux version. 9. if your kernel is less than 2.6.8, make the packet driver device file As superuser, make the file(s) in /dev with: 'mknod /dev/pktcdvd0 b 97 0' 'mknod /dev/pktcdvd1 b 97 1' etc... If you want ordinary users to be able to use CD-RW, DVD+RW, or DVD-RW too, then: 'chmod 666 /dev/pktcdvd*' if your kernel is >= 2.6.8, make the directory /dev/pktcdvd and adjust the permissions for ordinary users 10. need UDF packet writing tools from http://sourceforge.net/projects/linux-udf the 2 files are: udf-0.9.8.tar.gz (this just lets the system understand udf - not necessary on newer systems) udftools-1.0.0b3.tar.gz (necessary to write udf) Unpack this is the usual way and build it with: './configure --prefix=/usr &&' 'make &&' 'make install' You now have three new programs (in /usr/bin if run as above), complete with man pages: cdrwtool - a tool to do various jobs on your CD-RW drive and disks. mkudffs - to create an UDF filesystem (on your hard disk if you want) pktsetup - a tool to setup and tear down packet drive associations. need to possibly patch udf tools depending on kernel for kernel 2.6.8 use: http://w1.894.telia.com/~u89404340/patches/packet/udftools-1.0.0b3.patch.bz2 11. If you have kernel >= 2.6.8, after reboot, there should now be a directory /dev/pktcdvd with a char device 'control' in it. 12. as superuser, you may need to suid the pktsetup program. This gives normal users the ability to execute tasks they would normally not be able to do because of tight file permission schemes. There are security concerns with using the suid option. But if you do need it, the process is: become the superuser 'chown root /path_to_pktsetup/pktsetup' 'chmod 4755 /path_to_pktsetup/pktsetup' 13. Now to actually run the programs: Lets suppose you have a CD-RW disk straight out of the box, and want to prepare it for use. You must first format the disk. If your CD-RW drive is on /dev/scd0 (treated as a scsi device like older versions of linux), then: 'cdrwtool -d /dev/scd0 -q' If your CD-RW is on /dev/hdc (treated as an ide device like newer versions of linux), then: 'cdrwtool -d /dev/hdc -q' the -d is for device, the -q is for quick setup alternatively, 'dvd+rw-format /dev/hdc' if you have this program Now set up the packet writing device: 'pktsetup /dev/pktcdvd0 /dev/hdc' for kernel < 2.6.8 'pktsetup pktcdvd0 /dev/hdc' for kernel >= 2.6.8 this associates a packet-driver with your CD-RW drive (this doesn't survive a reboot). To make sure things are going well, do (for kernel >= 2.6.8): >'ls -l /dev/pktcdvd/pktcdvd0 /dev/hdc' brw------- 1 root disk 22, 0 Feb 23 2004 /dev/hdc brw-r----- 1 root root 252, 0 Nov 9 09:39 /dev/pktcdvd/pktcdvd0 and >'pktsetup -s' 0 : 252:0 -> 22:0 Now set up the udf filesystem 'mkudffs /dev/pktcdvd/pktcdvd0' Now mount the device 'mount /dev/pktcdvd0 /mnt/cdrom -t udf -o rw,noatime' Your CD or DVD whould be mounted as a read-write filesystem, all ready to use, just like any other hard disk. You should be able to cp, mv, or create files directly on your DVD or CD. ('noatime' just speeds things up by not updating the access times, CD-RW can be a little slow) Then you can 'umount /mnt/cdrom' in the usual way, when you're done. Normally the mount command above is not allowed for normal users. In this case, I suggest setting up a new fstab entry such as /dev/pktcdvd/pktcdvd0 /mnt/dvd udf noauto,users,rw,noatime 0 0 then the simple 'mount /mnt/dvd' can be issued by anybody. To tear down the packet writing device, issue the command: 'pktsetup -d 252:0' 14. AIPS specific setup: a. create a link in the aips/DATA area just as you have for your hard disk areas, for instance: 'ln -s /mnt/dvd COMPUTERNAME_3' and make the necessary entries in the aips/DA00/NETSP and aips/DA00/DADEVS.LIST b. run pktsetup and mount your udf formatted DVD c. cd to /mnt/dvd and create the empty SPACE file with appropriate permissions - I suggest rw for all d. start AIPS in the usual way at startup, the DVD disk should be found e. transfer files to the DVD disk as you would for any other disk MOVE, SUBIM, UVCOP, ... Although possible, I would suggest not "working" directly on the DVD because it is slower and also because there are limited rewrites for RW media. f. exit from AIPS, cd to /mnt/dvd, and make sure the permissions on your new files are rw for all. This will allow you to transport your DVDs to different facilities or between work and home or onto your laptop without permission problems. g. unmount your DVD, and tear down the packet device --- end