On Thursday, 19 March 2020 19:08:55 GMT n952162 wrote:
> On 2020-03-19 19:43, Michael wrote:
> > On Thursday, 19 March 2020 18:32:12 GMT n952162 wrote:
> >> On 2020-03-19 19:04, Michael wrote:
> >>> On Thursday, 19 March 2020 17:03:15 GMT Ian Zimmerman wrote:
> >>>> On 2020-03-19 10:59, n952162 wrote:
> >>>>> I changed the UUID of all the partitions of the second drive and now
> >>>>> all my devices are linked to in /dev/disk/by-uuid. I still have
> >>>>> no/dev/disk/by-label, though. Also, my swap file on a mounted drive
> >>>>> wasn't mounted, which was my original problem ;-(
> >>>> 
> >>>> Do they in fact have labels?  Just checking.
> >>>> 
> >>>> Also, you're not not clear if your _partition_ still isn't getting
> >>>> mounted, or just the swap file not getting activated.
> >>>> 
> >>>> For a problem like this, there _has_ to be something in the log.
> >>> 
> >>> We're using the term 'partition' here, but to avoid confusion, we have
> >>> GPT
> >>> partition table UUIDs (PARTUUID) and we have filesystem UUIDs (UUID).
> >>> 
> >>> Similarly, we also have filesystem labels and GPT partition labels.
> >>> 
> >>> Therefore it helps if there is consistency in the IDs being used to
> >>> mount
> >>> partitions.
> >> 
> >> I used   the UUID column of blkid(8) on the fstab entry, with UUID=.  If
> >> that is the partition UUID, where, how, and wherefore are filesystem
> >> UUIDs?
> > 
> > lsblk -o +PARTUUID,UUID
> > 
> > will show both, but blkid also print filesystem UUID and partition table
> > PARTUUID.
> 
> Okay, then I got it backwards: both blkid(8)'s UUID and /etc/fstab's
> UUID are the filesystem UUID.  What is the partition UUID used for?

GPT partition tables also have a 'UUID' for each partition, which is stored in 
the GPT tables. The GUID Partition Table (GPT) is called so because every 
partition on a disk has a “globally unique identifier,” or GUID (aka. 
PARTUUID).  GPT tables use 64-bit sector pointers for each partition, but I 
don't know if the 128-bit code of GUID/PARTUUID contains info on the start 
sector of a GPT partition.

Anyway, you can specify block devices to be mounted in your /etc/fstab using 
various methods.

1. The good ol' file name of a block device: /dev/sdaX

However, if you swap drives around, don't be surprised if your drive has been 
renamed/renumbered.  The /dev/sdaX device file name will now point to a 
different disk/partition.

2. Partition UUID:  PARTUUID=xxxxxxx-xxxxxxx-xxx-xxx

This is permanent and won't change when you swap disks around, unless you 
repartition your disk.  You need a GPT table type for this method.

3. Filesystem UUID: UUID=xxxxxx-xxxxxxx-xxx-xxxxxxxxx

This is permanent and will also not change, unless you reformat your 
filesystem.

4. Filesystem LABEL:  LABEL=MySWAP

This won't change unless you reformat the filesystem, or change its LABEL.

5. Partition PARTLABEL:  PARTLABEL=SWAP1

This won't change unless you repartition the disk, or change its PARTLABEL.

Finally, I don't think you can use the hardware specific ID, found under /dev/
disk/by-id/wwn-xxxxxxxxxxxxxxxxxx-part1, which is a symlink to the /dev/sda1 
name.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to