[SOLVED] What happens to gpt partition numbering when you delete a partition?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What happens to gpt partition numbering when you delete a partition?
I have been trying to google this but couldn't find anything relevant.
On a dos disk, if you delete a primary partition, the numbering of other partitions is not affected. If you then create a new primary partition, it gets the same number as the one you deleted, regardless of its location on the drive. With logical disks however, deleting a partition makes the other numbers close up, which affects your bootloader and fstab.
What happens when you delete a primary partition on a gpt disk?
I have been trying to google this but couldn't find anything relevant.
On a dos disk, if you delete a primary partition, the numbering of other partitions is not affected. If you then create a new primary partition, it gets the same number as the one you deleted, regardless of its location on the drive. With logical disks however, deleting a partition makes the other numbers close up, which affects your bootloader and fstab.
What happens when you delete a primary partition on a gpt disk?
As with msdos MBR primnary partitions, the numbering of the other GPT partitions will not change.
In a nutshell, a legacy MBR(DOS) partition table has 4 entries for primary partitions (1-4). You can create a partition of any number (1-4) in any order and anywhere on the disk. An extended partition also has an extended MBR for each logical partition (>4) that contains the start location of the next partition which creates a linked list. Removing a logical partition that isn't the last will renumber the list.
The GPT partition table is an array similar to the MBR partition table and has entries for 128 partitions which is the maximum number possible. Also in a similar manner you can create any partition in any numerical order and anywhere on the disk. Some partition tools may not let you pick a partition number. Deleting a partition just deletes that table entry with no affect to any other existing partition.
Also, from "man gdisk", among the "expert menu" commands:
Quote:
t Swap two partitions' entries in the partition table. One partition may be empty. For instance, if partitions 1-4 are defined, transposing 1 and 5 results in a table with partitions numbered from 2-5. Transposing partitions in this way has no effect on their disk space allocation; it only alters their order in the partition table.
So you can renumber misplaced partitions as a separate operation (you can do that on DOS drives too I believe), but they don't get renumbered automatically.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.