3

I have recently added a 562 GB to a virtual machine in Vsphere. I expanded the /dev/sda2. I performed the 8e LVM... and now executed pvresize /dev/sda2

My goal is to expand the LVM for root partition.

I would like to know what is the proper way write the following commands: because whather I use either path /dev/mapper/rhel-root or /dev/rhel/root my server still reboots fine and changes seem ok.

lvextend -l +452G /dev/rhel/root
xfs_growfs /dev/rhel/root

lvextend -l +452G /dev/mapper/rhel-root
xfs_growfs /dev/mapper/rhel-root

What is the difference on the above paths for the commands, since both sets deliver the same solution. Does anyone know?

1

1 Answer 1

3

If you do an ls -l on these entries you'll probably find they're both symlinks and both point to the same entry:

eg on my CentOS 6 machine:

% ls -l /dev/Raid10/vm.kali /dev/mapper/Raid10-vm.kali 
lrwxrwxrwx 1 root root 8 Aug  3 15:55 /dev/Raid10/vm.kali -> ../dm-10
lrwxrwxrwx 1 root root 8 Aug  3 15:55 /dev/mapper/Raid10-vm.kali -> ../dm-10

This means it doesn't really matter which name you use. They both operate on /dev/dm-10 (in this case)

I, personally, prefer the /dev/VG/LV naming scheme; it's less to type :-)

1
  • You are right. They are symlinks. I have to learn more about them. # ls -l /dev/rhel/root /dev/mapper/rhel-root lrwxrwxrwx. 1 root root 7 Aug 4 11:10 /dev/mapper/rhel-root -> ../dm-0 I really appreciate your help, thank you so much.
    – user125971
    Aug 4, 2016 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .