From 1e469e1eefa62f1a0c8cd6e22e15078c3dfef926 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Mon, 9 Dec 2024 16:06:02 -0700 Subject: [PATCH] Update Workflows/Linux/Expand RHEL Filesystem.md --- ...ilesystem.md => Expand RHEL Filesystem.md} | 70 ++++++++++++++----- 1 file changed, 54 insertions(+), 16 deletions(-) rename Workflows/Linux/{Expand XFS Filesystem.md => Expand RHEL Filesystem.md} (70%) diff --git a/Workflows/Linux/Expand XFS Filesystem.md b/Workflows/Linux/Expand RHEL Filesystem.md similarity index 70% rename from Workflows/Linux/Expand XFS Filesystem.md rename to Workflows/Linux/Expand RHEL Filesystem.md index f8a06fa..cd2f993 100644 --- a/Workflows/Linux/Expand XFS Filesystem.md +++ b/Workflows/Linux/Expand RHEL Filesystem.md @@ -15,23 +15,61 @@ This step goes over how to increase the usable space of the virtual disk within !!! warning "Be Careful" When you follow these steps, you will be deleting the existing partition and immediately re-creating it. If you do not use the **EXACT SAME** starting sector for the new partition, you will destroy data. Be sure to read every annotation next to each command to fully understand what you are doing. -``` sh -sudo dnf install gdisk -y -gdisk /dev/ # (1) -p # (2) -d # (3) -4 # (4) -n # (5) -4 # (6) - (Just press ENTER) # (7) - (Just press ENTER) # (8) - (Just press ENTER) # (9) -w # (10) -``` +=== "Using GDISK (Rocky)" + + ``` sh + sudo dnf install gdisk -y + gdisk /dev/ # (1) + p # (2) + d # (3) + 4 # (4) + n # (5) + 4 # (6) + (Just press ENTER) # (7) + (Just press ENTER) # (8) + (Just press ENTER) # (9) + w # (10) + ``` + + 1. The first command needs you to enter the disk identifier. In most cases, this will likely be the first disk, such as `/dev/sda`. You do not need to indicate a partition number in this step, as you will be asked for one in a later step after identifying all of the partitions on this disk in the next command. + 2. This will list all of the partitions on the disk. + 3. This will ask you for a partition number to delete. Generally this is the last partition number listed. In the example below, you would type `4` then press ++enter++ to schedule the deletion of the partition. + +=== "Using FDISK (Oracle / Other OS)" + + ``` sh + # Resize Partition of Disk in PV Group + fdisk /dev/hda # Use pvdisplay to get the disk identifier + p # List Partitions + 2 # Assume Partition 2 (e.g. /dev/hda2) + d # Delete the partition + n # Make a new Partition + p # Primary Partition Type + Starting Sector: + Ending Sector: + w # Commit changes to the disk + + # Probe the new partition + partprobe /dev/hda + + # Reboot the Server + reboot + + # Resize PV Device + pvresize /dev/hda2 + pvdisplay # To Confirm size Increased + + # Extend the Logical Volume for the Target Disk + lvextend -l +100%FREE /dev/VolGroup00/LogVol00 # Get this from running lvdisplay to find the correct LV + + # Resize the Filesystem of the OS + resize2fs /dev/VolGroup00/LogVol00 + + # Validate Space increased + df -h + ``` + -1. The first command needs you to enter the disk identifier. In most cases, this will likely be the first disk, such as `/dev/sda`. You do not need to indicate a partition number in this step, as you will be asked for one in a later step after identifying all of the partitions on this disk in the next command. -2. This will list all of the partitions on the disk. -3. This will ask you for a partition number to delete. Generally this is the last partition number listed. In the example below, you would type `4` then press ++enter++ to schedule the deletion of the partition. ``` Command (? for help): p Disk /dev/sda: 2147483648 sectors, 1024.0 GiB