Skip to content

Instantly share code, notes, and snippets.

@mariotpc
Created February 5, 2024 19:58
Show Gist options
  • Save mariotpc/9dd6029b2a6dc1529f056dd7198fc4ea to your computer and use it in GitHub Desktop.
Save mariotpc/9dd6029b2a6dc1529f056dd7198fc4ea to your computer and use it in GitHub Desktop.
proxmox extend disk
root@workstation:~# parted
GNU Parted 3.6
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) quit
root@workstation:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
??sda1 8:1 0 1M 0 part
??sda2 8:2 0 1G 0 part /boot
??sda3 8:3 0 31G 0 part
??fedora--lvm-root 253:0 0 31G 0 lvm /
sr0 11:0 1 1024M 0 rom
zram0 252:0 0 5.8G 0 disk [SWAP]
root@workstation:~# parted
GNU Parted 3.6
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 37748736 blocks) or
continue with the current setting?
Fix/Ignore? Fix
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 1076MB 1074MB ext4
3 1076MB 34.4GB 33.3GB lvm
(parted) resizepart 3 100%
(parted) print
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 1076MB 1074MB ext4
3 1076MB 53.7GB 52.6GB lvm
(parted) quit
Information: You may need to update /etc/fstab.
root@workstation:~# pvre
pvremove pvresize
root@workstation:~# pvresize /dev/sda3
Physical volume "/dev/sda3" changed
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
root@workstation:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
??sda1 8:1 0 1M 0 part
??sda2 8:2 0 1G 0 part /boot
??sda3 8:3 0 49G 0 part
??fedora--lvm-root 253:0 0 31G 0 lvm /
sr0 11:0 1 1024M 0 rom
zram0 252:0 0 5.8G 0 disk [SWAP]
root@workstation:~# lvre
lvreduce lvremove lvrename lvresize
root@workstation:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root fedora-lvm -wi-ao---- <31.00g
root@workstation:~# lvdisplay
--- Logical volume ---
LV Path /dev/fedora-lvm/root
LV Name root
VG Name fedora-lvm
LV UUID cflRyN-0cS6-Z3K3-aU3V-tmrM-noTB-CswEDb
LV Write Access read/write
LV Creation host, time localhost-live, 2023-01-30 15:19:17 -0600
LV Status available
# open 1
LV Size <31.00 GiB
Current LE 7935
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
root@workstation:~# lvre
lvreduce lvremove lvrename lvresize
root@workstation:~# lvextend -r -l +100%FREE /dev/fedora-lvm/root
Size of logical volume fedora-lvm/root changed from <31.00 GiB (7935 extents) to <49.00 GiB (12543 extents).
File system ext4 found on fedora-lvm/root mounted at /.
Extending file system ext4 to <49.00 GiB (52609155072 bytes) on fedora-lvm/root...
resize2fs /dev/fedora-lvm/root
resize2fs 1.47.0 (5-Feb-2023)
Filesystem at /dev/fedora-lvm/root is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 7
The filesystem on /dev/fedora-lvm/root is now 12844032 (4k) blocks long.
resize2fs done
Extended file system ext4 on fedora-lvm/root.
Logical volume fedora-lvm/root successfully resized.
root@workstation:~# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/fedora--lvm-root ext4 52G 13G 37G 25% /
devtmpfs devtmpfs 4.2M 0 4.2M 0% /dev
tmpfs tmpfs 3.2G 308k 3.2G 1% /dev/shm
tmpfs tmpfs 1.3G 1.6M 1.3G 1% /run
tmpfs tmpfs 3.2G 87k 3.2G 1% /tmp
/dev/sda2 ext4 1.1G 324M 628M 34% /boot
tmpfs tmpfs 621M 140k 621M 1% /run/user/1000
tmpfs tmpfs 621M 107k 621M 1% /run/user/0
root@workstation:~# baobab
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
failed to load driver: zink
(baobab:1103620): Adwaita-WARNING **: 13:24:16.953: AdwNavigationPage 0x56071884fb40 is missing a title. To hide a header bar title, consider using AdwHeaderBar:show-title instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment