What the message looks like
$ sudo mount /dev/sdb1 /mnt/data
mount: /mnt/data: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.Common causes
- The helper for this filesystem is missing:
nfs-commonfor NFS,cifs-utilsfor SMB,ntfs-3gorexfatprogsfor NTFS and exFAT. - The device has no filesystem yet, or a different type than you gave, or you mounted the disk instead of its partition.
- A bad option or a typo in
/etc/fstab. - The filesystem is damaged or was not shut down cleanly.
- The device name changed after a reboot, so the line points to the wrong disk.
Check
- What does the device contain?
lsblk -f - Why did the kernel refuse? Read the last lines
- Type and UUID of the partition
sudo blkid /dev/sdb1 - Does fstab look valid?
findmnt --verify
Fix
- Read the kernel log first, it often says the exact reason.
- Install the missing helper for the filesystem and mount again, for example
sudo apt install nfs-common,cifs-utilsorntfs-3g. - Mount the right device with the right type:
sudo mount -t ext4 /dev/sdb1 /mnt/data. In fstab useUUID=instead of/dev/sdX, then test withsudo mount -a. - If it looks damaged, check it read-only first while unmounted:
sudo fsck -n /dev/sdb1. Repair withfsckonly after a backup. A repair can change or remove data. - If
blkidshows nothing, the disk has no filesystem. Creating one withmkfserases everything on it. Do it only on a disk you are sure is empty.
Typical scenario
At a cloud provider you attach a new data volume to the VM and run mount /dev/sdb /mnt/data. You get "wrong fs type, bad option, bad superblock". The volume was delivered empty and has no file system at all yet. lsblk -f shows nothing in the FSTYPE column. Check exactly that before you format: creating a file system deletes everything on the device.
FAQ
Is my data gone?
Not necessarily. The message is generic. Do not run mkfs or a repair before you know the cause and have a copy, for example an image made with dd on another disk.
Why does it fail only at boot?
A wrong line in /etc/fstab or a disk that is not ready. Add nofail for non-essential disks so the boot does not stop.
How do I check whether a device contains a file system?
lsblk -f or blkid /dev/sdb show the file system type. If the column is empty, the device is unformatted. You can then format it with mkfs.ext4 /dev/sdb, but only if you are sure no data is on it. If the result is unclear, stop and ask.
What does dmesg reveal for this error?
The last lines name the actual reason, for example "VFS: Can't find ext4 filesystem" for a wrong type, or hints about journal errors and damaged metadata. That line tells you whether type, option or the disk structure is the problem, so you do not have to guess.
May I run fsck on a mounted or unknown device?
Not in repair mode. A file system should be unmounted for checking and repair. With fsck -n /dev/sdb1 you only read without changing anything. If the device has no recognizable type, fsck achieves nothing anyway, and a wrong type can damage data.