[linux-lvm] LVM Naming Convention

James Hawtin oolon at ankh.org
Wed Apr 20 09:01:49 UTC 2011


Assarsson, Emil wrote:
> We have also started to use hostnames in the VG names for the same reason. Starting with vg makes is easier to auto complete when using bash :-P. I don't see any reason why to use "lv" to the LV's but it doesn't hurt. I also try to use UUID's in the /etc/fstab as much as possible.
>
> Best regards
> Emil Assarsson
>   
I also use the hostname in the volume group name for all the reasons 
already suggest, its particularly valuable when dealing with san disk, 
as any mistake is very obvious.

personally I use

/dev/<hostname>_<type><number>_vg/<filesystem>_lv

Where type is l for local disk s for san. I keep my raid 1 and raid 5 in 
different volume groups to avoid mistakes, however both are called l or s.

Where the disk is for use to virtual machines I used

/dev/<hostname>_<type><number>_vg/<virtual machine>_v<number>_lv

I put _vg at the end of all volume groups mostly for completeness, and 
avoidance of any change of a name clash, I also thing _lv is useful as 
alots of devices can be mixed up in /dev/mapper so giving them a 
seperate namespace so the don't get mixed up with multipathed disk, (and 
in the old days raw devices) etc. I can do a ls /dev/mapper/*_lv to see 
all my logical volumes all in one go, independant of group.


James




More information about the linux-lvm mailing list