LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-17-2015, 01:44 PM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
role of partition type (code) in fdisk


As the title says, I want to know the role played by the partition type in fdisk. For instance, you create a new partition, choose the size and so on, and then you choose the type. Then you exit and you format it. What's the point of choosing the partition type if you format it with mkfs.ext4? So you specify ext4 in the format command.

Last edited by vincix; 10-18-2015 at 01:08 AM.
 
Old 10-17-2015, 01:58 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
https://www.win.tue.nl/~aeb/partitio...n_types-1.html
 
Old 10-17-2015, 02:18 PM   #3
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by Keruskerfuerst View Post
Not surprising that you are horridly unhelpful, as you haven't read my post correctly. I'll wait for someone nicer

Last edited by vincix; 10-17-2015 at 02:26 PM.
 
Old 10-17-2015, 03:22 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
The partition type, also called the partition ID, is just a byte, the eighth, in a partition table entry.

From here:

Quote:
The partition type (or partition ID) in a partition's entry in the partition table inside a Master Boot Record (MBR) is a byte value intended to specify the file system the partition contains and/or to flag special access methods used to access these partitions...

It is up to an operating system's boot loader and/or kernel how to interpret the value. So the table specifies which operating systems or disk-related products originally introduced an ID and what file system or special partition type they mapped it to. Partitions with partition types unknown to the software should be treated as reserved but occupied disk storage space, which should not be dealt with by the software, except for in FDISK-like tools.
The fdisk utility allows you to set an initial value for this byte, even though the partition itself has not yet been formatted (if applicable).

When you subsequently format the partition, for example with mke2fs, the value is reset - possibly to something different than had been specified with fdisk.

As stated in the above quoted snippet, it can represent something other than the filesystem type. For example, this is where a partition is identified as an extended type, which allows it to serve as a container for logical partitions, each of which may be of different filesystem types.

So to answer your question, I think, fdisk allows you to choose an initial value for this byte in the partition table which may identify it as an extended or other special access type, or may indicate the intended filesystem type which will only actually exist after subsequent formatting.

One use of this is for installers to identify target partitions for option selection such as swap, root and existing window$ partitions when installing a bootloader, or when specifying unformatted partitions for use.

Last edited by astrogeek; 10-17-2015 at 03:45 PM.
 
Old 10-18-2015, 01:06 AM   #5
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Thank you for your ample answer.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk created fat32 partition, which type 0b or 0c? onedingo Linux - General 14 09-25-2022 12:55 PM
[SOLVED] SELinux possible to allow role to type? cquick197 Linux - Security 2 04-22-2014 03:17 PM
[SOLVED] fdisk shows wrong partition type BlackTornado Linux - Newbie 3 03-06-2013 02:39 AM
partition type reader script/code robertjinx Programming 12 08-06-2010 08:10 AM
fdisk partition type question downinthemine Slackware - Installation 5 12-22-2003 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:37 PM.

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