On Thu, May 10, 2007 at 12:06:27PM +0200, Matthias Koenig wrote: > There *are* of course issues with volume_id, which needs to be discussed: > 1. udev creates label symlinks by default in /dev/disk/by-label/ > However the name of these links are not the label itself, but a safe label, > which is derived by the rules: > - '/' are skipped > - multiple spaces are converted to a underscore '_' > This will lead to problems when we have two volumes with label, e.g. say: > foobar and > foo/bar > I think this is a point where blkid is smarter in detecting the ambiguity. > > 2. Device-by-label lookup is done by following the symlink in > /dev/disk/by-label > You will have to know the safe label, not the real label. > When we want to do a label-by-device lookup, volume_id only provides > the label (not the safe label). AFAIK volume_id does not export the > way it derives the safe label. But this is important when we want to compare Well, you can export the replace_untrusted_chars() function, but this is not solution, because replace_untrusted_chars("fooXbar") == replace_untrusted_chars("foo_bar) if the 'X' is a unsafe character. The concept is wrong, because you can't convert a "safe label" back to the "raw label". The correct solution is escape (hex, oct, ...) unsafe chars rather than remove it. So... /dev/disk/by-raw-label. Kay? > two labels, where the first has been given (by the user) and the second > has been acquired by the label-by-device lookup. > This is also a problem in the patch I have sent. 3. the symlinks in /dev/disk/by-{label,uuid} depends on udev rules. For example /dev/loop*, /dev/dm-* and /dev/md* paths are ignored by udev. It means you cannot mount a loop device by LABEL, ..etc. I have talked with Kay about these things and there is also blkid disadvantages. Kay's list: -performance problems with huge number of block devices (tested by SGI with 20000 or 80000 devices :-) -doesn't detect all md signatures and returns the filesystem of a raid-member, which is kind of dangerous -doesn't detect the weird bios-raids, and returns the filesystem of the raid-members -fat is still not correct (as far as fat can be correct :)) -doesn't handle LUKS crypto -misses hfs support (needed for iPod :)) -doesn't handle udf volume descriptors correctly -doesn't read iso extended volume-tags correctly -doesn't support ntfs id's -doesn't support ufs correctly ... I think add new filesystems to blkid is trivial. Karel -- Karel Zak <kzak@xxxxxxxxxx> - To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html