![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2005
Location: 2630m closer to the stars
My beans are hidden!
|
HOW-TO: Packet Writing without tears
Packet Writing Without Tears: How to use Rewritable Optical Media in Ubuntu
Pedro A. López-Valencia python -c 'print "cGFsb3BlenZAZ21haWwuY29t".decode("base64")' The Linux kernel supports packet writing on read-only and rewritable media since kernel 2.6.8, as was the case in Hoary. Yet I only managed to have it work consistently in Breezy. It took some head scratching, but then it hit like a truck: You don't need to be a rocket scientist to do it!!!. But trying to understand how to do it can make a grown man cry. What the heck is Packet Writing? Good question! One of the design goals of the UDF filesystem was to allow incremental data addition to optical media. That is, to be able to write packets of data. In essence it allows one to use a CD or a DVD as an oversized floppy disk. In fact, many of you may have used EasyCD, Roxio's Write-On-CD, Nero InCD, or some other commercial product in MS Windows to read and write CDs, particularly CDRWs, this way. As it is the case with floppy disks, reliability is poor; any glitch and your data is done for. Furthermore many software vendors in the MS Windows world have managed to make their implementations incompatible to each other, to the point that you may not be able to open for writing a disk created with a different utility, and even fail to read it. And they may claim to use the same UDF format version! In other words, if you think you will be doing your critical data backups with packet writing instead of old-fashioned CD mastering and burning or tape backups or whatnot, you are playing with fire. Now that I've given you dire warnings, let me tell you that packet writing has its uses. It is up to you to take the risk or not. The ingredients Although the kernel has support for packet writing, you need to install the user space tools to be able to access the kernel services. Enable the universe repositories and: Code:
sudo apt-get install udftools Code:
sudo <your_editor> /etc/default/udftools Code:
DEVICES="/dev/hdd" Now, set up your drive: Code:
sudo /etc/init.d/udftools start Formatting your CD-RW Take a CD-RW or DVD-/+RW and format it: Code:
sudo cdrwtool -t 4 -d /dev/hdd -q cdrwtool burns at a speed of 12x by default, yet most CDRWs and DVD-/+RWs, particularly the cheap ones, support slower burning speeds. 4x seems to be a very common maximum speed for rewritable media, so I've put it in the example above. It is always a good idea to define explicitly the max writing speed of your media, or formatting will fail. Before you start formatting your CD, make sure that you have DMA active in your burner; else you'll get funny formatting errors and failures. By default, Ubuntu's kernels do not activate DMA busmastering on anything different to PATA disks, because older CD readers and burners tend to belly up when you activate DMA in the IDE bus and lock up the system. In order to activate permanently DMA, you must edit your /etc/hdparm.conf. Suppose you have a CD or DVD burner in /dev/hdc then you would add the following lines: Code:
/dev/hdc {
dma = on
io32_support = 1
}
Code:
sudo hdparm -c1 -d1 /dev/hdc There is only one thing to consider. You need to use the special packet writing device, not the normal disk device!!! Like this: Code:
sudo mount -t udf -o utf8,noatime /dev/pktcdvd/0 /your/mount/point Making the CD/DVD-RW writable by you Before you start using your CD-RW, you need to make it writable by other users different to root: Code:
sudo chown 777 /your/mount/point/. Making a permanent addition to your system Now you are ready to set up your system to mount and unmount your CDs without effort. Create an entry in /media: Code:
sudo mkdir -p /media/cdwriter Code:
/dev/pktcdvd/0 /media/cdwriter udf user,noauto,noatime,utf8 0 0 Last edited by dradul; February 17th, 2006 at 09:41 AM.. |
|
|
|
|
|
#2 |
|
Ubuntu Extra Shot
![]() |
Re: HOW-TO: Packet Writing without tears
I seem to be getting illegal seek errors during formatting.
Code:
dave@ubuntu:~$ sudo cdrwtool -d /dev/hdc -q
Password:
using device /dev/hdc
672KB internal buffer
setting write speed to 12x
Settings for /dev/hdc:
Fixed packets, size 32
Mode-2 disc
I'm going to do a quick setup of /dev/hdc. The disc is going to be blanked and formatted with one big track. All data on the device will be lost!! Press CTRL-C to cancel now.
ENTER to continue.
Initiating quick disc blank
wait_cmd: Input/output error
Command failed: a1 01 00 00 00 00 00 00 00 00 00 00 - sense 05.30.00
blank disc: Illegal seek
dave@ubuntu:~$
mkudffs + dvd+rw-format haven't been working for me. |
|
|
|
|
|
#3 | |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2005
Location: 2630m closer to the stars
My beans are hidden!
|
Re: HOW-TO: Packet Writing without tears
Quote:
Code:
sudo hdparm -d1 /dev/hdc I forgot to mention it in the howto. EDIT: Added. Another thing I missed. cdrwtool defaults to burning to 12x. Most CD-RW and DVD-/+RW disks support slower sppeds and you should use the speed flag explicitly. Last edited by dradul; February 17th, 2006 at 08:23 AM.. |
|
|
|
|
|
|
#4 |
|
Ubuntu addict and loving it
![]() Join Date: Feb 2005
Location: Melbourne, Australia
Beans: 7,836
Ubuntu 9.04 Jaunty Jackalope
|
Re: HOW-TO: Packet Writing without tears
I have my UDF set up in a similar manner to what has been described, I also have my UDF disk auto-mounted at boot up, here is how I did that:
http://ubuntuforums.org/showpost.php...18&postcount=2
__________________
Regards, David. The Forum search function is useful for immediate help (give it a try).
Please mark your thread as "Solved" (using the Thread Tools) when appropriate. |
|
|
|
|
|
#5 | |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2005
Location: 2630m closer to the stars
My beans are hidden!
|
Re: HOW-TO: Packet Writing without tears
Quote:
|
|
|
|
|
|
|
#6 |
|
Dipped in Ubuntu
![]() Join Date: May 2006
Location: BC , Canada
My beans are hidden!
Ubuntu 8.04 Hardy Heron
|
Re: HOW-TO: Packet Writing without tears
I have a DVD-R/W and a seperate CD-R/W drive installed. How do I know where I use them? hda, hdb, hdc, etc? Please help! I'm trying to get packet writing running since I first used Linux 2 years ago. Now I found Pedro's HowTo and it seems I'm very close, but still don't know how to continue?
|
|
|
|
|
|
#7 | |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2005
Location: 2630m closer to the stars
My beans are hidden!
|
Re: HOW-TO: Packet Writing without tears
Quote:
Newer mainboards come with only one IDE interface (for CD/DVD devices), and use SATA (Serial ATA) interfaces for hard-drives. Linux uses a SCSI emulation for the interface of such devices and therefore they are seen as /dev/sd*. In this case, the Cd/DVD devices would be in the primary IDE interface (IDE0) and will be seen as "hda" and "hdb". |
|
|
|
|
|
|
#8 | |
|
Dipped in Ubuntu
![]() Join Date: May 2006
Location: BC , Canada
My beans are hidden!
Ubuntu 8.04 Hardy Heron
|
Re: HOW-TO: Packet Writing without tears
Quote:
The Device Manager tells me that the Parallel ATA controller has 2 IDE devices connected--Master device DVDRAM GSA-4160B and Slave device CDRAM GCE-8526B. So, during the Ubuntu installation the hardware was detected correctly. Now the question: Into which file is the information and the name of the two drives written? Is it in /etc/fstab? |
|
|
|
|
|
|
#9 | |
|
Dipped in Ubuntu
![]() Join Date: May 2006
Location: BC , Canada
My beans are hidden!
Ubuntu 8.04 Hardy Heron
|
Re: HOW-TO: Packet Writing without tears
Quote:
To enable the other drive, would I have to repeat this line? So my file would look like this? DEVICES="/dev/hda" DEVICES="/dev/hdb" or is the entry rather: DEVICES="/dev/hda /dev/hdb"??? Last edited by Cariboo1938; September 2nd, 2006 at 07:59 PM.. |
|
|
|
|
|
|
#10 |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2005
Location: 2630m closer to the stars
My beans are hidden!
|
Re: HOW-TO: Packet Writing without tears
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|