63

I want to mount a partition to an auxiliary folder via mount to fix a damaged grub.

I used the command.

sudo mount /dev/sdb2 /home/ubuntu/temp

and got as error:

mount: you must specify the filesystem type

Why?

andandandand
  • 1,269

6 Answers6

59

You need to add the -t FILESYSTEMTYPE argument to the command, replacing FILESYSTEMTYPE with your filesystem type. This specifies the filesystem type of the filesystem to be mounted. In your case, this would be /dev/sdb2. Some common, valid filesystem types are:

  • auto - this is a special one. It will try to guess the fs type when you use this.
  • ext4 - this is probably the most common Linux fs type of the last few years
  • ext3 - this is the most common Linux fs type from a couple years back
  • ntfs - this is the most common Windows fs type or larger external hard drives
  • vfat - this is the most common fs type used for smaller external hard drives
  • exfat - is also a file system option commonly found on USB flash drives and other external drives
reverendj1
  • 16,045
  • 9
    But normally, it will guess the correct filesystem. I don't think I usually need to specify the file system type. There may be some other problem preventing it from recognizing the type in this case. – Marty Fried May 29 '12 at 16:25
  • Given that the OP seems to be trying to fix a damaged filesystem, it may not be detected correctly. – reverendj1 May 29 '12 at 16:44
  • I only see a damaged grub configuration, with a UUID that doesn't exist; but what I was gettting at is to suggest that this may not be the problem (not so much for you as for the OP). The problem may well be something like an incorrect partition specifier, but I didn't want to get too detailed because his question was not well done (note he didn't even specify the mount command at all), plus he's already started other topics on the subject, it seems. I didn't want him to be too surprised if it still didn't work. – Marty Fried May 29 '12 at 16:52
15

I was getting a similar error:

# mount /dev/sdb1 /mydisk/ -t auto
mount: you must specify the filesystem type

I tried finding out the issue and the issue was, I had partitioned it but no filesystem was assigned.

# mkfs.ext3 /dev/sdb1 2>/dev/null
...
Superblock backups stored on blocks: 
...
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override

After this it successfully got mounted.

Eliah Kagan
  • 117,780
Ankzz
  • 159
  • 1
  • 3
8

There is more to the story here. Usually if you mount a partition with a common filesystem type using mount, it will auto-detect the partition type.

The fact that it isn't auto-detecting it in this case could signal a few possibilities.

  • You haven't installed filesystem tools for the chosen filesystem. If you did a standard desktop install of Ubuntu, this shouldn't normally be a problem.

    For example, to mount ntfs drives in recent versions of Ubuntu you need the ntfs-3g package.

  • You selected the wrong partition.

  • The partition is corrupt or unformatted. In this case, you should probably do a filesystem check (fsck) on it before mounting it. You may then want to proceed to mount it manually, specifying the filesystem type, as read-only. If all else fails you may need special recovery software such as testdisk photorec.

thomasrutter
  • 36,774
  • Change from testdisk to photorec is because testdisk is for undeleting when the partition is healthy, or finding a lost (but healthy) partition. Photorec is for recovering some file types when the partition is corrupt and eg. can't be mounted. – thomasrutter Jul 01 '15 at 00:01
6

Please use parted -l to check the partition type and make sure you are mounting an actual data partition with known partition types (for example, ntfs, fat, etc).

Here is what you would see from an 8TB drive, the first partition is not the actual data partition and instead, you should mount the second partition, which is the actual data partition.

Model: TRUSTED Mass Storage (scsi)

Disk /dev/sdb: 8796GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags

1      17.4kB  134MB   134MB                Microsoft reserved partition msftr                                                                             `                    es

2      134MB   8796GB  8796GB  ntfs         Basic data partition
Pabi
  • 7,401
  • 3
  • 40
  • 49
AZhu
  • 161
  • 1
  • 2
  • 1
    @Ron If you edit posts like this, don't just indent the code, remove the ` signs aswell. – Pabi May 08 '15 at 15:40
1

If you have a > 32 GB drive usable on Windows and/or Mac that is not NTFS, and that is what you try to mount, chances are that you are trying to mount an exfat drive.

For that to work, you need to install exfat-utils (and exfat_fuse that will automatically be installed as a dependency).

  • exfat should be common now as it is standard in SDcard with size >32GB (SDXC) and i intentionally format my USB flashdrive as exfat so my linux,windows,and mac can read and write it. – izzulmakin Feb 13 '21 at 07:47
0

You can check the filesystem type by file command:

file -sL /dev/sd*

The usage of -s is explained in file - Linux/Unix command and here is an excerpt:

"This is useful for determining the filesystem types of the data in raw disk partitions, which are block special files."

Besides, I mounted successfully without specifying -t type.

Clara
  • 1