The following is the current status of my disk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 62M 1 loop /snap/core20/1587
loop1 7:1 0 62M 1 loop /snap/core20/1611
loop2 7:2 0 79.9M 1 loop /snap/lxd/22923
loop3 7:3 0 103M 1 loop /snap/lxd/23541
loop4 7:4 0 47M 1 loop /snap/snapd/16292
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 2G 0 part /boot
├─sda3 8:3 0 28G 0 part
│ └─ubuntu--vg-ubuntu--lv 253:0 0 28G 0 lvm /
├─sda4 8:4 0 30G 0 part
└─sda5 8:5 0 1007K 0 part
sr0 11:0 1 1.4G 0 rom
I added sda4 as above, is there any way to increase the root capacity to sda4?
Antonio Petricca
11.3k6 gold badges47 silver badges91 bronze badges
-
There are other forums with mounting a disk at some directory, typically /home.Joop Eggen– Joop Eggen2022年08月24日 06:42:34 +00:00Commented Aug 24, 2022 at 6:42
-
joopEggen/ I want to mount root.Joker– Joker2022年08月29日 00:28:03 +00:00Commented Aug 29, 2022 at 0:28
-
That is possible but look in a linux forum. When you want an other boot disk and such.Joop Eggen– Joop Eggen2022年08月29日 06:32:24 +00:00Commented Aug 29, 2022 at 6:32
1 Answer 1
You can extend the VG and LV by commands:
pvcreate /dev/sda4
vgextend ubuntu--vg /dev/sda4
lvextend -L+4GB /dev/mapper/ubuntu--vg-ubuntu--lv
The last command add 4 GB space to /
and then extend your filesystem. It it's ext4 use command:
resize2fs /
If its XFS you can use command
xfs_growfs -d /
Both resize commands can be done on the fly (w/o unmount the filesystem)
answered Sep 9, 2022 at 6:37
Romeo Ninov
7,3891 gold badge29 silver badges36 bronze badges
Sign up to request clarification or add additional context in comments.