/dev/ubuntu-vg/root == /dev/mapper/ubuntu--vg-root
Those both point to the same DM device. They use symbolic links. Nothing special about them. They are 100% normal, symlinks, just like any others on the box.
In general, you don't need lvm + lvextend as an option. Just use lvextend as the command.
Be very careful using lvreduce or lvresize. Always have backups before using either.
I'd like to see some facts before saying anything more.
Code:
sudo pvs
sudo vgs
sudo lvs
lsblk -e 7 -o name,size,type,fstype,mountpoint
commands + output, please. All wrapped in code tags.
Might be helpful to see the ftab file contents too. Please.
For swap, I'd like to see swapon -s.
Then if you can clearly say what you'd like changed about each LV, someone can help.
pvdisplay, vgdisplay and lvdisplay are the old-school commands that show way more detail that we need for stuff like this. Let's keep it short and to the point, unless you want specific striping across different PVs.
LVM is the system name. Once we know LVM is involved, we generally don't need anything more that say "lvm" anywhere.
LV is a logical volume.
VG is a volume group.
PV is a physical volume.
There is nothing called an "lvm group." It is important to use the correct terms for the correct objects to prevent confusion in communications. Please.
When I see the other commands you are throwing at the shell, it looks like you aren't using the manpages to get the correct options required for each command. When working with LVM, you'll need to lookup those options. The same applies to swapon and swapoff commands. Incorrect and partial options aren't sufficient.
So ... here's one of my systems fstab files:
Code:
UUID=9CE4-930A /boot/efi vfat utf8,umask=007,gid=46 0 1
/dev/vgubuntu-mate/root / ext4 errors=remount-ro 0 1
/dev/vgubuntu-mate/home /home ext4 errors=remount-ro 0 1
/dev/vgubuntu-mate/swap_1 none swap sw 0 0
See how the LVs are all in /dev/vgubuntu-mate/?
Code:
regulus:/dev/vgubuntu-mate$ ll
total 0
drwxr-xr-x 2 root root 100 Sep 28 15:51 ./
drwxr-xr-x 20 root root 4120 Sep 28 15:51 ../
lrwxrwxrwx 1 root root 7 Sep 28 15:51 home -> ../dm-2
lrwxrwxrwx 1 root root 7 Sep 28 15:51 root -> ../dm-0
lrwxrwxrwx 1 root root 7 Sep 28 15:51 swap_1 -> ../dm-1
They are just symlinks to device-mapper objects in /dev/. I can also see symlinks in the /dev/mapper/ directory:
Code:
regulus:/dev/mapper$ ll
total 0
drwxr-xr-x 2 root root 120 Sep 28 15:51 ./
drwxr-xr-x 20 root root 4120 Sep 28 15:51 ../
crw------- 1 root root 10, 236 Sep 28 15:51 control
lrwxrwxrwx 1 root root 7 Sep 28 15:51 vgubuntu--mate-home -> ../dm-2
lrwxrwxrwx 1 root root 7 Sep 28 15:51 vgubuntu--mate-root -> ../dm-0
lrwxrwxrwx 1 root root 7 Sep 28 15:51 vgubuntu--mate-swap_1 -> ../dm-1
They use slightly different names, but also point to exactly the same dm-? objects. 100% normal symbolic links. When we run swapon/off or lvextend commands, we can use any of these three different file objects. The dm-? files can change from boot to boot, so it is best to use the generated /dev/mapper/ or /dev/{vg-name}/{lv-name} files. I prefer to use the 2nd option, since those make sense to my human brain and convey extra knowledge. But you can use whatever you like.
My fstab was manually edited to use the /dev/{vg-name}/{lv-name} version for my sanity. When we use LVM, we get rebuilt symlinks in those directories when the storage gets scanned during boot. Those symlinks are guaranteed to be correct, just like the symlinks for UUIDs are. UUIDs are handy, if we don't have any other choice. They are just symlinks too, BTW. Look in /dev/disk/by-uuid/ and you'll see the UUID symlinks that point to the device-mapper files.
Hopefully, this can clarify why you see different names used in different arguments for swap and LV commands. They are probably pointing at the same things, but there are multiple different answers possible. That's all. Without a firm understand of symlinks and how they are used under /dev/, it is easy to become confused.
Bookmarks