dmesg | grep "] Attached SCSI disk" atau
dmesg | grep "[h,s]d[a,b]" | grep " logical blocks: "
sda sudah digunakan oleh proxmox yang ingin kita tambahkan sdb
Mempersiapkan HD Baru
fdisk /dev/sdb
command (m for help): p (menampilkan partisi yang sudah ada)
command (m for help): n (kemudian pilih p=primary)
ikuti semua defaultcommand(m for help): L (pilih 8e=Linux LVM)
command(m for help): w (menyimpan)
Cek Status Disk yang sudah ditambahkan
cat /etc/mtab
cat /etc/fstab
mount
df -k
pvdisplay
vgdisplay
lvdisplay
Create the Physical Extents pvcreate /dev/sdb1 setelah itu cek kembali pvdisplay
Extend the Volume Group vgextend "pve" /dev/sdb1 setelah itu cek lagi vgdisplay
Resize the Logical Volume
1. Cek Aktual Free size
lvdisplay /dev/mapper/pve-data
pvdisplay /dev/sdb1
Free PE = 59618 + Current LE 39523 = 99141
Resize PE: lvresize -l 99141 /dev/mapper/pve-data
nah sekarang Curren LE sudah bertambah jadi 99141 dan LV Size sudah jadi 387.27 GB
Selanjutnya Update File System Proxmox:
Tampilkan File System sekarang: df -k
Update File System
resize2fs /dev/mapper/pve-data
Tampilkan File System sekarang: df -k
Sekarang /dev/mapper/pve-data sudah jadi 382 GB dari 159 GB
Generic Notes on lvresize
- lvresize command can be used to resize the Logical Volumes
- lvresize command can be used to increase (expand) or decrease (shrink) the size of the filesystem.
- Always it is better to unmount the file system before resizeing.
- Decreasing (shrinking) the logical volume size without unmounting is not supported.
- Filesystems can be expanded online, without unmounting them:
- LVM and ext3 support resizing filesystems after they’ve been created:
lvresize -L+10G /dev/sys/scratch resize2fs /dev/sys/scratch
- When shrinking a filesystem, it’s safest to copy its data elsewhere before unmounting and recreating it:
rsync -avr /scratch /data/. umount /scratch lvresize -L-10G /dev/sys/scratch mkfs.ext3 /dev/sys/scratch
Tidak ada komentar:
Posting Komentar