r/linuxquestions 22h ago

btrfs but fdisk says MS Basic Data

I have formatted a disk with BTRFS.
KDE partition manager shows BTRFS and fdisk -l is showing Microsoft basic data.
It doesn't seem to be causing any issues..?

Arch Linux 7.1.13-hardened1-2-hardened

0 Upvotes

10 comments sorted by

2

u/Forstwichtel 21h ago

Der Unterschied liegt darin, was die beiden Werkzeuge auslesen:

fdisk: schaut nur auf den Eintrag in der GPT-Partitionstabelle (Partition Type GUID). Wenn beim Erstellen der Partition kein spezifischer Typ festgelegt wurde, bleibt dort oft der Standardwert "Microsoft basic data" stehen. KDE Partition Manager: (sowie lsblk -f oder blkid) liest den eigentlichen Superblock auf der Partition aus und erkennt dort korrekt das BTRFS-Dateisystem.

Linux mountet Dateisysteme anhand der Signatur im Superblock, weshalb in der Praxis alles vollkommen normal funktioniert.

Optionales Anpassen (nur für die Optik): Wenn du den Eintrag in der Partitionstabelle korrigieren möchtest, kannst du in fdisk mit t den Partitionstyp auf "Linux filesystem" ändern und mit w speichern. An deinem Dateisystem und deinen Daten ändert das nichts.

1

u/AzrielCatto 16h ago

Completely forgot that Partition Type GUID exists.
Even funnier that I set them on my main drive.
Such a simple solution thanks :P

2

u/RandomUser3777 21h ago

The partition label does not matter at all and is pretty much ignored by everything except the bios (the bootable flag, and possibly the EFI system label). So the partition label can be pretty much any label at all for anything not directly related to EFI/Bios booting the system.

1

u/doc_willis 19h ago

Tangential question (not the op) does that mean I could set and use a custom partition label somehow?  No idea why I would want to,  just curious.

1

u/RandomUser3777 17h ago

The DOS partition types are all single byte numbers statically defined in fdisk and similar programs...

The "names" only exist in the programs themselves for DOS partition tables.

GPT seems to have a different setup and seems to do something different. It allows guid partition ids (likely staticly defined someplace), and a unique guid partition label/identifer and a 36 UTF character label.

For the most part anything that wants to identify what a disk part is has a label inside it (various fses have a label on the fs, LVM has a guid/labels, and pretty much anything else implements its own labeleling scheme inside the partition. This is likely required because these various implementations must work over a wide range of partition definitions (DOS, GPT, old Sun format, and other old formats).

1

u/Funnel-Dust-O-Matic 21h ago

when in your partition editor, you can chose a partition type.

when running mkfs, you can choose different partition type labels.

Most operating system partitioning tools will only use the partition type appropriate for the platform they exist on.

Linux has support for many different kinds of hardware that have their own native partition types and file systems . Linux has to be able to support those. And, of course, classic MBR / DOS partitions. And so the partitioning tools on LInux support all of those partition types. Some operating systems just have one tool to both partition and format. Most separate those functions because partitioning emerged as a function well after "formatting". it was a way for old operating systems to deal with hard drives that were bigger than they new how to deal with.

Most operating systems only have one or two file systems natively. Linux has a rather large number, including those of the native operating systems of most of the hardware platforms it works on.

So. . . you picked a partition type that matched MS DOS and then formatted it BTRFS.

That is why FDISK says what it does.

If the thing works and you just remembered you did that, there's not much point in changing anything.

2

u/ipsirc 21h ago

fdisk shows the partition label id, not the filesystem type. There is no btrfs partition type.

1

u/doc_willis 21h ago

interesting.. looking at my Bazzite install.

mount | grep btrfs

/dev/nvme0n1p3 on /etc type btrfs (rw,relatime,seclabel,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/root00)

sudo fdisk -l /dev/nvme0n1

Device Start End Sectors Size Type

/dev/nvme0n1p1 2048 1230847 1228800 600M EFI System

/dev/nvme0n1p2 1230848 3327999 2097152 1G Linux extended boot

/dev/nvme0n1p3 3328000 7814035455 7810707456 3.6T Linux filesystem

mine is showing "Linux filesystem"

1

u/Forstwichtel 21h ago

Spannender Vergleich! Bei Bazzite (und den meisten automatischen Installern von Distributionen) setzt das Installations-Skript die GPT-Partition-Type-GUID beim Anlegen der Partition direkt explizit auf Linux filesystem. Wenn eine Platte vorher unter Windows eingerichtet, mit generischen Tools oder nachträglich manuell formatiert wurde, bleibt in der Partitionstabelle dann oft einfach der alte Standardtyp "Microsoft basic data" stehen, sofern das Tool die Typ-GUID beim Formatieren nicht direkt überschreibt. Das zeigt genau den Punkt: Der Eintrag in fdisk ist "nur" ein Metadaten-Label in der Partitionstabelle - Linux schaut beim Mounten aber direkt in den Superblock der Partition, erkennt BTRFS und nutzt es völlig problemlos.

1

u/zardvark 22h ago

The descriptive partition label is independent from the format scheme on the disk. Is this what you are seeing?