Hi…
Kali ini saya akan mencoba untuk menghapus local-lvm yang ada pada proxmox dan menggunakan seluruh disk untuk root.
Hal ini bermula dari request dari teman, karena local-lvm pada proxmox tidak bisa digunakan untuk menyimpan iso, backup dan template. Hanya bisa menyimpan disk dari VM atau container.
Setiap kali install proxmox, secara default maka storage akan dibuat menjadi 2, yaitu local dan local-lvm
Langsung saja ya…
Cek dulu seluruh disk dari Command line
[email protected]:~# df -h Filesystem Size Used Avail Use% Mounted on udev 2.0G 0 2.0G 0% /dev tmpfs 395M 5.6M 389M 2% /run /dev/mapper/pve-root 25G 1.4G 22G 6% / tmpfs 2.0G 43M 1.9G 3% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup /dev/fuse 30M 16K 30M 1% /etc/pve tmpfs 395M 0 395M 0% /run/user/0 [email protected]:~# fdisk -l Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 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 Disklabel type: gpt Disk identifier: 77106504-0400-4CFA-9B8E-39FED25E3BDF Device Start End Sectors Size Type /dev/sda1 2048 4095 2048 1M BIOS boot /dev/sda2 4096 528383 524288 256M EFI System /dev/sda3 528384 209715166 209186783 99.8G Linux LVM Disk /dev/mapper/pve-swap: 4 GiB, 4294967296 bytes, 8388608 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: 24.8 GiB, 26575110144 bytes, 51904512 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
[email protected]:~# lvdisplay --- Logical volume --- LV Path /dev/pve/swap LV Name swap VG Name pve LV UUID XF0s3T-bAx6-19Jo-mCXD-uMDy-mtJU-5vYewD LV Write Access read/write LV Creation host, time proxmox, 2018-12-28 14:04:27 +0700 LV Status available # open 2 LV Size 4.00 GiB Current LE 1024 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 gNxUs3-gd9K-DLSS-bgAh-ng0K-ZHtX-zjXxTz LV Write Access read/write LV Creation host, time proxmox, 2018-12-28 14:04:27 +0700 LV Status available # open 1 LV Size 24.75 GiB Current LE 6336 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 bjS0kv-Jtw0-8RjY-yJ5K-27Zh-WzjC-9gkaZd LV Write Access read/write LV Creation host, time proxmox, 2018-12-28 14:04:27 +0700 LV Pool metadata data_tmeta LV Pool data data_tdata LV Status available # open 0 LV Size 56.62 GiB Allocated pool data 0.00% Allocated metadata 0.03% Current LE 14495 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:4
Pertama hapus storage local-lvm dari dashboard Proxmox
Setelah hapus dari dashboard, hapus lvm data melalui CLI
[email protected]:~# lvremove /dev/pve/data Do you really want to remove and DISCARD active logical volume pve/data? [y/n]: y Logical volume "data" successfully removed
Kemudian, resize lvm root untuk dapat menggunakan seluruh kapasitas disk
[email protected]:~# 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
[email protected]:~# lvdisplay --- Logical volume --- LV Path /dev/pve/swap LV Name swap VG Name pve LV UUID XF0s3T-bAx6-19Jo-mCXD-uMDy-mtJU-5vYewD LV Write Access read/write LV Creation host, time proxmox, 2018-12-28 14:04:27 +0700 LV Status available # open 2 LV Size 4.00 GiB Current LE 1024 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 gNxUs3-gd9K-DLSS-bgAh-ng0K-ZHtX-zjXxTz LV Write Access read/write LV Creation host, time proxmox, 2018-12-28 14:04:27 +0700 LV Status available # open 1 LV Size 95.75 GiB Current LE 24511 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
[email protected]:~# resize2fs /dev/mapper/pve-root resize2fs 1.43.4 (31-Jan-2017) Filesystem at /dev/mapper/pve-root is mounted on /; on-line resizing required old_desc_blocks = 4, new_desc_blocks = 12 The filesystem on /dev/mapper/pve-root is now 25099264 (4k) blocks long.
Cek kapasitas storage local dari CLI dan dashboard
[email protected]:~# df -h Filesystem Size Used Avail Use% Mounted on udev 2.0G 0 2.0G 0% /dev tmpfs 395M 5.6M 389M 2% /run /dev/mapper/pve-root 95G 1.4G 89G 2% / tmpfs 2.0G 43M 1.9G 3% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup /dev/fuse 30M 16K 30M 1% /etc/pve tmpfs 395M 0 395M 0% /run/user/0
bang punya saya nggak bisa upload iso debian bang, knapa ya di situ ada tulisan eror di describtion
bisa coba kirim screenshotnya
local saat ini 100GB, local-lvm 900GB. misal mau resize : local menjadi 500GB ambil space dari lvm-local. jadi space lvm-local menjadi 500GB. Mungkin bisa dibantu perintahnya? udh googling masih belum nemu. Thnks
destroy dulu lvm-local, kemudian bagi disk (misal sdb) menjadi 2 bagian, masing2 500GB. Setelah itu create ulang lvm-local dgn menggunakan salah satu disk. Dan bagian disk lain di”ikut”kan ke local (vgextend dan lvresize).
Solved Pak, trims sarannya. sayangnya harus destroy(delete) dulu lvm-local jadi susah nyelametin vm yang sudah ada di lvm-local. backup transfer dengan file zilla/winscp tdk ketulungan lambatnya.
sdh coba copy dari external HDD ke local atau sebaliknya:
#mkdir /myfile/temp
#mount /dev/sdb1 /myfile/temp/
#scp spv.vhdx /var/lib/vz/image
atau ada cara lain copy yang cepat dari external HDD ke lokasi ini misalnya : /var/lib/vz/image , sedangkan file yang mau dicopy mendekati 1 TB, Klu di windows bisa 2 jam selesai.
Bisa pakai command rsync -avHPSAX directory_asal directory_tujuan atau pakai command cp -R directory_asal directory_tujuan juga harusnya cepat,, memang harus sabar menunggu klo 1 TB, hehehe
pak izn bertanya, setelah saya melakukan ini.
kenapa ketika saya mau instal OS, (creat VM), di step Hard Disk, kolom storage kosong. apakah ada yg harus di setting lagi? terimakasih
coba dicek contentnya, apakah untuk disk image sudah dipilih? sebelumnya content disk image ada di local-lvm