Skip to content

Instantly share code, notes, and snippets.

@LaurentDumont
Created September 15, 2024 15:45
Show Gist options
  • Save LaurentDumont/af72ca1d2a6ca372b0b86aac7a2f2b2a to your computer and use it in GitHub Desktop.
Save LaurentDumont/af72ca1d2a6ca372b0b86aac7a2f2b2a to your computer and use it in GitHub Desktop.
# Resize the disk in Vmware potato
# Confirm that the OS sees the new size
root@docker01:~# echo 1 > /sys/class/block/sda/device/rescan
root@docker01:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 64M 1 loop /snap/core20/2318
loop1 7:1 0 91.9M 1 loop /snap/lxd/29619
loop3 7:3 0 91.9M 1 loop /snap/lxd/24061
loop4 7:4 0 64M 1 loop /snap/core20/2264
loop5 7:5 0 38.8M 1 loop /snap/snapd/21465
loop8 7:8 0 55.7M 1 loop /snap/core18/2829
loop9 7:9 0 55.7M 1 loop /snap/core18/2823
loop10 7:10 0 38.8M 1 loop /snap/snapd/21759
sda 8:0 0 3T 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 2T 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 2T 0 lvm /
sr0 11:0 1 1024M 0 rom
root@docker01:~# parted /dev/sda
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 3299GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 1612MB 1074MB ext4
3 1612MB 2199GB 2197GB
(parted) resizepart 3 100%
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 3299GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 1612MB 1074MB ext4
3 1612MB 3299GB 3297GB
root@docker01:~# lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Size of logical volume ubuntu-vg/ubuntu-lv changed from <2.00 TiB (523903 extents) to <3.00 TiB (786047 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
root@docker01:~# resize2fs /dev/ubuntu-vg/ubuntu-lv
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
old_desc_blocks = 256, new_desc_blocks = 384
The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 804912128 (4k) blocks long.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment