Sunday, January 09, 2005

USB flash drives and Linux

I've had to set up a USB stick with Linux recently. It's fairly easy if you know the right magic.

Here are some links to useful resources:

Post on ExtremeTech.com
Flash memory HOWTO on ibiblio

Essentially it boils down to adding a line to /etc/fstab and then mounting /dev/sda1 or /dev/sdb1 on some mount point (directory). You don't strictly need to edit /etc/fstab, but if you don't you will need to be root in order to write anything on it. Here's the magic for /etc/fstab to allow non-root to get read/write access:
/dev/sda1 /mnt/usbstick vfat        rw,user,noauto 0 0

(assuming your mount point is /mnt/usbstick.)

If that doesn't work, check /var/log/messages and see if your stick is on /dev/sdb1 instead.

I'm looking forward to it being as easy to use USB sticks under a default Linux distro as it is under Windows, though. I hate to say it, but under Windows, they "just work."

2 comments:

Anonymous said...

Every recent distibution use udev for managing hotplug device.

Personaly i'm under gentoo with kde and ivman, hal, udev.

I can hotplug my usb mass storage device very easly. When i plug it, the device appear on my desktop ;)

Anonymous said...

Hi Bill Schneider, Out surfing for information on boils & happened upon your site. While USB flash drives and Linux wasn't exactly spot on, it did strike a note with me. Thank you for the really good read.