M
M
MrDZ2022-01-06 22:40:12
linux
MrDZ, 2022-01-06 22:40:12

Increasing partition size (ubuntu 20.04)?

Greetings.
There is a ubuntu 20.04 virtual machine. Set 40 GB hard drive. When installing, I used 20 GB (then I pressed further))))
The place ended, the section expanded according to the instructions
But I did not understand how the system did it .. where 20 GB were indicated that were not used.

it was like this:

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  42.9GB  41.9GB

df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               1.9G     0  1.9G   0% /dev
tmpfs                              394M  1.4M  392M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   20G   19G   98M 100% /
tmpfs                              2.0G     0  2.0G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda2                          976M  301M  608M  34% /boot
/dev/loop0                          56M   56M     0 100% /snap/core18/2246
/dev/loop2                          43M   43M     0 100% /snap/snapd/14066
/dev/loop1                          56M   56M     0 100% /snap/core18/2253
/dev/loop4                          62M   62M     0 100% /snap/core20/1270
/dev/loop3                          62M   62M     0 100% /snap/core20/1242
/dev/loop6                          44M   44M     0 100% /snap/snapd/14295
/dev/loop7                          68M   68M     0 100% /snap/lxd/21835
/dev/loop5                          68M   68M     0 100% /snap/lxd/21803
tmpfs                              394M     0  394M   0% /run/user/1000


became like this:

sudo df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               1.9G     0  1.9G   0% /dev
tmpfs                              394M  1.4M  392M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   39G   19G   19G  51% /
tmpfs                              2.0G     0  2.0G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda2                          976M  301M  608M  34% /boot
/dev/loop0                          56M   56M     0 100% /snap/core18/2246
/dev/loop2                          43M   43M     0 100% /snap/snapd/14066
/dev/loop1                          56M   56M     0 100% /snap/core18/2253
/dev/loop4                          62M   62M     0 100% /snap/core20/1270
/dev/loop3                          62M   62M     0 100% /snap/core20/1242
/dev/loop6                          44M   44M     0 100% /snap/snapd/14295
/dev/loop7                          68M   68M     0 100% /snap/lxd/21835
/dev/loop5                          68M   68M     0 100% /snap/lxd/21803


Where they came from I don’t understand, help, pzhl, figure it out.
There are snapshots, I can roll back to start the wasps before the increase.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Another One DevOps, 2022-01-06
@MrDZ

I think lsblk will shed some light on this mystery.
Depending on what instructions I did, when expanding lvg, it is possible to add all sectors that are not occupied by partitions

M
MrDZ, 2022-01-06
@MrDZ

Another One DevOps link did not insert (
it was like this:
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 39G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 20G 0 lvm
i.e. out of 39 GB, 20 GB are allocated - understood correctly?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question