Rabu, 13 April 2022

Resize Storage VM (Ubuntu 20.04) on Proxmox

Resize terlebih dahulu Storage pada VM di Proxmox
contoh dari 100 GB menjadi 150GB
lalu chek list partisi yang terdapat pada server dengan menjalankan fdisk -l

embyhost@embyhost:~$ sudo fdisk -l
...
GPT PMBR size mismatch (1572863999 != 2621439999) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sda: 1.23 TiB, 1342177280000 bytes, 2621440000 sectors
Disk model: QEMU HARDDISK  
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: 121E8CA3-3A2D-4EF3-B81D-8CE9E47B2965

Device     Start        End    Sectors  Size Type
/dev/sda1   2048       4095       2048    1M BIOS boot
/dev/sda2   4096 1572861951 1572857856  750G Linux filesystem

atau juga dapat menggunakan perintah gparted

embyhost@embyhost:~$ sudo parted /dev/sda
GNU Parted 3.2
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 1048576000
blocks) or continue with the current setting?
Fix/Ignore? F                                                            
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 1342GB
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  805GB   805GB   ext4

jalankan perintah resizepart, jika partisinya adalan sda2 maka tuliskan resizepart 2 100% ( angka 2 menyesuaikan nama partisi )
(parted) resizepart 2 100%                                              
Warning: Partition /dev/sda2 is being used. Are you sure you want to continue?
parted: invalid token: 100%                                              
Yes/No?

(parted) resizepart 2
Warning: Partition /dev/sda2 is being used. Are you sure you want to continue?
Yes/No? y                                                                 
End?  [805GB]? 100%                                                       
(parted) quit                                                             
Information: You may need to update /etc/fstab.

langkah selanjutnya adalah menjalankan perintah resize2fs pada partisi yang akan di resize

embyhost@embyhost:~$ sudo resize2fs /dev/sda2
resize2fs 1.45.3 (14-Jul-2019)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 94, new_desc_blocks = 157
The filesystem on /dev/sda2 is now 327679483 (4k) blocks long.

reboot system dan lakukan pengechekan pada server dengan menggunakan perintah df -h

Selesai

Tidak ada komentar:

Posting Komentar