Ubuntu – Which filesystem is this volume, I want to mount to an ubuntu server

amazon ec2hard driveUbuntu

See those images below, it shows errors like wrong fs type, bad option, bad superblock, missing codepage or helper program, or other error….
I just tried to mount it as FAT

mount /dev/sdf /home/ubuntu/sdf -t vfat


Best Answer

You get the error message you are seeing when you specify the wrong fs type to the mount command.

If you created a filesystem on the disk then you should use the same type in the mount command. If you don't know what the fstype is then you can try the auto option

mount -t auto /dev/sdf /mnt

and then you can use df -T to find the type

Filesystem             Type     1K-blocks     Used Available Use% Mounted on
/dev/sdf               vfat        102182        0    102182   0% /mnt

If you didn't create a filesystem, or you don't know what it is then you may be able to identify it using the file command

On the vfat disk above

file -sL /dev/sdf
/dev/sdf: x86 boot sector, mkdosfs boot message display, code offset 0x3c, OEM-ID "   mkdosfs", sectors/cluster 4, root entries 512, Media descriptor 0xf8, sectors/FAT 200, heads 16, sectors 204800 (volumes > 32 MB) , serial number 0x75525ae1, unlabeled, FAT (16 bit)

On the same disk after mkfs to ext4

File -sL
/dev/sdf: Linux rev 1.0 ext4 filesystem data, UUID=8d50d025-c6df-4b9e-9e8e-9ed5538062ca (extents) (huge files)

It seems that fsck will also give information about the filesystem type if it recognises it

fsck -N /def/sdf
[/sbin/fsck.vfat (1) -- /dev/sdf] fsck.vfat /dev/sdf

mkfs -t ext4 /dev/sdf
fsck -N /dev/sdf
[/sbin/fsck.ext4 (1) -- /dev/sdf] fsck.ext4 /dev/sdf

If all that fails then chances are you don't have a filesystem on your disk so make one before mounting it with mkfs

Related Topic