GPT Partitioning with parted
One objective, and the commands are short. Two things are worth the guide: parted writes every change the instant the command returns, with no save step; and a partition recreated at the same offset on a reused disk inherits the previous filesystem's signature, which is demonstrated here rather than described.
Local Storage Guide 31 of 67 Intermediate
- OSRHEL 10.0
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 17 min
parted applies changes immediately. There is no w step as in fdisk, and no way to abandon a session. Add -s for scripted use so it never waits for a prompt, and -a optimal so alignment is handled for you.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
This guide includes
Use this before touching a disk. This matters because proving which disk is safe comes first every single time - and a filesystem signature can outlive the partition it was written in.
- proving which disk is safe, before anything else happens
- writing a GPT label, and creating partitions
- meeting a signature that outlives its partition, and clearing it properly
- deleting a partition, and finding out when that takes effect
- comparing GPT with MBR
Before you start
- A disk you are willing to destroy.
- Every destructive command on this page names a
/dev/sdadevice. On this machine the operating system is entirely on/dev/sdb. Check yours before running anything here - the first step shows how.
-
Prove which disk is safe
-
Writing a label and creating partitions
-
A signature that outlives its partition
-
Clearing it properly
-
Deleting, and when it takes effect
-
GPT versus MBR