LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-17-2024, 07:10 PM   #1
JASlinux
Member
 
Registered: Oct 2020
Posts: 380

Rep: Reputation: Disabled
Question Why fdisk & gparted disk types do not match?


/dev/sda1 (partition) output from fdisk:
Code:
Disklabel type: dos
gparted gui indicates a gpt disk.

Are not all partitions on a physical volume the same partition table format?
 
Old 04-17-2024, 07:28 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
/dev/sda1 is a partition but you then mention disk label as in partition table or MBR. So in this you have two different things.

See what /dev/sda says.
 
1 members found this post helpful.
Old 04-17-2024, 07:39 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,719

Rep: Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912
Without seeing the output from fdisk it is not possible to understand the problem.

Quote:
Are not all partitions on a physical volume the same partition table format?
It is possible to create a table on a partition itself i.e. fdisk /dev/sdx1 that is separate from the entire drive i.e. fdisk /dev/sdx. You can find more then one thread on the site where the OP made the mistake.
 
Old 04-17-2024, 09:31 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Not sure how a hybrid would show up.
 
Old 04-17-2024, 09:50 PM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
FDISK and GPARTED show different things because you have them POINTED to different things.

From what I can tell (with possibly inadequate information) your /dev/sda disk has a GPT/EFI table. IF it is a normal EFI format that means partition /dev/sda1 will be DOS/FAT format file system and /dev/sda2 will be some format of Linux partition. (most common is Linux(83) type which can contain almost any of the Linux filesystems. On my laptops usually EXT4 or BTRFS. )

You pointed GPARTED at the disk.
You pointed FDISK at the DOS partition.

I hope that makes the situation clear.
 
Old 04-23-2024, 04:41 PM   #6
JASlinux
Member
 
Registered: Oct 2020
Posts: 380

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by michaelk View Post
It is possible to create a table on a partition itself i.e. fdisk /dev/sdx1 that is separate from the entire drive i.e. fdisk /dev/sdx. You can find more then one thread on the site where the OP made the mistake.
The output is clear, it is a GPT disk, but how MBR resides on GPT demands cognitive digestion.

It is as if a partition is just another disk. But if, say, an OS demands a GPT/UEFI setup, will it be the disk or partition complying with the standard?
 
Old 04-23-2024, 05:01 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,719

Rep: Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912Reputation: 5912
I believe we basically are all saying the same thing. You specified the wrong device when running fdisk. Again it is possible to create a partition table within a partition itself like below. The drive itself is GPT and the partition table created within the first partition is MBR. While it is possible I don't know if can actually be used. Best to create a new filesystem.

Code:
root@debian:~# fdisk -l /dev/sdb
Disk /dev/sdb: 1.44 GiB, 1543503872 bytes, 3014656 sectors
Disk model: VBOX HARDDISK   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9C186899-02B4-46B5-A148-70F5AC8C99DB

Device     Start     End Sectors  Size Type
/dev/sdb1   2048 3012607 3010560  1.4G Linux filesystem

root@debian:~# fdisk -l /dev/sdb1
Disk /dev/sdb1: 1.44 GiB, 1541406720 bytes, 3010560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8211f379

Device      Boot Start     End Sectors  Size Id Type
/dev/sdb1p1       2048 3010559 3008512  1.4G 83 Linux

Last edited by michaelk; 04-23-2024 at 05:04 PM.
 
Old 04-23-2024, 10:58 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by michaelk View Post
The drive itself is GPT and the partition table created within the first partition is MBR. While it is possible I don't know if can actually be used.
Oh, it can be used, and really isn't all that uncommon. Consider a host partition that is used as a virtual disk by a VM. Viewed from the host, it's a partition that then begins with a partition table. While it's uncommon to dig into that partition structure from the host, you can do it if you play the right games with kpartx. While you can do that from a booted system, there's no way to make the BIOS dig into that partition, treat it like a drive, and boot from it, at least none that I know of. It can of course be used as the boot drive for a VM, but that doesn't help if the objective is to install an OS on the bare hardware.
 
Old 04-24-2024, 12:28 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,588
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
Quote:
Originally Posted by rknichols View Post
Oh, it can be used, and really isn't all that uncommon. While you can do that from a booted system, there's no way to make the BIOS dig into that partition, treat it like a drive, and boot from it, at least none that I know of.
That's what BSD does. I fooled about a bit with openbsd a couple of years ago and was amazed to find that it subdivided its partition and placed some kind of mbr or label at the beginning of it to handle the sub-partitions. This label also had entries for the other main partitions on the drive so that they could be mounted within the BSD system.

It must have booted in two stages. There was some kind of BSD bootloader on the partition, which could be accessed with GRUB or reFind but not with elilo.

Last edited by hazel; 04-24-2024 at 12:31 AM.
 
Old 04-24-2024, 01:06 AM   #10
softfree
LQ Newbie
 
Registered: Apr 2024
Posts: 1

Rep: Reputation: 0
Why fdisk & gparted disk types do not match?

The discrepancy between disk types in fdisk and gparted often occurs because they interpret disk types differently. fdisk typically categorizes disks based on their partition table type (e.g., MBR or GPT), while gparted categorizes disks based on their partitioning scheme (e.g., MBR, GPT, or unallocated space). This variation can lead to differences in the reported disk types between the two tools.
 
Old 04-24-2024, 11:14 AM   #11
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Quote:
Originally Posted by softfree View Post
The discrepancy between disk types in fdisk and gparted often occurs because they interpret disk types differently. fdisk typically categorizes disks based on their partition table type (e.g., MBR or GPT), while gparted categorizes disks based on their partitioning scheme (e.g., MBR, GPT, or unallocated space). This variation can lead to differences in the reported disk types between the two tools.
Yeah, but that was not the issue here.
He pointed one at the disk /dev/sda
and the other at the PARTITION /dev/sda1
 
Old Yesterday, 11:55 PM   #12
friendlysalmon8827
Member
 
Registered: Dec 2023
Distribution: Anfroid,Debian
Posts: 96

Rep: Reputation: 5
The first disk on any modern SATA-based system is always referred to by the operating system a /dev/sda therefore the partition scheme of a primary HDD SDD under UNIX-Like operating systems counts up from the bared disk by orders of 1 for example the first partition on the first disk would be addressed as /dev/sda1 and the partitions would count up from that.
 
  


Reply

Tags
fdisk, gparted, gpt, mbr, partition table



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
why gparted does not recognize "ext4" (ataraid)? partition,but fdisk does rmh8400 Linux - Newbie 2 04-10-2023 03:31 AM
How to capture 1000 lines before a string match and 1000 line a string match including line of string match ? sysmicuser Linux - Newbie 12 11-14-2017 05:21 AM
sys/types.h & linux/types.h conflict while compiling johnnyhal Linux - Software 1 12-28-2008 06:39 PM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
Gotta love those ٱٱٱٱٱٱٱ&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:46 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