Skip to content
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

Feature request: accept dash in middle of --volume-id arg #109

Open
bjornfor opened this issue Jan 8, 2019 · 2 comments
Open

Feature request: accept dash in middle of --volume-id arg #109

bjornfor opened this issue Jan 8, 2019 · 2 comments

Comments

@bjornfor
Copy link
Contributor

bjornfor commented Jan 8, 2019

The mkfs.fat --volume-id argument is currently a 32-bit hex number, but the Linux lsblk and mount commands use a dash in the middle of the (UUID - as they call it) number. The result is some impedance mismatch:

$ mkfs.fat -i 12345678 /dev/sdX1
(success)

$ lsblk -f
NAME     FSTYPE    LABEL    UUID           MOUNTPOINT
sdX1     vfat      BOOT     1234-5678

$ mkfs.fat -i 1234-5678 /dev/sdX1
mkfs.fat 4.1 (2017-01-24)
Volume ID must be a hexadecimal number
...

$ mount -U 12345678 /mnt
mount: /mnt: can't find UUID="12345678"

I would like to be able to copy the UUID/volume-id from lsblk/mount to mkfs.fat, since recreating disks with specific UUIDs is part of my backup restore process.

What do you think?

@bjornfor
Copy link
Contributor Author

It appears that ntfs UUIDs are given without dash (both lsblk and mount emit/accept them). So perhaps the kind of compatibility I'm seeking is better implemented in lsblk/mount (stop using dash in vfat UUID fields). (My first thought was that UUIDs "must" have dash in them, but apparently not.)

@pali
Copy link
Member

pali commented Feb 17, 2019

Windows's vol and dir commands print serial number (volume-id) with dash. Also UUIDs in /etc/fstab are written with dashes.

I'm for unification of usage of FAT volume-ids between Linux tools. So if other mount/blkid/... tools prints ids in one format they should be supported by mkfs.fat/fatlabel. Also if mkfs.fat/fatlabel prints ids in different format then it should be supported by mount/fsck/blkid wrappers too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants