Posts Tagged With: external hard disk

Format and Mount an External hard disk in a Linux guest


When mounting an external hard disk in linux, I had to face some troubles and with help some google searches, I could resolve those issues . Here are the steps to mounting an external hard disk in Linux.

  1. Open a terminal and log in as the root user
  • Create a new directory in a preferred location (mkdir Ext_30GB)
  • chmod 777 Ext_30GB
  • Try this mount command. Command will fail if partition is not formatted

mount -t ext2 /dev/sdb1 Ext_30GB/

(If successfully external hard is mounted, ignore following things. If not, go ahead…)


  1. Enter following commands in terminal
    • fdisk –l

Preview

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
 64 heads, 51 sectors/track, 19275 cylinders, total 62914560 sectors
 Units = sectors of 1 * 512 = 512 bytes
Disk /dev/sdb doesn't contain a valid partition table

Solve ‘Disk /dev/sdb doesn’t contain a valid partition table’ pproblem

  • fdisk /dev/sdb

Enter following commands in the prompt,

  • Create a new partition table with ‘o
  • Create a new partition with ‘n
  • Create a ‘Linux’ partition ‘l
  • Let it use the default values by hitting ENTER when it asks for numbers, to take the entire available disk in this partition
  • Write the new partition table with ‘w‘, which should dump you back to the prompt.

Try the mount command again,

mount -t ext2 /dev/sdb1 Ext_30GB/

(It will success or following error message will appear)

Preview

mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Then you should have a /dev/sdb1 to format with mkfs.

  • file -s /dev/sdb1
  • mke2fs -S /dev/sdb1
  • mke2fs -j /dev/sdb1
  • file -s /dev/sdb1

Try the mount command again,

mount -t ext2 /dev/sdb1 Ext_30GB/

It should be working now

Categories: Linux | Tags: , , , , , | Leave a comment

Blog at WordPress.com.