Difference between revisions of "LVM"

Wiki.TerraBase.info
Jump to navigation Jump to search
m
m
Line 6: Line 6:
===Command Alternative===
===Command Alternative===


<pre>
==== Show Existing LVM Setup ====
<syntaxhighlight lang="bash">
# List Physical Volumes (PVs)
# List Physical Volumes (PVs)
pvs
pvs
Line 15: Line 16:
# List Logical Volumes (LVs)
# List Logical Volumes (LVs)
lvs
lvs
</pre>
</syntaxhighlight>


<br />
====== Create a New LVM Structure ======


====Create a New LVM Structure====
====== 1. Create a Physical Volume (PV) on <code>/dev/sdb</code> ======
 
<syntaxhighlight lang="bash">
====1. Create a Physical Volume (PV) on <code>/dev/sdb</code>====
<pre>
pvcreate /dev/sdb
pvcreate /dev/sdb
</pre>
</syntaxhighlight>


===2. Create a Volume Group (VG) named <code>my_vg</code>===
====== 2. Create a Volume Group (VG) named <code>my_vg</code> ======
<pre>
<syntaxhighlight lang="bash">
vgcreate my_vg /dev/sdb
vgcreate my_vg /dev/sdb
</pre>
</syntaxhighlight>


===3. Create a Logical Volume (LV) named <code>my_lv</code> (10GB size)===
====== 3. Create a Logical Volume (LV) named <code>my_lv</code> (10GB size) ======
<pre>
<syntaxhighlight lang="bash">
lvcreate -L 10G -n my_lv my_vg
lvcreate -L 10G -n my_lv my_vg
</pre>
</syntaxhighlight>
 
<br />


==Show the Created LVM Components==
===== Show the Created LVM Components =====
<pre>
<syntaxhighlight lang="bash">
pvs  # Show Physical Volumes
pvs  # Show Physical Volumes
vgs  # Show Volume Groups
vgs  # Show Volume Groups
lvs  # Show Logical Volumes
lvs  # Show Logical Volumes
</pre>
</syntaxhighlight>

Revision as of 14:46, 2 February 2025

...gonna take a shortcut on this and as a foundation, just paste in ChatGPT generated text instead of retyping it, then add stuff in and modify it.

Blivet

A great GUI tool for managing and creating LVs. But sadly, doesn't exist or work past Rocky 8. When creating a Volume Group BLIVET creates the Partition, Physical Volume, and Volume Group in one swift move.

Command Alternative

Show Existing LVM Setup

# List Physical Volumes (PVs)
pvs

# List Volume Groups (VGs)
vgs

# List Logical Volumes (LVs)
lvs
Create a New LVM Structure
1. Create a Physical Volume (PV) on /dev/sdb
pvcreate /dev/sdb
2. Create a Volume Group (VG) named my_vg
vgcreate my_vg /dev/sdb
3. Create a Logical Volume (LV) named my_lv (10GB size)
lvcreate -L 10G -n my_lv my_vg
Show the Created LVM Components
pvs  # Show Physical Volumes
vgs  # Show Volume Groups
lvs  # Show Logical Volumes