Skip to contentSkip to conversation

LVM Naming Convention

linux-lvm Mike Seda 5 participants 5 messages Apr 19, 2011 – Apr 20, 2011

lore
Share & tools
lore

Mike Seda

author
#0 lore raw

Hi All,
Recently, I came across the new LVM naming convention in RHEL 6. This convention places the output of "hostname -s" in the VG name. This doesn't really fit into the way I've previously setup VGs, which was to create a new VG for each type of disk attached to the system, e.g. RAID 1 SAS 10K (local), RAID 6 SATA 7.2K (SAN).

I guess I could modify the naming convention slightly as shown below:
- /dev/vg_hostname -s_[0-9][0-9]/lv_{foo|bar}

Another thought I had was that maybe I don't need a separate VG for each type of disk since the lvcreate/lvextend commands seem to be able to create/grow an LV by PV. My understanding is that this would allow you to skip the step of growing the VG by the PV, right?

Essentially, I'm just wondering what other folks in my situation are doing for LVM naming.

Thanks In Advance,
Mike

#1 lore raw

i have started putting the hostname in my vg names as well, mainly so that if i have to move the drives to another system for upgrades, crashes, etc, i don't get collisions between the local vg and the one i'm hooking up temporarily.

Quoted 27 lines · Mike Seda

Hi All,
Recently, I came across the new LVM naming convention in RHEL 6. This convention places the output of "hostname -s" in the VG name. This doesn't really fit into the way I've previously setup VGs, which was to create a new VG for each type of disk attached to the system, e.g. RAID 1 SAS 10K (local), RAID 6 SATA 7.2K (SAN).

I guess I could modify the naming convention slightly as shown below:
- /dev/vg_hostname -s_[0-9][0-9]/lv_{foo|bar}

Another thought I had was that maybe I don't need a separate VG for each type of disk since the lvcreate/lvextend commands seem to be able to create/grow an LV by PV. My understanding is that this would allow you to skip the step of growing the VG by the PV, right?

Essentially, I'm just wondering what other folks in my situation are doing for LVM naming.

Thanks In Advance,
Mike

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw

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

Quoted 46 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joe Pruett
Sent: onsdag den 20 april 2011 00:37
To: LVM general discussion and development
Subject: Re: [linux-lvm] LVM Naming Convention

i have started putting the hostname in my vg names as well, mainly so that if i have to move the drives to another system for upgrades, crashes, etc, i don't get collisions between the local vg and the one i'm hooking up temporarily.

Quoted 18 lines · Mike Seda

Hi All,
Recently, I came across the new LVM naming convention in RHEL 6. This convention places the output of "hostname -s" in the VG name. This doesn't really fit into the way I've previously setup VGs, which was to create a new VG for each type of disk attached to the system, e.g. RAID 1 SAS 10K (local), RAID 6 SATA 7.2K (SAN).

I guess I could modify the naming convention slightly as shown below:
- /dev/vg_hostname -s_[0-9][0-9]/lv_{foo|bar}

Another thought I had was that maybe I don't need a separate VG for each type of disk since the lvcreate/lvextend commands seem to be able to create/grow an LV by PV. My understanding is that this would allow you to skip the step of growing the VG by the PV, right?

Essentially, I'm just wondering what other folks in my situation are doing for LVM naming.

Quoted 9 lines

Thanks In Advance,
Mike

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
Quoted 5 lines · Emil

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

#4 lore raw

I concur with the OP on this convention. My usage scenario is different though. Most of my linux boxes are on VMware and I rely on cloning and templates a great deal. I leave the vg name generic so the templates are less messy. I don't have to worry about SAN naming conventions because my SAN storage is vmfs first, before files are carved out and handed to VMs. I suppose I could add a vg_rename as part of my cloning/templating instantiation process, but I'm unlikely to pass disks around.

-- Jess

________________________________________
From: [email protected] [[email protected]] On Behalf Of James Hawtin [[email protected]]
Sent: Wednesday, April 20, 2011 5:01 AM
To: LVM general discussion and development
Subject: Re: [linux-lvm] LVM Naming Convention

Quoted 5 lines · Emil

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

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/