Saturday, March 16, 2019

Attaching/Mounting AWS EBS volume group in CentOS

Follow below steps:

1) List the disk groups existing with in the system

ll /dev/xvd*

2) Verify if the volume groups were attached to any directory.
df -h

3) lsblk

4) use mount to mount and umount to unmount.
Example to remove existing mount, umount /random_directory

5) vgdisplay -c

6) Create a volume group "vgroup1"
vgcreate vgroup1 /dev/xvdc

7) Then create logical volume "lvolume1" from volume group "vgroup1". Here, we are utilizing 100% of disk volume.
lvcreate -l100%FREE -n lvolume1 vgroup1

Now Create file system
mkfs -t xfs /dev/vgroup1/lvolume1

And create required directories and point to them.
mkdir /data_cassandra

mount /vgroup1/lvolume1 /data_cassandra

Then, edit the /etc/fstab file for effective even after reboot. Get the mapper info from df -h or /dev/mapper

8) mount -a (it resets the changes that were modified in /etc/fstab)

9) vgdisplay -c

***

No comments:

Post a Comment