I have been tasked with configuring newly attached disks with a specific configuration. I am given a 500G physical disk at /dev/abc
. The disk is not formatted and has no paritions. The following is an example of the desired configuration, with the desired partition, volume group (VG), and logical volumes (LVMs). The LVMs also need to be ready to mount using /etc/fstab
, so I believe they need to be formatted using either makefs
or a similar command.
What is the series of commands to create the desired configuration, which should be executed on a Cent OS 7.9 server?
Desired Configuration
root@server1# pvs
PV VG Fmt Attr PSize PFree
/dev/abc1 testvg lvm2 a-- <500.00g 55.00g
root@server1# vgs
VG #PV #LV #SN Attr VSize VFree
testvg 1 4 0 wz--n- <500.00g 55.00g
root@server1# lsblk -f --output NAME,KNAME,FSTYPE,MOUNTPOINT,LABEL,UUID,PARTLABEL,PARTUUID,SIZE,ALIGNMENT,MIN-IO,OPT-IO,TYPE,WWN,TRAN,VENDOR /dev/abc
NAME KNAME FSTYPE MOUNTPOINT LABEL UUID PARTLABEL PARTUUID SIZE ALIGNMENT MIN-IO OPT-IO TYPE WWN TRAN VENDOR
abc abc 500G 0 512 0 disk
└─abc1 abc1 LVM2_member vxAeBC-QNSY-ProJ-csGC-YPT0-weMg-YCDy2Y 500G 0 512 0 part
├─testvg-test_home dm-275 xfs /test/home 495f1d16-a4de-42bf-b26d-4d3152daacb5 350G 0 512 0 lvm
├─testvg-test_kourier dm-276 xfs /test/apps e055ecb9-2248-4aec-bdd1-5fa096aebf7e 50G 0 512 0 lvm
├─testvg-test_debuglogs dm-277 xfs /test/debuglog b95779d3-95b1-4b14-80f8-5b84071a6021 25G 0 512 0 lvm
└─testvg-test_usr2 dm-278 xfs /test/usr2 994bc5e6-5d4a-4690-a0e9-72cd227b5e83 20G 0 512 0 lvm
Based on what I have read in the man pages, I believe the following are some of the first commands, which should be executed. But, I would appreciate any feedback or correction. And I believe the command lvcreate
should be executed next, but I am not entirely sure.
root@server1# parted /dev/abc mklabel msdos
root@server1# parted /dev/abc mkpart primary ext4 32.3K 537G
root@server1# pvcreate /dev/abc