Friday, May 23, 2008

usb disk under Linux

Some information for my usb pen (actually the most useful part is in the end):

1. Log in as "root"

2. Plug in the Data Traveler

3. Open a terminal window

4. Type "mkdir /mnt/flash" and press enter. This creates the directory
for the Data Traveler. Please note, you will need a separate directory
for each USB device mounting simultaneously. You can not mount two USB
drives to the same directory in /mnt.

5. Now edit the "fstab" file. To do this, type emacs /etc/fstab and
press enter.

6. Add the line "/dev/sda1 /mnt/flash vfat user,noauto,umask=0 0 0" and
save the file. Please note the spaces. It is very important that you add
the line exactly as you see it.

7. Type "mount /mnt/flash". An icon will appear on the desktop for the
drive. To remove the device, right click and select "unmount volume".
You can also unmount the drive by typing "umount /mnt/flash". Please
be certain to unmount the drive before unplugging it. If this does not
work, type umount /mnt/flash –l and press enter. Always unmount
the drive before unplugging it.

8. From this point on, you will only need to implement step #7 in order
to mount the Data Traveler.

If this fails, you may not have the USB storage module loaded. Type
"modprobe usb-storage" then press enter. This loads the module for usb
storage devices.

Also check to see if the Data Traveler is seen as "sda1". If you have
other USB devices loaded on your system the Data Traveler may have been
given a different name, example- "sdb1". To check this, open a
terminal and type "fdisk -l". This will list the labels for all of the
partitions and it will also list a description of each drive and
partition. If need be, please change "sda1" accordingly.

If you want to format the drive, unmount the drive. You cannot format
while drive is mounted. Then at terminal prompt type mkfs.vfat /dev/sda1
or whatever the system sees the drive as (i.e. sdb1). This will format
it as FAT16. You can also use this to format it for linux native format.
Just change the command to mkfs.ext2 /dev/sda1

No comments: