Gentoo Archives: gentoo-user

From: dhk <dhkuhl1108@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: LVM and the /usr Logical Volume
Date: Mon, 25 Apr 2022 13:37:14
Message-Id: 2971bf39-4ab0-e1fc-4dff-fc2f9291a995@gmail.com
In Reply to: [gentoo-user] Re: LVM and the /usr Logical Volume by dhk
1 Having /dev/dm-1 mounted on /usr would not be an issue if it was
2 supposed to be that way; however, nothing in the handbook or anything
3 else I have read says that is correct.  In addition, every other system
4 I have setup or used always had /usr as the mount point in the fstab.
5
6 My primary questions are:
7   * Why is it different this time?
8   * What changed to make /usr mount the block device?
9   * Why is the /usr record in the fstab being ignored and being handled
10 differently that /var, /opt, /home and /vm ?
11
12 Even though everything seems to be work correctly, without a good and
13 authoritative explanation my confidence level in the stability is not
14 too high and is preventing me from relying on it as primary host.
15
16 My concerns about not having a good explanation for why df -h shows
17 /dev/dm-1 on /usr instead of /dev/mapper/vg0-usr are:
18 * There could be problems interfacing directly with the block device
19 (/dev/dm-1) and not the link (/dev/mapper/vg0-usr).
20 * When it comes time to extend the /usr logical volume and use commands
21 like lvextend, resize2fs, lvresize and some others it may cause problems.
22 * The documentation does not say this is correct, in fact the
23 documentation specifically says the opposite that the fstab is used for
24 the mount points.
25 * It looks like the initramfs is not letting go of the temporary /usr
26 mount and mounting /usr in the vg0-usr volume group correctly.
27
28 After reinstalling Gentoo with a new liveusb, my system still looks
29 similar to the way it was before.  I started with the existing partition
30 schema and wiped everything and performed a separate independent
31 install.  I am still not sure why the /dev/dm-1 block device is mounted
32 on /usr which is not what the fstab is instructing.
33
34 UUIDs are not being used because the handbook says:
35 *Important:*  UUIDs of the filesystem on a LVM volume and its LVM
36 snapshots are identical, therefore using UUIDs to mount LVM volumes
37 should be avoided.
38
39 /etc/fstab:
40 /dev/nvme0n1p6          /boot           ext2
41 defaults,noatime                    0 2
42 /dev/nvme0n1p7          none            swap
43 sw                                  0 0
44 /dev/nvme0n1p8          /               ext4
45 defaults,noatime,discard            0 1
46 /dev/nvme0n1p9          /lib/modules    ext4
47 defaults,noatime,discard            0 1
48 /dev/nvme0n1p10         /tmp            ext4
49 defaults,noatime,discard            0 1
50 /dev/mapper/vg0-usr     /usr            ext4
51 defaults,noatime,discard            0 0
52 /dev/mapper/vg0-home    /home           ext4
53 defaults,noatime,discard            0 1
54 /dev/mapper/vg0-opt     /opt            ext4
55 defaults,noatime,discard            0 1
56 /dev/mapper/vg0-var     /var            ext4
57 defaults,noatime,discard            0 1
58 /dev/mapper/vg1-vm      /vm             ext4
59 noauto,noatime,discard              0 1
60 /dev/cdrom      /mnt/cdrom      auto rw,exec,noauto,user             0 0
61
62 /etc/initramfs.mounts has:
63 /usr
64
65 # ls -l /dev/mapper/vg0-usr
66 lrwxrwxrwx 1 root root 7 Apr 23 05:56 /dev/mapper/vg0-usr -> ../dm-1
67
68 # mount /usr
69 mount: /usr: /dev/mapper/vg0-usr already mounted or mount point busy.
70
71 # df -h /usr
72 Filesystem      Size  Used Avail Use% Mounted on
73 /dev/dm-1        25G  3.2G   20G  14% /usr
74
75 Thank you

Replies

Subject Author
Re: [gentoo-user] Re: LVM and the /usr Logical Volume Wols Lists <antlists@××××××××××××.uk>