3

When I run cfdisk (or fdisk) to partition a storage device, there's a point where I can specify the file system type. Does this do anything with respect to the actual file system?

Suppose I want to to format a usb thumb drive with an ext2 file system. I'll still need to run mke2fs after cfdisk, correct?

Would there be any problems with choosing something like FAT32 (or SWAP or whatever) in cfdisk and then creating an ext2 file system with mke2fs? What's the worst that could happen?

5

No it doesn't generally matter, it's just setting a value in the MBR portion of the partition.

                       ss #1

On certain OS'es such as Windows it does a check of the parititon type that's written here and will balk if it doesn't recognize it, on Linux it's generally oblivious and doesn't care what you put in that location.

See my answer to this Q&A where I cover it a bit more if you're interested, titled: fdisk -l shows ext3 file system as HPFS/NTFS.

TL;DR

So to summarize, you can generally select whatever you want for the partition types during the fdisk/cfdisk stage, and what really controls the type of a partition is the way that it's formatted when mkfs.* is used.

The worst that can happen is that your partition is not bootable by your OS, and you'll have to re-partition and re-format.

| improve this answer | |
0

when you specify a fs type with partitioning application such as parted, fdisk or cfdisk, indeed you wrote in the given partition a number , but when you format a partition , with mkfs you formatted with the given filesystem .

Problem : Suppose you have defference number id and filesystem, an application read your partition and decide according to your number id, So your application decides wrong.

| improve this answer | |
  • AFAIK the partition id is largely ignored these days, any well written application would consider it more of a hint than anything else. – Graeme Feb 21 '14 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.