What happens if I run fsck on /dev/sda instead of /dev/sda1?

When fsck runs, it should first try to locate the superblock of a filesystem to begin traversing the filesystem's structure in order to validate it. Since the /dev/sda device corresponds to whole drive, the first portion of the disk will likely contain the partition table or Master Boot Record and fsck will not be able to locate the superblock for a supported filesystem (unless you get something that somehow matches a magic number for a known filesystem). I would expect it to exit in error or provide inaccurate output (as your friend experienced). However, I have not yet performed this experiment myself.


It won't work, if the filesystem was installed in a partition (e. g. sda1).

fsck and its brethren are tools for performing maintenance on filesystems (hence the name: filesystem ccheck), not of block devices.

It is, I suppose, theoretically possible to put a filesystem directly onto a block device by way of something like mke2fs -j /dev/sda, but this is very, very bad practice. But if you do, the filesystem would then live directly on sda, and then to fsck it, you would indeed just point fsck at the device. Do not do this. Partition tables are there for a reason, and it's not just to take up a nominal amount of space for a table of contents.

Tags:

Fsck

Devices