[SOLVED] Menghapus local-lvm dan menggunakan seluruh disk untuk root pada Proxmox VE

obiagam

Member
Oct 20, 2020
1
0
6
30
Cek dulu seluruh disk dari Command line :

root@pve:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 63G 0% /dev
tmpfs 13G 1.3M 13G 1% /run
/dev/mapper/pve-root 78G 2.7G 72G 4% /
tmpfs 63G 46M 63G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/fuse 128M 16K 128M 1% /etc/pve
tmpfs 13G 0 13G 0% /run/user/0


root@pve:~# fdisk -l


Disk /dev/sdc: 278.88 GiB, 299439751168 bytes, 584843264 sectors
Disk model: VIRTUAL DISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8F392A46-4FBF-48A9-A334-D77DE6956B81

Device Start End Sectors Size Type
/dev/sdc1 34 2047 2014 1007K BIOS boot
/dev/sdc2 2048 2099199 2097152 1G EFI System
/dev/sdc3 2099200 584843230 582744031 277.9G Linux LVM


Disk /dev/mapper/pve-swap: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/pve-root: 79.47 GiB, 85328920576 bytes, 166658048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes



Cek LVM yang ada, ada 3 yaitu swap, root dan data. Root untuk system/local storage dan Data untuk Local-lvm

root@pve:~# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID VXDrR2-to7p-JAKZ-GIjn-AFK4-BWDa-LXrIJr
LV Write Access read/write
LV Creation host, time proxmox, 2023-05-10 01:32:15 +0800
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID GYLmQu-SSIp-fdKH-gCaj-0m2K-il3W-G3O8CX
LV Write Access read/write
LV Creation host, time proxmox, 2023-05-10 01:32:15 +0800
LV Status available
# open 1
LV Size <79.47 GiB
Current LE 20344
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

--- Logical volume ---
LV Name data
VG Name pve
LV UUID nOjbk5-wfW3-i9NW-efnU-tIH7-eG1r-FojRCg
LV Write Access read/write
LV Creation host, time proxmox, 2023-05-10 01:32:37 +0800
LV Pool metadata data_tmeta
LV Pool data data_tdata
LV Status available
# open 0
LV Size 170.91 GiB
Allocated pool data 0.00%
Allocated metadata 0.94%
Current LE 43754
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4


1. Pertama hapus terlebih dahulu storage local-lvm dari dashboard Proxmox
Klik - Datacenter
Klik - Storage
Klik Pilih local-lvm lalu klik remove

Setelah hapus dari dashboard, hapus lvm data melalui CLI
root@test1:~# lvremove /dev/pve/data
Do you really want to remove active logical volume pve/data? [y/n]: y
Logical volume "data" successfully removed



2. Kemudian, resize root untuk dapat menggunakan seluruh kapasitas disk

root@pve:~# lvresize /dev/pve/root /dev/sda3
Size of logical volume pve/root changed from 24.75 GiB (6336 extents) to 95.75 GiB (24511 extents).
Logical volume pve/root successfully resized.

Selanjutnya cek lvm yang ada, setelah hapus lvm data dan resize root
root@pve:~# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID VXDrR2-to7p-JAKZ-GIjn-AFK4-BWDa-LXrIJr
LV Write Access read/write
LV Creation host, time proxmox, 2023-05-10 01:32:15 +0800
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID GYLmQu-SSIp-fdKH-gCaj-0m2K-il3W-G3O8CX
LV Write Access read/write
LV Creation host, time proxmox, 2023-05-10 01:32:15 +0800
LV Status available
# open 1
LV Size 269.87 GiB
Current LE 69087
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1



LVM root sudah bertambah kapasitasnya, selanjutnya resize storage local

root@pve:~# resize2fs /dev/mapper/pve-root
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/mapper/pve-root is mounted on /; on-line resizing required
old_desc_blocks = 10, new_desc_blocks = 34
The filesystem on /dev/mapper/pve-root is now 70745088 (4k) blocks long.

Cek kapasitas storage local dari CLI dan dashboard

root@pve:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 63G 0% /dev
tmpfs 13G 1.3M 13G 1% /run
/dev/mapper/pve-root 266G 2.7G 251G 2% /
tmpfs 63G 46M 63G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/fuse 128M 16K 128M 1% /etc/pve
tmpfs 13G 0 13G 0% /run/user/0
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!