Adding a new disk to Proxmox VE

root@elizabeth:/etc/lvm# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): g

Created a new GPT disklabel (GUID: DBD738EC-7ED5-4FC0-9474-1018CF3E4F12).

Command (m for help): n
Partition number (1-128, default 1):
First sector (34-500118158, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-500118158, default 500118158):

Created a new partition 1 of type 'Linux filesystem' and of size 238.5 GiB.

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Type of partition 1 is unchanged: Linux filesystem.

Command (m for help): p
Disk /dev/sdb: 238.5 GiB, 256060514304 bytes, 500118192 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: DBD738EC-7ED5-4FC0-9474-1018CF3E4F12

Device Start End Sectors Size Type
/dev/sdb1 2048 500118158 500116111 238.5G Linux filesystem

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@elizabeth:/etc/lvm# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
root@elizabeth:/etc/lvm# vgcreate ssd2 /dev/sdb1
Volume group "ssd2" successfully created
root@elizabeth:/etc/lvm# lvcreate --type thin-pool -L 100G -n data ssd2
Logical volume "data" created.
root@elizabeth:/etc/lvm# lvextend -l +100%FREE ssd2/data
Size of logical volume ssd2/data changed from 100.00 GiB (25600 extents) to 238.47 GiB (61049 extents).
Logical volume ssd2/data successfully resized.

Then it is possible to add the newly created LVM-Thin volume from the Web interface.

Leave a Reply

Your email address will not be published. Required fields are marked *