-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recognize multisession UDF optical discs (CD / DVD) #836
Comments
If I mount the device another bug is triggered on the dbus interface. And on unmount this bug continues. |
You can assume that both the As for the multisession, |
Also, could you post |
I'm listening to these signals in a software which needs to know the currently connected storage devices. I can workaround this behavior in my software. But I'm mentioning this, because the behavior differs between UDF-multisession discs and non UDF/multisession discs (everything is fine for these). So I'm considering this to be a bug in udisks and I guess it should better be fixed in udisks (especially the wrongly
As far as I know
Though I guess this might be subsequent faults of the initially described problem. So let's not focus on this signaling problem for the moment.
Sure! (see below) Nevertheless, please feel free to run your own tests with the provided disc images and CDemu. I've reproduced the same results with a real DVD instead of a virtual cdemu disc. Everything done as
used programsAll by openSUSE-15.2, except used program details
UDF non-multisession example (everything's fine)Loading session 1 only, so this isn't multisession. non-multisession dump (working fine)
UDF multisession example (broken)Loading session 1 and 2, so this appears as a multisession disc. Most information by udisksctl is completly wrong (except the size). blkid is wrong in an interesting way, as it shows the information of the first session. udfinfo is correct, as it correctly shows the second sessions label udevadm and lsblk seem OK. But they just doesn't report the information essential to me (the filesystem). multisession dump (broken)
|
Maybe related: systemd/systemd#17780 |
I fixed both ISO and UDF superblock modules in libblkid to read last session from multisession optical disc: But new version of util-linux with these fixes were not released yet. Note that without fixes blkid is not able to read multisession UDF disc. For testing you could try to compile util-linux from master git branch, blkid should properly detects multisession ISO and UDF discs. I have also fixed udfinfo and udflabel in udftools 2.3 to properly handle multisession optical discs. You need to update udftools to version 2.3. |
Either UDF disc is corrupted or this looks like a bug in udfinfo. First Anchor Volume Descriptor Pointer should be available. @md-work: Could you please provide me image of the /dev/sr1? E.g. generated by By the way, udfinfo is very smart and can read Anchor Volume Descriptor Pointer (superblock of UDF) also from backup location, but this does not have to be supported by other UDF implementations (kernel, blkid, ...).
|
I get the same "udfinfo" warning for a real disc without using cdemu.
Are you aware, that "dd" will only read the first session only!? Also "dd" will exit with code 1 at the end of the block device. So gzip will never be executed. If you're still sure that you want In case, I guess it shall be a real disc and not something loaded into cdemu!?
It would be nice if udisk would behave mostly like the Linux kernel. |
That is why I wan to see that image as it can be a bug in udfinfo.
So
This is feature request for udisks, I will let it for udisks developers. |
Here is the requested image (it's the disc I tested udfinfo with in my last comment): But as far as I can see it only contains files from the first session.
Here's the cdrdao image from the same physical disc with full 11 MB of size for comparison: |
Looks like that your cdrom emulation software creates holes in /dev/sr0 between sessions and when trying to read these holes that cdrom emulation software returns -EIO (Input/output error) instead of returning zeros, which makes
You have put sessions into separate files. Such files are unusable for any UDF software as UDF filesystem is addressed by absolute block positions. So I need one continous file like it can be accessible by opening and reading /dev/sr0. Could you provide just one data image file (either by cdrdao or any other software)? I do not need metadata (like ToC). |
I didn't use a cdrom software for that image. It's directly from a physical disc!
cdrdao can't do multiple sessions in one file.
I created another dd image with Nevertheless, Linux always mounts the first session only. Even when specifying
Actually I think you might be on the wrong track! |
Ok! Also cdrom drive is free to return -EIO for some block of data.
:-( hard to use this sw for debugging then.
Thank you! I will look at it and investiagate it.
I do not think so. Session borders are invisible in block device. block device does not see them. If you want to get information on which block is starting which session you need to use out-of-band data. For cd rom driver (/dev/sr0) you need to retrieve it e.g. via CDROMMULTISESSION ioctl. And both kernel and udfinfo is doing it. Kernel's udf driver by default read last session, but it only works when mounting /dev/sr0 (which provides CDROMMULTISESSION ioctl). |
Could you provide also output from |
This image is unusable... it looks like that |
Interesting, although I added files to the disc just once there's a third "virtual!?" session! cdrdao even didn't complain when trying to read a 4th and 5th session. But the resulting *.bin files where identical with the 3rd session. So I guess those 4th and 5th sessions don't really exist.
I'm not sure how to achieve this. Couldn't you further investigate this by loading the cdrdao image I provided into cdemu? If you need a single image, you could use dd or ddrescue on the cdemu drive.
Alternatively please try creating a physical disc for yourself. You can get the cd burning software (CDBurnerXP) setup here: |
I think this is because you have not closed disc yet, so this third session is a place where new session can start. See
I think that simple call
And this is the issue, I do not have any native for a long time. |
image-ddrescue_11MB_2-sessions.udf.gz
Also tried dd_rescue (differs from ddrescue). But the output file was exactly the same.
I confess, I used my girlfriends notebook for that part because I don't have any native Windows too :-D |
Perfect, output from What I have learnt today? Do not use |
Definitely learned that too. Nevertheless, I can't reproduce the exact udisks behavior of the physical disc when using the ddrescue image. Only by using the cdrdao image via cdemu I can reproduce the udisks problem in the same manner as with the physical disc! |
That is expected. Image itself does not contain session information. This is stored only in out-of-band data. But you have provided it in |
And now I see where is the issue. Lets read first session:
No issue, it is correct. And now second:
Message But message First AVDP must be at fixed block start+256. So at block 12266 for second session. Lets look what is stored at this block (via udfdump -S):
So AVDP is at block 12266, but has stored information in its data that is placed on block 256 (instead of 12266). 12266 != 256 meaning that content of block This seems to be a bug of software which generated second session of UDF filesystem. On the other hand on block 17641 is stored backup of AVDP and it is correct (17641 = 17641):
(so udfinfo used it) |
So I'm not surprised now that this udf multisession cd image cannot be detected, it is broken in a way that it is not valid udf image. |
Anyway, seems that correct way to call EDIT: seems that this is still not enough. According to https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html additional |
Yes, it's identical with the ddrescue image.
Bad thing...
I finally found the physical disc I read the For this |
Ok, so we should always call This image has same issue. And also has |
Regarding the multisession UDF, the kernel also needs to be fixed. This is my code submission, and it should not have been released yet:https://lore.kernel.org/lkml/20210114075741.30448-1-changlianzhi@uniontech.com/. Use with code updates related to the util-linux/util-linux#1161 issue.@pali |
I guess that above kernel patch should be backported also to stable kernel releases |
This is beyond my control, I actually think so too |
When sending such bugfix patch, just add |
Thank you very much, I learned another knowledge point |
Please add support to recognize UDF multisession optical discs.
udisks currently doesn't seem to recognize UDF multisession optical discs (CD / DVD).
Tested with openSUSE-15.2 (udisks2-2.8.1) and Debian-11-Testing (Bullseye 2021-01-14 - udisks2-2.9.1)
Instead udisks either recognizes the disc as ISO-9660 (if an ISO-9660 filesystem exists) or simply detects no filesystem at all.
Details
To be precise: It must be detected what filesystem the LAST session of a disc has.
(for example
blkid
from util-linux instead somehow always detects the filesystem of the first session)https://github.com/pali/udftools seems to have a working implementation to detect if the last session has an UDF filesystem. Just run
udfinfo
orudflabel
on a disc.Reproduction
I made some CD images to reproduce the problem.
udisks_udf_multisession_support.zip
Sadly multisession CDs can't simply be stored in an dd/ISO image. Instead I've created some images which can be used via CDemu (Wikipedia).
Each image consists of a *.bin and a *.toc file for each session. Loading a full CD with all sessions works like this:
The text was updated successfully, but these errors were encountered: