[wellylug] USB flash disk

Pete Black pete at marchingcubes.com
Mon Nov 29 08:08:32 NZDT 2004


This depends on your distribution.

All USB disks are treated as SCSI devices using the 'ide-scsi' driver.

other drivers which must be loaded for usb storage devices to function 
are 'usb-storage', and your usb host controller driver (uchi/ohci/ehci)

On a modern distro such as Fedora, Mandrake, Ubuntu or SuSE, these 
drivers should all be preloaded, and plugging in the disk should at the 
very least yield a message in the syslog (type 'dmesg' to view this 
output) showing a new USB device connected and a /dev/sdX assignment. 
(/dev/usbX is not a scheme I have come across before), and usually the 
distro would automount the drive and present an icon on the desktop.

If this doesn't happen, your strategy should be:

check dmesg - if the device has been assigned a /dev/sdX node e.g. 
/dev/sda, you can mount the (likely vfat) partition with:

mount -t vfat /dev/sda1 /mnt/myUSBDisk

make sure you have created the /mnt/myUSBDisk directory, or use any 
'empty' directory you like - there may already be a /mnt/usb or 
similar.

this should give you the contents of your usb disk when you do a 'cd 
/mnt/myUSBDisk; ls -l'

if dmesg shows no device assignment, make sure your drivers are loaded 
e.g.

(as root)

modprobe usb-storage
modprobe ide-scsi
modprobe vfat

and then unplug/replug the device and check 'dmesg' for details.

once you can see a device node assignment in dmesg, substitute the 
/dev/sdX node assigned into the mount command above.

This situation is rather half-baked on linux at the moment, and I would 
really recommend a modern distro that uses udev and 
gnome-volume-manager or similar to handle removable devices - this 
changes the way all device handling is done (Not enough space to go 
into it here) but pretty much means you never have to think about 
manually futzing around with it.

There are also added complications like the latest versions of debian 
kernels having broken VFAT support - they will need to be recompiled 
with codepages added to the config before you can mount a 
VFAT-formatted disk, so the support for this actually working properly 
across-distros can be inconsistent.

Contact me off list if you can't get it sussed and i would be happy to 
give you further help.

-Pete





On 29/11/2004, at 7:43 AM, Mark Signal wrote:

> oh well  - live and learn ..
>
> Jethro Carr wrote:
>
>> On Mon, 2004-11-29 at 20:33, Mark Signal wrote:
>>
>>> I may be completely off track but I thought usb drives where treated 
>>> as /dev/sda1  /dev/sda2 etc.
>>>
>>
>> not for me, that's my SATA hard disk. :-)
>>
>>
>>
>>
>>> I have had a lot of problems with usb 2 on 2.4 kernels and no 
>>> problems at all on 2.6 kernels
>>>
>>> hope this helps
>>>
>>> (someone jump in and correct me if I'm wrong here please)
>>>
>>> cheers
>>>
>>> Mark Signal
>>>
>>> Steven Mulvay wrote:
>>>
>>>
>>>> Hi all, how are you?
>>>> How do I mount a usb flash disk under Linux? Will I need to obtain 
>>>> a driver for it first? How do I know what each of my usb ports are 
>>>> named as on my system? (eg what should I write for the /dev/ 
>>>> section of the mount command) Unfortunately my ability to solve 
>>>> many problems hinges on whether or not I can successfully mount and 
>>>> write to a flash disk. Thank you very much for your time.
>>>> Cheers,
>>>> Steve
>>>>
>
>
> -- 
> Wellington Linux Users Group Mailing List: 
> wellylug at lists.wellylug.org.nz
> To Leave:  http://lists.wellylug.org.nz/mailman/listinfo/wellylug




More information about the wellylug mailing list