| View previous topic :: View next topic |
| Author |
Message |
aent n00b

Joined: 24 May 2003 Posts: 49 Location: Here
|
Posted: Fri May 14, 2004 2:26 am Post subject: HOWTO: Packet Writing on CD-RW media (mount rw, ala InCD) |
|
|
For those of you who want to be able to use CD-RWs like you would a floppy under Gentoo, look no further!
Kernel Patches
Kernel Patches
Details
Goal: Use your CD-RWs like you would a floppy, just dragging stuff onto the mounted CD ROM.
- Uses UDF on CD-RW filesystem, so its compatible with Nero InCD.
NOTE: All computers must have UDF read support in order to read any CDs created using the method in this post. This means all Windows machines must have Nero InCD and all Linux machines must have the UDF read support kernel option enabled.
Instructions
Moved to Gentoo-Wiki: http://gentoo-wiki.com/HOWTO_Packet_Writing_on_CD-RW
Last edited by aent on Thu Dec 16, 2004 4:50 am; edited 1 time in total |
|
| Back to top |
|
 |
Hypnos Advocate


Joined: 18 Jul 2002 Posts: 2770 Location: Omnipresent
|
Posted: Thu May 20, 2004 3:26 am Post subject: |
|
|
Thanks -- works like a charm, and with ATAPI!
One thing:
Since I use swsusp2, I had to change PF_IOTHREAD to PF_NOFREEZE after applying the patch. _________________ Personal overlay | Simple backup scheme |
|
| Back to top |
|
 |
Rainmaker Veteran


Joined: 12 Feb 2004 Posts: 1650 Location: /home/NL/ehv/
|
Posted: Fri May 28, 2004 5:38 am Post subject: |
|
|
sounds great!
Is it possible to use this in combination with subfs?
So you don't have to mount and unmount every time, just pop in the cd, and use it as an "extra harddisk" _________________ If you can't dazzle them with brilliance, baffle them with bullshit. |
|
| Back to top |
|
 |
Hypnos Advocate


Joined: 18 Jul 2002 Posts: 2770 Location: Omnipresent
|
Posted: Fri May 28, 2004 9:23 pm Post subject: |
|
|
| Rainmaker wrote: | sounds great!
Is it possible to use this in combination with subfs?
So you don't have to mount and unmount every time, just pop in the cd, and use it as an "extra harddisk" |
Yes, that's the exact same setup I have.
One thing I found, though, that on bulk writes (like when backing up devices) it's _very_ slow -- 1x at most. I'll have to try it without subfs and see how it fares ... _________________ Personal overlay | Simple backup scheme |
|
| Back to top |
|
 |
fkurth n00b


Joined: 15 Apr 2002 Posts: 27 Location: Dresden/Germany
|
Posted: Sat May 29, 2004 4:48 pm Post subject: |
|
|
Yes, works,
but terrible slow.
3Kb/s writing speed.... _________________ --
Felix Kurth |
|
| Back to top |
|
 |
Hypnos Advocate


Joined: 18 Jul 2002 Posts: 2770 Location: Omnipresent
|
Posted: Sat May 29, 2004 7:52 pm Post subject: |
|
|
| fkurth wrote: | Yes, works,
but terrible slow.
3Kb/s writing speed.... |
You're not using subfs, are you? I have yet to try without subfs ...
If not then, then there's a problem with the driver ... _________________ Personal overlay | Simple backup scheme |
|
| Back to top |
|
 |
fkurth n00b


Joined: 15 Apr 2002 Posts: 27 Location: Dresden/Germany
|
Posted: Sat May 29, 2004 8:01 pm Post subject: |
|
|
no, i dont use subfs on this device.
There is an option
CDROM_PKTCDVD_BUFFERS
in kconfig. Maybe playing eith it may help ?
Has anyone tried it ? _________________ --
Felix Kurth |
|
| Back to top |
|
 |
kbarter n00b


Joined: 30 Dec 2003 Posts: 14
|
Posted: Tue Jun 08, 2004 6:45 pm Post subject: |
|
|
From what I have been able to read on the net, this procedure should work for DVD too.
Am I correct in thinking this?
Thanks |
|
| Back to top |
|
 |
bigboote n00b


Joined: 27 May 2003 Posts: 14 Location: Chicago, IL USA
|
Posted: Sun Jun 13, 2004 6:50 pm Post subject: |
|
|
Changes to example /etc/fstab entry:
| Code: | | /dev/pktcdvd0 /mnt/cdrw udf noauto,noatime,users 0 0 |
Removing "sync" from the line above made a tremendous difference speedwise. _________________ rundll32.exe shell32.dll,SHExitWindowsEx 1
Last edited by bigboote on Wed Jun 16, 2004 11:16 pm; edited 1 time in total |
|
| Back to top |
|
 |
bigboote n00b


Joined: 27 May 2003 Posts: 14 Location: Chicago, IL USA
|
Posted: Sun Jun 13, 2004 8:13 pm Post subject: |
|
|
Here's a modified initscript. It works on my devfs system, but should easily be tweakable for any system.
/etc/conf.d/cdrw
| Code: | # List the CD-Rom drives you wish to enable packet writing on here.
# Some examples follow:
#cdrw_list="/dev/hdd"
#cdrw_list="/dev/sr0 /dev/sr1 /dev/sr2"
#cdrw_list="/dev/cdroms/cdrom0 /dev/cdroms/cdrom1"
cdrw_list="/dev/cdroms/cdrom0" |
/etc/init.d/cdrw
| Code: | #!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
depend() {
need localmount
}
start() {
local i
local minor=0
local retval=0
local last_result=0
for i in ${cdrw_list}
do
ebegin "Enabling CD-RW packet writing on ${i}"
if [ ! -e "/dev/pktcdvd" ]
then
modprobe -a pktcdvd
fi
/usr/bin/pktsetup /dev/pktcdvd/${minor} ${i} >/dev/null 2>&1
last_result=$?
retval=$(( ${retval} + ${last_result} ))
minor=$(( ${minor} + 1 ))
if [ ${last_result} -gt 0 ]
then
ewend ${last_result} "Failed to enable packet writing on ${i}"
fi
done
eend ${retval}
}
stop() {
local i
local minor=0
local retval=0
local last_result=0
for i in ${cdrw_list}
do
ebegin "Disabling CD-RW packet writing on ${i}"
umount /dev/pktcdvd/${minor} >/dev/null 2>&1 || true
/usr/bin/pktsetup -d /dev/pktcdvd/${minor} ${i} >/dev/null 2>&1
last_result=$?
retval=$(( ${retval} + ${last_result} ))
minor=$(( ${minor} + 1 ))
if [ ${last_result} -gt 0 ]
then
ewend ${last_result} "Failed to disable packet writing on ${i}"
fi
done
eend ${retval}
} |
_________________ rundll32.exe shell32.dll,SHExitWindowsEx 1 |
|
| Back to top |
|
 |
manny15 Guru


Joined: 01 Dec 2002 Posts: 469 Location: USA
|
Posted: Sat Jul 03, 2004 4:43 pm Post subject: |
|
|
I'm having trouble writing to my UDF CDRW as a normal user. I have the following in /etc/fstab
| Code: | | /dev/pktcdvd/0 /mnt/cdrw udf noauto,noatime,users 0 0 |
and the permissions on /mnt/cdrw are | Code: | | drwxrwxrwx 2 root root |
I can mount as a user, but if I try to write to it I get: | Code: | | touch: cannot touch `/mnt/cdrw/test.txt': Permission denied | . While mounted the permissions are: | Code: | | drwxr-xr-x 3 root root | . As root (even if I mounted as a user) I can write to the CD. I'm running kernel 2.6.7-ck2. Any ideas? |
|
| Back to top |
|
 |
ljubo n00b


Joined: 26 Nov 2003 Posts: 73 Location: Karlovac, Croatia
|
Posted: Mon Jul 05, 2004 12:35 pm Post subject: |
|
|
| manny15 wrote: | | As root (even if I mounted as a user) I can write to the CD. I'm running kernel 2.6.7-ck2. Any ideas? |
There is a recent post on packet-writing mailing list by Peter Osterlund that explains everything:
http://lists.suse.com/archives/packet-writing/2004-Jul/0001.html
| Code: | If you run
chmod 777 /media/dvdrecorder
as root after mounting the file system, any user should then be allowed to
write to the disc. (You only have to do this once for each disc after
creating the file system.)
The user=markea option only means that user markea mounted the filesystem,
it doesn't give that user any additional access rights. |
Best regards, Ljubo |
|
| Back to top |
|
 |
manny15 Guru


Joined: 01 Dec 2002 Posts: 469 Location: USA
|
Posted: Tue Jul 06, 2004 8:53 pm Post subject: |
|
|
| Thankyou ljubo. The trick is to do the chmod 777 [mount point] AFTER mounting the udf disk. That seems to do the trick. I remounted and was then able to make changes as a user. I'm assuming it writes something to the udf filesystem when you do that. It would be nice to do it ahead of time, when the fs is created. Thanks! |
|
| Back to top |
|
 |
Joseph_sys Advocate

Joined: 08 Jun 2004 Posts: 2316 Location: Edmonton, AB
|
Posted: Wed Jul 07, 2004 3:40 pm Post subject: Strange group:owner ID |
|
|
I formated CDRW (as UDF -packet writing) format.
While the CDRW was mounted I changed group:owner (/mnt/cdrw) to joseph:users
My entry if fstab looks as follow:
/dev/pktcdvd0 /mnt/cdrw udf noauto,noatime,rw,users 00
Everything works as it suppose to I can write and read to/from CDRW as one big floppy.
When I unmount it and mount it again the group and owner stays the same joseph:users
However, when I used Windows PC to write to the CDRW formated in Linux it worked Windows was able to write to CDRW Linux formated disk.
But when I mounted the same CDRW again on my Gentoo box the owner and group (/mnt/cdrw) is showing as some strange number:
4294967255:4294967255
I don't know where this number comes from but my idea is that the cdrw takes ownership from some kind of process ID number that mounted the CDRW.
How do i change this behavior; so when I mount mount the disk the owner:group is joseph:users? _________________ #Joseph |
|
| Back to top |
|
 |
manny15 Guru


Joined: 01 Dec 2002 Posts: 469 Location: USA
|
Posted: Thu Jul 15, 2004 7:46 pm Post subject: |
|
|
Nevermind what I said. chmod 777 /mnt/cdrw doesn't work. It did work once. Wonder what happened  |
|
| Back to top |
|
 |
trbecker Tux's lil' helper


Joined: 19 Sep 2003 Posts: 136 Location: Novo Hamburgo, RS, Brazil
|
|
| Back to top |
|
 |
Gooba42 n00b


Joined: 04 Feb 2004 Posts: 13
|
Posted: Sun Aug 22, 2004 4:55 am Post subject: |
|
|
I'm approaching the end of my rope here. I followed all the directions I could find and now I'm stuck.
I enter:
pktsetup pktcdvd /dev/cdrom
It tells me "inappropriate ioctl for device". The same for pktcdvd0
If I enter:
pktsetup /dev/pktcdvd /dev/cdrom
It tells me "open packet device: Permission denied". Likewise for /dev/pktcdvd0
What am I doing wrong? I tried using mknod to create the device beforehand but someone said with DevFS it wasn't necessary so I tried it without. I've patched my pktsetup with the 1.0.0b3 patch. What else can I try? |
|
| Back to top |
|
 |
raid517 l33t

Joined: 06 Mar 2003 Posts: 946
|
Posted: Mon Aug 23, 2004 1:09 am Post subject: |
|
|
Yeah, what does that error mean? I'm getting it too.
GJ |
|
| Back to top |
|
 |
Joseph_sys Advocate

Joined: 08 Jun 2004 Posts: 2316 Location: Edmonton, AB
|
Posted: Fri Aug 27, 2004 5:32 am Post subject: packet writing udftools for kernel 2.6.8 |
|
|
Anybody knows when an update for udftools is coming out!
The current udftools-1.0.0b is not working with kernel 2.6.8 and packet-2.6.8.patch _________________ #Joseph |
|
| Back to top |
|
 |
bigboote n00b


Joined: 27 May 2003 Posts: 14 Location: Chicago, IL USA
|
Posted: Mon Aug 30, 2004 3:33 pm Post subject: Re: packet writing udftools for kernel 2.6.8 |
|
|
| Joseph_sys wrote: | Anybody knows when an update for udftools is coming out!
The current udftools-1.0.0b is not working with kernel 2.6.8 and packet-2.6.8.patch |
There is a patch of udftools in the main directory of the download site. Don't know if it works yet. I'll give it a try and let everyone know if it works. _________________ rundll32.exe shell32.dll,SHExitWindowsEx 1 |
|
| Back to top |
|
 |
bigboote n00b


Joined: 27 May 2003 Posts: 14 Location: Chicago, IL USA
|
Posted: Wed Sep 01, 2004 6:44 am Post subject: |
|
|
It appears some things have been changed between kernel 2.7.x and 2.8.x. First of all, there is a udftools patch here: (found here) which appears to be intended for kernels such as gentoo-dev-sources-2.6.8-r3. In addition, I've patched my init script listed above to work with kernel 2.6.8:
| Code: | --- cdrw.orig 2004-09-01 01:12:40.854961033 -0500
+++ cdrw 2004-09-01 01:12:14.021641223 -0500
@@ -7,6 +7,16 @@
need localmount
}
+# Starting with kernel 2.6.8 there is a different syntax
+# for the pktsetup program.
+kernel_major=$(( `uname -r | cut -d'-' -f1 | cut -d'.' -f2` ))
+kernel_minor=$(( `uname -r | cut -d'-' -f1 | cut -d'.' -f3` ))
+
+# The pktsetup program doesn't seem to return any error codes.
+# So, we do our error checking by seeing whether the block
+# device has been set up or torn down correctly. This is not
+# terribly elegent. Blech.
+
start() {
local i
local minor=0
@@ -18,10 +28,16 @@
ebegin "Enabling CD-RW packet writing on ${i}"
if [ ! -e "/dev/pktcdvd" ]
then
- modprobe -a pktcdvd
+ /sbin/modprobe -a pktcdvd
+ fi
+ if [ ${kernel_major} -ge 6 ] && [ ${kernel_minor} -ge 8 ]
+ then /usr/bin/pktsetup ${minor} ${i} >/dev/null 2>&1
+ else /usr/bin/pktsetup /dev/pktcdvd/${minor} ${i} >/dev/null 2>&1
+ fi
+ if [ -b /dev/pktcdvd/${minor} ]
+ then last_result=0
+ else last_result=1
fi
- /usr/bin/pktsetup /dev/pktcdvd/${minor} ${i} >/dev/null 2>&1
- last_result=$?
retval=$(( ${retval} + ${last_result} ))
minor=$(( ${minor} + 1 ))
if [ ${last_result} -gt 0 ]
@@ -42,8 +58,14 @@
do
ebegin "Disabling CD-RW packet writing on ${i}"
umount /dev/pktcdvd/${minor} >/dev/null 2>&1 || true
- /usr/bin/pktsetup -d /dev/pktcdvd/${minor} ${i} >/dev/null 2>&1
- last_result=$?
+ if [ ${kernel_major} -ge 6 ] && [ ${kernel_minor} -ge 8 ]
+ then /usr/bin/pktsetup -d ${minor} >/dev/null 2>&1
+ else /usr/bin/pktsetup -d /dev/pktcdvd/${minor} ${i} >/dev/null 2>&1
+ fi
+ if [ -b /dev/pktcdvd/${minor} ]
+ then last_result=1
+ else last_result=0
+ fi
retval=$(( ${retval} + ${last_result} ))
minor=$(( ${minor} + 1 ))
if [ ${last_result} -gt 0 ] |
It's not pretty, but seems to be functional so far. I wouldn't be surprised if some of these changes are provisional and more will be made for the next kernel release. If you want a stable pktcdvd system, then I'd suggust sticking with 2.7.x. Otherwise, this seems to working (so far), and the adventurous can take the plunge. See the link at the top of the page for the kernel patches. Good luck all. _________________ rundll32.exe shell32.dll,SHExitWindowsEx 1 |
|
| Back to top |
|
 |
Gooba42 n00b


Joined: 04 Feb 2004 Posts: 13
|
Posted: Wed Sep 01, 2004 10:51 pm Post subject: |
|
|
| bigboote wrote: | It appears some things have been changed between kernel 2.7.x and 2.8.x. First of all, there is a udftools patch here: (found here) which appears to be intended for kernels such as gentoo-dev-sources-2.6.8-r3. In addition, I've patched my init script listed above to work with kernel 2.6.8:
...
It's not pretty, but seems to be functional so far. I wouldn't be surprised if some of these changes are provisional and more will be made for the next kernel release. If you want a stable pktcdvd system, then I'd suggust sticking with 2.7.x. Otherwise, this seems to working (so far), and the adventurous can take the plunge. See the link at the top of the page for the kernel patches. Good luck all. |
Now I'm just getting the "Inappropriate ioctl for device" message.
Update: I patched the hell out of UDFTools, recompiled, ran it and got the error messages... repeat ad nauseum convinced I'd done something wrong.
After patching pktsetup it installed the patched version to /usr/local/bin/pktsetup and I already had an unpatched version in /usr/bin/pktsetup. I moved the unpatched one out of my path and apparently all is well.
Success...I haven't yet gotten the DVD burning to work but that'll come later. CDRW's are working fun but incredibly slow to format.
Thanks for the help. |
|
| Back to top |
|
 |
bigboote n00b


Joined: 27 May 2003 Posts: 14 Location: Chicago, IL USA
|
Posted: Fri Sep 03, 2004 3:49 pm Post subject: |
|
|
| Gooba42 wrote: | | CDRW's are working fun but incredibly slow to format. |
Such is the nature of the beast. _________________ rundll32.exe shell32.dll,SHExitWindowsEx 1 |
|
| Back to top |
|
 |
Gooba42 n00b


Joined: 04 Feb 2004 Posts: 13
|
Posted: Thu Sep 09, 2004 9:11 pm Post subject: Anyone done a DVD yet? |
|
|
Has anyone successfully used a DVD burner with this method yet?
I got the DVD+RW formatted and was able to access it but all it would do was delete files from an existing disk, not write to it which is not exactly what I had in mind for packet writing.
Thanks for the help thus far. |
|
| Back to top |
|
 |
lunatc Guru


Joined: 18 Apr 2002 Posts: 409 Location: Canary Islands. Spain
|
Posted: Fri Sep 17, 2004 9:20 pm Post subject: |
|
|
For those who have a Mount-Rainier compliant CD-Writer, you may read THIS.
I have a LITE-ON LTR52327S and I've just noticed that it's a MtRainier Drive. I've not tried yet this solution but looks promising!!  |
|
| Back to top |
|
 |
|