3

In my search for the ideal filesystem to share files between a lot of computer with a lot of different OS'es I accepted this answer and installed a UDF filesystem on my USB stick.

First I blanked the disk, to make sure there are no leftovers to confuse a system that's reading the drive:

dd if=/dev/zero of=/dev/sdb bs=1M

Then I formatted the drive, using udftools from arch linux's AUR:

sudo mkudffs --media-type=hd --blocksize=512 /dev/sdb

Obviously, the drive was in /dev/sdb.

Now my question is, since the drive doesn't have any traditional partitions or even a partition table as far as I know, it does not have a UUID. Therefore, I can not add it to the fstab, which I find rather annoying.

What can I do to fix this (e.g. is there an alternative way to set default mount point and options, or an alternate partitioning option)?

romeovs
  • 1,660
  • 5
  • 21
  • 33

6 Answers6

3

Choose a blocksize of at least 2K (which is the default) and add --vid= to your mkudffs parameters. (The blkid from util-linux doesn't seem to cope with smaller blocksizes.)

$ mkudffs --media-type=hd --vid=my-drive /dev/sdj
$ blkid /dev/sdj
/dev/sdj: LABEL="my-drive" TYPE="udf"

Now you can use LABEL=my-drive in /etc/fstab.

ephemient
  • 15,640
  • 5
  • 49
  • 39
  • although the other answers were correct too, this one gave me the most hands on approach, so I chose it. – romeovs Apr 08 '12 at 10:41
  • 1
    For those who, like me, don't know how to mount a drive by label, see [here](http://www.cyberciti.biz/faq/rhel-centos-debian-fedora-mount-partition-label/). – RolfBly May 29 '15 at 20:08
3

If you need blocksize=512 for Windows compatibility, there is a fix to util-linux that updates blkid to recognize vid as label on any block size. It has not gotten into a released version yet; it was committed on March 1, 2013. There is also a bug in the udf kernel module that prevents it from using a partition larger than 128G - the fix for that was committed to mainline in early February and has just been committed to the 3.0-stable, 3.4-stable, and 3.8-stable branches.

don_crissti
  • 79,330
  • 30
  • 216
  • 245
Jim Trigg
  • 31
  • 4
2

Make sure that you use --blocksize=512 (unless you have native 4k disk). UDF blocksize must matches logical (sector) size of the disk which is 512 bytes. Older mkudfffs versions are unable to detect logical sector size and fallback to value CD/DVD value 2048 (which cause problems for other OS as they do not expect CD/DVD blocksize on hard disks).

blkid from the util-linux v2.30 provides UUID also for UDF filesystems, so just upgrade util-linux to new version and then you can use UUID in /etc/fstab. UUID is calculated from the UDF Volume Set Identifier which has by UDF definition, first 16 characters unique, non-trivial, non-fixed and suitable to guarantee unique identifier.

Also mkudffs since version 1.1 has option --uuid= for specifying own UUID.

Pali
  • 131
  • 1
  • 3
0

Alternatively, you can put on an FS label, and then mount using the LABEL= option. This definitely works, but it doesn't meet your UUID criteria.

Jodie C
  • 1,869
  • 12
  • 13
0

Does your distribution have /dev/disk/by-* symlinks?

Among them, you could probably find a way to identify the USB-stick-with-UDF in a way that won't vary like /dev/sd* could.

telcoM
  • 87,318
  • 3
  • 112
  • 232
-1

Well, UUID is not a parition-only attribute, actually.

man mkudffs mentions:

  • --lvid=logical-volume-ident — Specify the logical volume identifier.
  • --vid=volume-ident — Specify the volume identifier.
  • --vsid=volume-set-ident — Specify the volume set identifier.

Have you tried using any of it?

poige
  • 6,195
  • 2
  • 30
  • 57