-2

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
asked Aug 24, 2022 at 6:31
3
  • There are other forums with mounting a disk at some directory, typically /home. Commented Aug 24, 2022 at 6:42
  • joopEggen/ I want to mount root. Commented Aug 29, 2022 at 0:28
  • That is possible but look in a linux forum. When you want an other boot disk and such. Commented Aug 29, 2022 at 6:32

1 Answer 1

0

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.