updated notes

This commit is contained in:
Hugh Ratsch
2025-02-15 10:21:52 -06:00
parent 23037c1d56
commit 9c304fdaaf
+6
View File
@@ -155,6 +155,7 @@ sudo mount -a # Mount all partitions
sudo fdisk /dev/sda # Partition the disk /dev/sda
# Note: p for print, n for new partition, w for write, t for type, 8e for LVM
### Physical Volumes ###
sudo pvdisplay # Display all physical volumes
sudo pvs # Display all physical volumes
@@ -162,21 +163,25 @@ sudo pvcreate /dev/sda1p1 # Create a physical volume on /dev/sda1p1
sudo pvcreate /dev/sdb1p1 # Create a physical volume on /dev/sdb1p1
sudo pvcreate /dev/sdc1p1 # Create a physical volume on /dev/sdc1p1
### Volume Groups ###
sudo vgcreate vg_data /dev/sda1p1 /dev/sdb1p1 /dev/sdc1p1 # Create a volume group vg_data on /dev/sda1p1, /dev/sdb1p1, /dev/sdc1p1
sudo vgdisplay # Display all volume groups
sudo vgs # Display all volume groups
### Logical Volumes ###
sudo lvdisplay # Display all logical volumes
sudo lvs # Display all logical volumes
sudo lvcreate -n lv_data -l 100%FREE vg_data # Create a logical volume lv_data on vg_data
sudo lvcreate -n lv_data -L 100M vg_data # Create a logical volume lv_data on vg_data with a size of 100M
### Formatting and Mounting ###
sudo mkfs.xfs /dev/vg_data/lv_data # Format the logical volume lv_data as XFS
sudo mount /dev/vg_data/lv_data /mnt # Mount the logical volume lv_data to /mnt
sudo umount /mnt # Unmount the logical volume lv_data from /mnt
### Extending and Reducing ###
sudo lvextend -L +100M /dev/vg_data/lv_data # Extend the logical volume lv_data by 100M
sudo lvreduce -L -100M /dev/vg_data/lv_data # Reduce the logical volume lv_data by 100M
@@ -184,6 +189,7 @@ sudo lvremove /dev/vg_data/lv_data # Remove the logical volume lv_data
sudo vgremove vg_data # Remove the volume group vg_data
sudo pvremove /dev/sda1p1 /dev/sdb1p1 /dev/sdc1p1 # Remove the physical volumes /dev/sda1p1, /dev/sdb1p1, /dev/sdc1p1
### Interactive LVM Tool ###
sudo lvm # Interactive LVM tool
```