Adding a PV Second Disk to CentOS 7 on a Scale HC3 with LVM and XFS
-
If you wish to use the parted command, you can learn more about Parted on Tecmint for interactive usages.
-
Some additional resultant LVM info for those that may be interested:
pvs PV VG Fmt Attr PSize PFree /dev/vda2 centos_lab-lnx-centos lvm2 a-- 14.41g 40.00m /dev/vdb vol_data1 lvm2 a-- 186.26g 0 vgs VG #PV #LV #SN Attr VSize VFree centos_lab-lnx-centos 1 2 0 wz--n- 14.41g 40.00m vol_data1 1 1 0 wz--n- 186.26g 0 lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root centos_lab-lnx-centos -wi-ao---- 12.88g swap centos_lab-lnx-centos -wi-ao---- 1.49g lv_data1 vol_data1 -wi-ao---- 186.26g
-
Here is what df looks like...
df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos_lab--lnx--centos-root 13G 1.6G 12G 12% / devtmpfs 2.0G 0 2.0G 0% /dev tmpfs 2.0G 0 2.0G 0% /dev/shm tmpfs 2.0G 8.4M 2.0G 1% /run tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup /dev/vda1 497M 184M 313M 38% /boot tmpfs 396M 0 396M 0% /run/user/0 tmpfs 396M 0 396M 0% /run/user/1101 /dev/mapper/vol_data1-lv_data1 187G 33M 187G 1% /data
-
Not really all that specific to XFS, switching to ext4 or something else would be easy.
-
Yes, just need to alter the mkfs command and the settings in /etc/fstab.
-
Is there a good reason to be using the raw device rather than making partitions on it like you normally would with parted?
-
Very nice.
-
-
@StrongBad said:
Is there a good reason to be using the raw device rather than making partitions on it like you normally would with parted?
It makes things more flexible in case you decide to change the size of the underlying block device. LVM will grow more easily and can do the partioning that you need on top using new LVs instead of needing to create hard partitions.
-
I just used this myself to make a new block device in a single line. Awesome