pali / udftools

Linux tools for UDF filesystems and DVD/CD-R(W) drives
GNU General Public License v2.0
108 stars 30 forks source link

Support Windows 7 "flashdrive-like" discs #35

Closed danimesq closed 4 years ago

danimesq commented 4 years ago

@pali I've heard udftools doesn't support discs formatted in Windows. Also, how to integrate packet-writing on a existing kernel? A UDF packet-enabled disc made on Linux will work on Windows?

pali commented 4 years ago

Windows 7 "USB-like" discs

What do you mean it? What is USB-like disc?

I've heard udftools doesn't support discs formatted in Windows.

What do you mean by unsupported? Both udfinfo and udflabel worked fined and correctly for all tested disk images produced by Windows which I tested.

Do you have some example of such formatted disk which does not work with udftools, but works on Windows?

Also, how to integrate packet-writing on a existing kernel?

Just call (replace /dev/sr0 by your CD/DVD/BD-R drive):

sudo pktsetup /dev/sr0

And after that you should have /dev/pktcdvd/pktcdvd0 block device. So mount it and use normally like any other block device.

If you have more optical drivers, then instead of pktcdvd0 you would have pktcdvd1 and so on...

After you finish working with /dev/pktcdvd/pktcdvd0 device, turn off packet writing by call:

sudo pktsetup -d pktcdvd0

If you have pktsetup.rules udev rule installed, then pktsetup is called automatically by udev.

A UDF packet-enabled disc made on Linux will work on Windows?

I do not know about any current problems which prevents it usage. To format CD/RW medias, you can use cdrwtool.

danimesq commented 4 years ago

@pali

What do you mean it? What is USB-like disc?

When creating incremental/sequential/packet-writing UDF discs, Windows call them flashdrive-like discs.

What do you mean by unsupported? Both udfinfo and udflabel worked fined and correctly for all tested disk images produced by Windows which I tested.

It both reads and writes to a Windows Explorer UDF disc?

Just call (replace /dev/sr0 by your CD/DVD/BD-R drive): sudo pktsetup /dev/sr0

It produces the following output:

mesquita@plasmmer:~ $ sudo pktsetup /dev/sr0 [sudo] password for mesquita: pktsetup from udftools 1.3 Set up and tear down packet device associations For pktcdvd < 0.2.0: pktsetup /dev/pktcdvd0 /dev/cdrom setup device pktsetup -d /dev/pktcdvd0 tear down device For pktcdvd >= 0.2.0: pktsetup dev_name /dev/cdrom setup device pktsetup -d dev_name tear down device pktsetup -d major:minor tear down device pktsetup -s show device mappings

When I try to mount the device, it shows a error:

$ udisksctl mount -b /dev/pktcdvd/pktcdvd0 Error looking up object for device /dev/pktcdvd/pktcdvd0

And yes, my DVD-RW drive is sr0:

$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 2.8G 0 rom

When I try to mount the disc from explorer:

mount

I do not know about any current problems which prevents it usage. To format CD/RW medias, you can use cdrwtool.

I see lots of forum posts about users not being able to use UDF discs between Linux and Windows, from 2005 to present, and all unsolved.

pali commented 4 years ago

It produces the following output:

mesquita@plasmmer:~ $ sudo pktsetup /dev/sr0 [sudo] password for mesquita: pktsetup from udftools 1.3

You are using older version of udftools.

Set up and tear down packet device associations ... For pktcdvd >= 0.2.0: pktsetup dev_name /dev/cdrom setup device pktsetup -d dev_name tear down device pktsetup -d major:minor tear down device pktsetup -s show device mappings

For older version you need to specify dev_name as help suggests. So call:

sudo pktsetup pktcdvd0 /dev/sr0
danimesq commented 4 years ago

I also noticed (don't remember the cmd used to see it) my kernel (AntiX, a pure version of Debian) doesn't support packet-writing.

pali commented 4 years ago

It both reads and writes to a Windows Explorer UDF disc?

udftools does not profile read/write file operation utility. There is wrudf, but it is not developed and state is questionable.

udflabel can read and write UDF file system label and udfinfo read information about file system.

pali commented 4 years ago

When I try to mount the disc from explorer:

What is that dmesg | tail saing? Also what is output from udfinfo?

pali commented 4 years ago

my kernel doesn't support packet-writing

To verify it, run:

grep CONFIG_CDROM_PKTCDVD /boot/config-`uname -r`

CONFIG_CDROM_PKTCDVD=m or CONFIG_CDROM_PKTCDVD=y means supported # CONFIG_CDROM_PKTCDVD is not set means unsupported

pali commented 4 years ago

I see lots of forum posts about users not being able to use UDF discs between Linux and Windows, from 2005 to present, and all unsolved.

Use last version of mkudffs, there should not be a problem anymore. For more details about these problems, see WHOLE DISK VS PARTITION section in mkudffs(8) manpage.

danimesq commented 4 years ago

$ dmesg | tail

[ 2321.041417] sd 3:0:0:0: [sdc] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB) [ 2321.042683] sd 3:0:0:0: [sdc] Write Protect is off [ 2321.042694] sd 3:0:0:0: [sdc] Mode Sense: 43 00 00 00 [ 2321.043877] sd 3:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 2321.050093] sdc: [ 2321.053993] sd 3:0:0:0: [sdc] Attached SCSI removable disk [ 2321.081444] ifupdown-hotplug ifup --allow=hotplug usb0 [ 6192.743253] ISOFS: Unable to identify CD-ROM format. [ 6524.127439] ISOFS: Unable to identify CD-ROM format. [ 6545.841346] ISOFS: Unable to identify CD-ROM format.

$ udfinfo

bash: udfinfo: command not found

$ grep CONFIG_CDROM_PKTCDVD /boot/config-uname -r

CONFIG_CDROM_PKTCDVD is not set

pali commented 4 years ago

bash: udfinfo: command not found

So you need to install it.

CONFIG_CDROM_PKTCDVD is not set

Ok, so packet writing is really not supported in your kernel version.

[ 6545.841346] ISOFS: Unable to identify CD-ROM format.

Looks like that kernel is trying to mount disk as ISO9660 filesystem, not as UDF. Try to mount manully with forced UDF filesystem via:

sudo mkdir /mnt/udf_disc
sudo mount /path/to/device /mnt/udf_disc -t udf

Also check that you have support for UDF in kernel:

grep CONFIG_UDF_FS /boot/config-`uname -r`
danimesq commented 4 years ago

So you need to install it.

Isn't part of udftools?

$ sudo apt-get install udfinfo Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package udfinfo

Tried wrudf:

$ sudo wrudf lsc wrudf from udftools 1.3 initIO: stat on lsc failed


Ok, so packet writing is really not supported in your kernel version.

How to re-compile and install it?

Looks like that kernel is trying to mount disk as ISO9660 filesystem, not as UDF. Try to mount manully with forced UDF filesystem

Directory created, but mounting gives error:

$ sudo mkdir /mnt/udf_disc $ sudo mount /path/to/device /mnt/udf_disc -t udf mount: special device /path/to/device does not exist

Also check that you have support for UDF in kernel

It seems like it supports UDF:

$ grep CONFIG_UDF_FS /boot/config-uname -r CONFIG_UDF_FS=y

Btw, when creating a disc on Linux, Brasero's "Leave this disc open" doesn't works, creating a read-only disc.

pali commented 4 years ago

Isn't part of udftools?

Yes, but you have older version, only 1.3. You need at least version 2.0.

initIO: stat on lsc failed

wrudf /dev/sr0

How to re-compile and install it?

See INSTALL file.

$ sudo mount /path/to/device /mnt/udf_disc -t udf

You forgot to replace /path/to/device... It is /dev/sr0, right?

danimesq commented 4 years ago

Yes, but you have older version, only 1.3. You need at least version 2.0.

You mean, AntiX repositories haves a outdated version?

You forgot to replace /path/to/device... It is /dev/sr0, right?

Sorry, I didn't took attention :stuck_out_tongue_closed_eyes: It worked:

$ sudo wrudf /dev/sr0 wrudf from udftools 1.3 CDR disc No UDF VRS No AVDP at block 512 on CDR disc mesquita@plasmmer:~ $ sudo mount /dev/sr0 /mnt/udf_disc -t udf mount: /dev/sr0 is write-protected, mounting read-only

I dunno if wrudf influenced on it. But could mount (read-only) from file manager: mount

But:

$ sudo wrudf lsc wrudf from udftools 1.3 initIO: stat on lsc failed

Which seems to be related as AntiX kernel not supporting packet-writing.

See INSTALL file.

It also covers when a kernel doesn't supports packet-writing, for re-compiling and replacing it? Will be the same AntiX kernel, but with packet-writing?

pali commented 4 years ago

You mean, AntiX repositories haves a outdated version?

Yes, last version is 2.1

I dunno if wrudf influenced on it.

No.

$ sudo wrudf /dev/sr0 wrudf from udftools 1.3 CDR disc No UDF VRS No AVDP at block 512 on CDR disc

Quality of wrudf is really bad, it was not able to detect disc as UDF.

See INSTALL file.

It also covers when a kernel doesn't supports packet-writing, for re-compiling and replacing it? Will be the same AntiX kernel, but with packet-writing?

This is for udftools.

For kernel packet writing you need to install (or recompile) kernel for your distribution. I cannot help with AntiX as I do not know it nor use it...

danimesq commented 4 years ago

@pali

Quality of wrudf is really bad, it was not able to detect disc as UDF.

Could it be updated to detect this kind of disc? It were formatted on Windows 7.

Also, is it possible to automatically mount UDF discs without the need of CLI setup for every disc? Plus a option in file explorer for closing disc session.

danimesq commented 4 years ago

Does wrudf support RW discs? UDF windows insp

pali commented 4 years ago

Quality of wrudf is really bad, it was not able to detect disc as UDF.

Could it be updated to detect this kind of disc? It were formatted on Windows 7.

Everything is possible. I do not have time for it. But patches are of course welcome.

Also, is it possible to automatically mount UDF discs without the need of CLI setup for every disc? Plus a option in file explorer for closing disc session.

This is out of scope of udftools project, it has nothing with GUI applications. So ask these questions in project which provide those your favourite GUI tools.

pali commented 4 years ago

Closing this issue, all questions should be already answered.