Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: swaps mounted randomly [not out of the woods yet]
Date: Fri, 20 Mar 2020 00:30:15
Message-Id: 14028188.tv2OnDr8pf@lenovo.localdomain
In Reply to: Re: [gentoo-user] Re: swaps mounted randomly [not out of the woods yet] by n952162
1 On Thursday, 19 March 2020 19:08:55 GMT n952162 wrote:
2 > On 2020-03-19 19:43, Michael wrote:
3 > > On Thursday, 19 March 2020 18:32:12 GMT n952162 wrote:
4 > >> On 2020-03-19 19:04, Michael wrote:
5 > >>> On Thursday, 19 March 2020 17:03:15 GMT Ian Zimmerman wrote:
6 > >>>> On 2020-03-19 10:59, n952162 wrote:
7 > >>>>> I changed the UUID of all the partitions of the second drive and now
8 > >>>>> all my devices are linked to in /dev/disk/by-uuid. I still have
9 > >>>>> no/dev/disk/by-label, though. Also, my swap file on a mounted drive
10 > >>>>> wasn't mounted, which was my original problem ;-(
11 > >>>>
12 > >>>> Do they in fact have labels? Just checking.
13 > >>>>
14 > >>>> Also, you're not not clear if your _partition_ still isn't getting
15 > >>>> mounted, or just the swap file not getting activated.
16 > >>>>
17 > >>>> For a problem like this, there _has_ to be something in the log.
18 > >>>
19 > >>> We're using the term 'partition' here, but to avoid confusion, we have
20 > >>> GPT
21 > >>> partition table UUIDs (PARTUUID) and we have filesystem UUIDs (UUID).
22 > >>>
23 > >>> Similarly, we also have filesystem labels and GPT partition labels.
24 > >>>
25 > >>> Therefore it helps if there is consistency in the IDs being used to
26 > >>> mount
27 > >>> partitions.
28 > >>
29 > >> I used the UUID column of blkid(8) on the fstab entry, with UUID=. If
30 > >> that is the partition UUID, where, how, and wherefore are filesystem
31 > >> UUIDs?
32 > >
33 > > lsblk -o +PARTUUID,UUID
34 > >
35 > > will show both, but blkid also print filesystem UUID and partition table
36 > > PARTUUID.
37 >
38 > Okay, then I got it backwards: both blkid(8)'s UUID and /etc/fstab's
39 > UUID are the filesystem UUID. What is the partition UUID used for?
40
41 GPT partition tables also have a 'UUID' for each partition, which is stored in
42 the GPT tables. The GUID Partition Table (GPT) is called so because every
43 partition on a disk has a “globally unique identifier,” or GUID (aka.
44 PARTUUID). GPT tables use 64-bit sector pointers for each partition, but I
45 don't know if the 128-bit code of GUID/PARTUUID contains info on the start
46 sector of a GPT partition.
47
48 Anyway, you can specify block devices to be mounted in your /etc/fstab using
49 various methods.
50
51 1. The good ol' file name of a block device: /dev/sdaX
52
53 However, if you swap drives around, don't be surprised if your drive has been
54 renamed/renumbered. The /dev/sdaX device file name will now point to a
55 different disk/partition.
56
57 2. Partition UUID: PARTUUID=xxxxxxx-xxxxxxx-xxx-xxx
58
59 This is permanent and won't change when you swap disks around, unless you
60 repartition your disk. You need a GPT table type for this method.
61
62 3. Filesystem UUID: UUID=xxxxxx-xxxxxxx-xxx-xxxxxxxxx
63
64 This is permanent and will also not change, unless you reformat your
65 filesystem.
66
67 4. Filesystem LABEL: LABEL=MySWAP
68
69 This won't change unless you reformat the filesystem, or change its LABEL.
70
71 5. Partition PARTLABEL: PARTLABEL=SWAP1
72
73 This won't change unless you repartition the disk, or change its PARTLABEL.
74
75 Finally, I don't think you can use the hardware specific ID, found under /dev/
76 disk/by-id/wwn-xxxxxxxxxxxxxxxxxx-part1, which is a symlink to the /dev/sda1
77 name.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-user] Re: swaps mounted randomly [not out of the woods yet] Ian Zimmerman <itz@××××××××××××.org>