mount an external drive in Ubuntu

Under Ubuntu, I am trying to mount an external hard drive .

(1). First I tried to find out the name of the device:

$ sudo fdisk -l  

Disk /dev/sda: 100.0 GB, 100030242816 bytes  
255 heads, 63 sectors/track, 12161 cylinders  
Units = cylinders of 16065 * 512 = 8225280 bytes  
Disk identifier: 0xa315a315  

   Device Boot      Start         End      Blocks   Id  System  
/dev/sda1               1         383     3076416   12  Compaq diagnostics  
/dev/sda2   *         384        6258    47190937+   c  W95 FAT32 (LBA)  
/dev/sda3            6259       12161    47415847+   f  W95 Ext'd (LBA)  
/dev/sda5            6259       10338    32772568+   7  HPFS/NTFS  
/dev/sda6           12041       12161      971901   82  Linux swap / Solaris  
/dev/sda7           10947       12040     8787523+  83  Linux  
/dev/sda8           10339       10946     4883728+  83  Linux  

Partition table entries are not in disk order  

I wonder which one is my external hard drive?

(2) Next I will mount the external hard drive assuming it is /dev/sda3

$ sudo mount /dev/sda3 /mnt/extdisk   
mount: you must specify the filesystem type  
$ sudo mount -t ntfs /dev/sda3 /mnt/extdisk   
mount: wrong fs type, bad option, bad superblock on /dev/sda3,  
       missing codepage or helper program, or other error  
       In some cases useful info is found in syslog - try  
       dmesg | tail  or so      
$ sudo mount -t vfat /dev/sda3 /mnt/extdisk   
mount: wrong fs type, bad option, bad superblock on /dev/sda3,  
       missing codepage or helper program, or other error  
       In some cases useful info is found in syslog - try  
       dmesg | tail  or so  

I wonder how to know the fs type of my external hard drive?

Thanks and regards!


Solution 1:

If you want to easily find the device name assigned to it:

  • Unplug your external drive
  • Open the terminal and run tail -f /var/log/messages
  • plug your drive in and watch, you'll get output like this:
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: new high speed USB device using ehci_hcd and address 10
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: New USB device found, idVendor=05dc, idProduct=a764
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: Product: USB Flash Drive
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: Manufacturer: Lexar
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: SerialNumber: CCMAR10MYORIAFSF1141
Nov 29 13:24:10 mercury kernel: usb 1-3.1.3: configuration #1 chosen from 1 choice
Nov 29 13:24:10 mercury kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Nov 29 13:24:16 mercury kernel: scsi 4:0:0:0: Direct-Access     Lexar    USB Flash Drive  1100 PQ: 0 ANSI: 0 CCS
Nov 29 13:24:16 mercury kernel: sd 4:0:0:0: [sdb] 7831552 512-byte hardware sectors: (4.00 GB/3.73 GiB)
Nov 29 13:24:16 mercury kernel: sd 4:0:0:0: [sdb] Write Protect is off
Nov 29 13:24:16 mercury kernel: sd 4:0:0:0: [sdb] 7831552 512-byte hardware sectors: (4.00 GB/3.73 GiB)
Nov 29 13:24:16 mercury kernel: sd 4:0:0:0: [sdb] Write Protect is off
Nov 29 13:24:16 mercury kernel:  sdb: sdb1

it's clear that the device has been assigned sdb. Now we can mount it's first partition:

mount -t vfat /dev/sdb1 /mnt

If that fails, your drive is probably NTFS formatted:

mount -t ntfs-3g /dev/sdb1 /mnt

Solution 2:

/dev/sda3 is certainly not your external drive, it's the third partition of your primary hard drive. Follow John T's instructions to find out your hard drive's device, or use cat /proc/partitions and look for entries that are not /dev/sdaX.