I'm trying to setup my external harddrive to mount automatically on startup, following Akshit's terminal guide.
I initially used the PARTUUID in `/etc/fastab' instead of the UUID:
UUID=191486e0-6049-46aa-973c-425d317b629a /mnt/nas exfat uid=1000,gid=1000,umask=0022,auto,rw 0 0
This gave me an error when I ran findmnt --verify --verbose
at which point I rechecked blkid
and noticed that I'd been using the partition ID:
/dev/sdb1: LABEL="My Book" UUID="20C9-C659" TYPE="exfat" PTTYPE="atari" PARTLABEL="My Book" PARTUUID="191486e0-6049-46aa-973c-425d317b629a"
So I've added the actual UUID in fstab, but now I'm not sure if I should be using that or if I should be using the PARTUUID, and why my UUID is so much shorter than other examples that I've seen (especially when a "UUID is guaranteed to be unique. As far as I know, collisions will not happen within the lifetime of the universe").
If you use the PARTUID, you need to indicate that in
fstab
by starting the line withPARTUUID=
rather thanUUID
. In the example you give, the system looks for an UUID, not a PARTUID, and indeed did not find a maching one.Replace
UUID=
byPARTUUID=
and you should be good to go.Both
UUID
andPARTUUID
are intended to be unique identifiers, one related to the file system, so changing when you reformat the partition, the other to the partition, so associated with the partition itself (won't change when you reformat). Is it better to use the one over the other? It does not matter too much. When you mount a drive yourself infstab
, you need to be well aware what you mount, and at that level it does not matter much whether you use one or another unique identifier.It has been already mentioned in the other answer. you have to use
PARTUUID=
.More info: How do I use a PARTUUID in fstab?
In your case it doesn't really matter. But remember, if you are using MBR, Unlike a regular PARTUUID of a GPT partition, MBR's pseudo PARTUUID can change if the partition number changes. [1]
As a personal preference I rather to use use UUID. Even when I'm creating an encrypted swap partition. Also there is no PARTUUID for things like lvm. As you might know fstab stands for File System Table. So I guess it's better to use UUID as it's related to the file system. Use UUID and no surprises unless you have to use other methods for specific reasons.
I also found a nice answer at ArchLinux's forum that worth reading: PARTUUID instead UUID in fstab, Pros / Cons ?. Here are some quotes from the answer: