Tag Archives: fsck

fsck and filesystem type

I just learned something that I thought worked through filesystem magic when I connected an old usb harddrive to one of my systems.

If you move a drive from one system to another and want to run fsck on it as usual, it will fail.
character# fsck /dev/da1s1
fsck: Could not determine filesystem type

This is since fsck needs an entry in /etc/fstab or to be given it as an argument to know what filesystem is on the disk or partition in question..
character# fsck -t UFS /dev/da1s1
** /dev/da1s1
** Last Mounted on ...

Checking the manual actually says it uses fstab, but I guess I have just never noticed it before by pure luck of either having it in there or using the proper flags wihtout thinking of it..

The behaviour seems to be roughly the same in linux except that if no argument is given and no entry found in fstab fsck attempts to use the systems default fs type.

And now I know!