fdisk - do i need it or can i make a filesystem directly?

i read about fdisk being able to creation partition / which is to break down a physical disk into several logical partitions.

If i intend to utilize the whole disk as a whole, is it still necessary for me

1) to fdisk and create a primary partition that take up the size of the whole disk or

2) i can just go ahead and mkfs.ext4 without doing any fdisk ?

3) And why ->

Edited -> After reading all the comments (of some yes and no), i am thinking that it will be good if someone could point to me on what actually does fdisk do ? so that i can understand more on why do we actually need it in comparison to if we did not.

I tried googling around but most of the sites are teaching you how to fdisk, but not why (or most of the why is to create dual boot system), but i want to know why is it needed even for a single partition.

I have also tried mkfs on a disk directly and mount it to store data and file (does not seem to have any issue) -- so this make me even more curious on what fdisk actually does to the storage disk.


Solution 1:

No, you do not need it. Your disk and filesystem will work fine without partition table. Some older BSDs even did this by default if you selected dangerously dedicated.

However it is highly recommended for compatability reasons.


Somewhat more verbose:

You can run mkfs.ext4 directly on /dev/sdb. That will work. You then can mount that without problems. (mkfs.ext4 -F -F /dev/sdb).

You can setup a bootable disk this way. It will still require some code to boot. Which means you either need to skip the first bit of the disks. (e.g. the space classically used by the MBR and the traditional few sectors beyond it). That is still technically not using MBR, though you loose equivalent space.

For any modern setup however those few sectors are a tiny fraction of drive capacity. I therefor recommend using GPT (or on ancient systems MBR). But you can do without.

Solution 2:

You need to create a partition table even if you're going to use the entire physical disk. Think of the partition table as the "table of contents" for the file systems, identifying the start and stop locations of each partition as well as the file system used for it.