LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-06-2019, 02:08 PM   #1
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,612
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
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?
 
Old 05-06-2019, 06:29 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by hazel View Post
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.
 
1 members found this post helpful.
Old 05-06-2019, 06:44 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,746

Rep: Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925
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.
 
2 members found this post helpful.
Old 05-07-2019, 04:18 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 05-07-2019, 06:42 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,612

Original Poster
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
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.

Thanks, guys, that's what I wanted to know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] GPT table corrupted (again @%36372 GPT) BW-userx Linux - Hardware 5 08-29-2018 04:14 PM
[SOLVED] Delete GPT Partition sjreilly Linux - General 2 04-20-2013 11:24 AM
[SOLVED] Slackware 13.37 - gdisk choices, MBR, GPT or Blank GPT CFet Slackware - Installation 3 04-01-2011 04:46 PM
What happens to you if you use a Mac? Nargile General 29 10-24-2005 09:23 PM
delete third partition (what happens?) invasian Linux - General 1 09-24-2004 04:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration