0

Sorry if this question seems to be a silly one. But I want to clear my doubt regarding the relationship between partitioning and the file system.

These days almost all the hard disks come with a single partition by default. But why at least one partitioning is needed if I intend to use the whole hard disk and if I don't need any logical partitions?

To store files on the hard disk, isn't it installing the file system is enough by formatting it with a particular file system?. To install a file system why the partitioning has to be done? Somehow I didn't understand the logic between the file system and the partition. I think the partition is required only if you need the hard drive to be divided logically.

Could you please provide me any technical explanation on why the partition is required?

//Karteek

Karthik
  • 21

2 Answers2

1

To store files on the hard disk, isn't it installing the file system is enough by formatting it with a particular file system?. To install a file system why the partitioning has to be done? Somehow I didn't understand the logic between the file system and the partition. I think the partition is required only if you need the hard drive to be divided logically.

Technically, yes, that would be enough. Indeed many USB "flash drives" are formatted that way (commonly called "superfloppy", because floppy disks were also used that way).

But with a large fixed disk, you don't gain anything from it, only lose. (The partition table occupies 1 MiB at most.) Consider that you might want to repartition the disk a few years later – if you don't have a partition table now, adding one later would make the process several times as troublesome.

There's also (subjective) consistency: having several differently configured disks – some with partition tables, some without – is just messy in principle. [Even for filesystems with their own volume management like ZFS or btrfs, I'd be reluctant to use disks that way...]

grawity
  • 501,077
0

Let's take the room, cabinet, drawer and report analogy:

To store a report into a cabinet with multiple drawers you'll have to split it in chunks fitting within a drawer, that's what a filesystem driver does, split your file in chunks fitting a cluster on the partition.

Now you have a report split in chunks into multiple drawers, pilling up the drawers is far from convenient if you need to get the report back, you need a cabinet to store them and probably indexing them. That's what a partition is for, it give you the area to store the clusters and an index, the master file table which reference every file on your partition.

Now you have to set this cabinet somewhere, in a room probably, that's your disk, in a building there can be multiple rooms as there can be multiple disk in a computer.

An operating system can't guess in advance if you'll have 1 or more disk and if you'll wish to split up your disk for various reasons:

  • install two operating system maybe
  • or to use different filesystem on each partition
  • or just tweak the filesystem with different cluster size on each partition because you plan on storing larger file on a specific partition and using larger clusters would speed up the access time.

That's why you need a partition, that's a common ground for everyone to know how to store files, even if it's common to use only one partition because access time is less a problem nowadays, it's easier to just create one partition than having a variation of the driver sticking you on the choice you've done at first.

Obviously there's a fair amount of historical decision in this structure, but every part of a computer expect it to be like this, from the bios to load your kernel to the operating system when your modify the disk layout later.

Side note: there's a specific offset for bootable disks to wirte a boot loader, writing a filesystem directly on the whole disk is likely to render it not bootable at all and can be used only as a second device in this case.

Tensibai
  • 121