Can't get USB memory stick to work
'Forum Post
ulist at gs1.ubuntuforums.org
Tue Dec 20 07:11:16 UTC 2005
The reason it defaults to root permissions is because the OS doesn't
know who is the owner of the device. This is a major difference
between WinXP and Linux (or Unix in general). In XP, you can have many
users logged in to the system, but as far as I know, only one user
actually using it at a time. In Unix, you can have many users logged
in -and- simultaneously using the system. So in Windows, the OS knows
it's your device because you're the one with control of the machine,
but Linux can't assume that. I seems to me like the harder thing to do
is allow multiple simultaneous users, and it should be possible to have
the best of both worlds if Linux had a good mechanism for detecting
hardware like USB drives. I can't tell you how many times I've wanted
to log into a Windows machine along side someone else.
I'm not sure how to set this up the Ubuntu way, but I know enough to do
it the disto-agnostic way. First figure out what the device name is.
Code:
--------------------
tail -s 3 -f /var/log/messages
--------------------
Plug the drive in and you should see a bunch of stuff with /dev/sdb or
similar. Mine says > Dec 20 00:56:14 localhost kernel: [5630424.253000] usb 4-2: new full
> speed USB device using uhci_hcd and address 2
> Dec 20 00:56:15 localhost kernel: [5630425.507000] Initializing USB
> Mass Storage driver...
> Dec 20 00:56:16 localhost kernel: [5630425.514000] scsi2 : SCSI
> emulation for USB Mass Storage devices
> Dec 20 00:56:16 localhost kernel: [5630425.527000] usbcore: registered
> new driver usb-storage
> Dec 20 00:56:16 localhost kernel: [5630425.527000] USB Mass Storage
> support registered.
> Dec 20 00:56:16 localhost usb.agent[14386]: usb-storage: loaded
> successfully
> Dec 20 00:56:21 localhost kernel: [5630430.530000] Vendor: 256MB
> Model: HardDrive Rev: 1.88
> Dec 20 00:56:21 localhost kernel: [5630430.530000] Type:
> Direct-Access ANSI SCSI revision: 02
> Dec 20 00:56:21 localhost kernel: [5630430.969000] SCSI device sdb:
> 512000 512-byte hdwr sectors (262 MB)
> Dec 20 00:56:21 localhost kernel: [5630430.972000] sdb: Write Protect
> is off
> Dec 20 00:56:21 localhost kernel: [5630430.985000] SCSI device sdb:
> 512000 512-byte hdwr sectors (262 MB)
> Dec 20 00:56:21 localhost kernel: [5630430.988000] sdb: Write Protect
> is off
> Dec 20 00:56:21 localhost kernel: [5630430.988000]
> /dev/scsi/host2/bus0/target0/lun0: p1
> Dec 20 00:56:21 localhost kernel: [5630430.995000] Attached scsi
> removable disk sdb at scsi2, channel 0, id 0, lun 0
> Dec 20 00:56:21 localhost scsi.agent[14454]: sd_mod: loaded
> sucessfully (for disk)
Now edit /etc/fstab so that it mounts as you. Add the line > /dev/sdb1 /media/removable vfat
> rw,user,noauto,dmask=077,fmask=177 0 0
> More info is in the mount man page
Code:
--------------------
man mount
--------------------
To mount the drive,
Code:
--------------------
mount /media/removable
--------------------
To unmount
Code:
--------------------
umount /media/removable
--------------------
You could put a script on your desktop or a menu entry to do the
mount/unmount with the mouse.
There's probably an easier, Ubuntu way to do this, but I don't know it.
--
jpkotta
More information about the ubuntu-users
mailing list