LVM Naming Scheme⚓︎
About⚓︎
Everyone has their preferred scheme, this is mine.
Scheme⚓︎
Volume Groups⚓︎
<function>_<hostname>_vg<number>
Function - Short 2-4 letter word or acronym which is the purpose of this Volume Group. boot
, data
, db
, vdo
, etc.
Hostname - The systems short hostname, that which is returned by hostname -s | tr -d '-'
. This is a crucial portion of the Volume Group name as it assists in identifying VGs if a disk is ever moved to a different host. Without this a volume named boot_vg1
which is moved to a different system may cause issues during boot.
vg# - Identifies this is a Volume Group, and which instance it is. The vg
assists in easily identifying devices in /dev/mapper/
, while the number helps avoid VGs being named things like new
when migrating VGs.
Note: Avoid using -
in Volume Group names as it will create confusing names within /dev/mapper/
.
Example Volume Group Names⚓︎
VG:
- boot_attemptare_vg1
- data_attemptare_vg1
- demo_attemptare_vg1
VG, with LV naming, in /dev/mapper:
- /dev/mapper/boot_attemptare_vg1-root_lv1
- /dev/mapper/boot_attemptare_vg1-var_log_lv1
Logical Volumes⚓︎
<function><_subfunction>_lv<number>
Function - Short 2-4 letter word or acronym which is the purpose of this Logical Volume. This can also be the mountpoint name. boot
, var
, home
, temp
, etc.
Subfunction - Optional 2-4 letter word to further identify this volumes purpose. When using thin LVs this should be thin
, making the start of the LV name boot_thin
, or if this is a subdirectory mountpoint it could be var_log
, etc.
lv# - Identifies this is a Logical Volume, and which instance it is. The lv
assists in easily identifying devices in /dev/mapper/
, while the number helps avoid LVs being named things like new
when migrating LVs.
Example Logical Volume Names⚓︎
LV:
- boot_attemptare_thin_lv1
- home_lv1
- root_lv1
- var_log_lv1
VG, with LV naming, in /dev/mapper:
- /dev/mapper/boot_attemptare_vg1-home_lv1
- /dev/mapper/boot_attemptare_vg1-root_lv1
- /dev/mapper/boot_attemptare_vg1-var_log_lv1