Tuesday, July 12, 2011

Problem in mounting USB in Unix

Sometimes in Unix machine we are unable to mount USB, because of settings made in that OS.

You can change the settings or follow the below steps.

login as root
type "fdisk -l" command

This will show the o/p like this;

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xadafbee5
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         179     1436672   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2   *         179        9730    76712960   83  Linux
Disk /dev/sdb: 7998 MB, 7998537728 bytes
255 heads, 63 sectors/track, 972 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe16cd6ae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         971     7799526    b  W95 FAT32


You can find your USB which I marked in red as shown above;

Then type
mkdir /mnt/usb

mount /dev/sdb1 /mnt/usb

ls -l /mnt/usb this folder should contains your USB data.

mount <device name> <mount point>

After usage you can unmount the USB by fallowing command,

umount /mnt/usb

No comments:

Post a Comment