Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Mass Storage Devices


The standard Mass Storage Device protocol is used for USB devices such as hard disk drives, flash memory drives, memory card readers, and digital cameras. Such devices have a standard VFAT (MS/Windows) file system.

The USB mass storage device is treated as a SCSI device so simply mount the SCSI device:

  # mount -t auto /dev/sda1 /mnt

You should now be able to see and use the device as any other disk. If you already have a SCSI device then the USB device might be /dev/sdb1 or /dev/sdc1, etc. Check the dmesg command to find out (probably mentioned in the last few lines after you plug the USB device in).

The kernel module usb-storage drives USB mass storage devices and should be automatically loaded by hotplug. The kernel module vfat is also required, and if it does not autoload then you will need to:

  # modprobe vfat

A sample setup of four USB devices includes a USB mouse, HP Printer/Scanner/Copier with a card reader, a digital camera, and a flash memory drive (3System USB flash disk). The /etc/fstab includes:

  /dev/sda1       /media/hpcard auto    rw,user,noauto  0 0
  /dev/sdb1       /media/camera auto    rw,user,noauto  0 0
  /dev/sdc1       /media/flash  auto    defaults,user,noauto 0 0

Then any user can mount, for example, /media/hpcard, when a memory card has been inserted into the card reader. A problem is that unless the camera is connected before the flash drive after a reboot, the mappings end up being reversed! A solution is to use udev as described in Chapter 61.

The devices look like any other hard drive device so you can run fdisk on it and reorganise partitions:

  # fdisk /dev/sdc

You can also format the partition(s) on the device, usually with a DOS/FAT filesystem:

  $ mkfs -t vfat /dev/sdc1


Subsections

Copyright © 1995-2006 [email protected]

 
 
  Published under the terms fo the GNU General Public License Design by Interspire