LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   udev, USB Flash Drives, and usb-mount (http://www.linuxquestions.org/questions/debian-26/udev-usb-flash-drives-and-usb-mount-250852/)

talkingwires 11-03-2004 09:14 PM

udev, USB Flash Drives, and usb-mount
 
I've been trying to get Debian to automatically recognize and mount my USB flash drive (aka thumb drive aka usb stick). I tried following the instructions at http://www.xs4all.nl/~bsamwel/usb_st...n_debian.html, but haven't had much luck. I also tried downloading the help?usb-mount package, but it doesn't contain any binary files (?!). To top it off, my Nvidia kernel module has died and plugging in the USB flash drive now locks up my USB mouse. Any

talkingwires 11-04-2004 10:55 AM

Bump?

kurrupt 11-05-2004 11:33 PM

ok first off.. make sure u have the "usb-storage" module compiled because thats what reads the flash fisks file system


then add these lines in your fstab:

..u can make the mount point what u want for the usb stick.. in my case i have it as "/usbstick"




# <file system> <mount point> <type> <options> <dump> <pass>
/dev/hda2 / reiserfs defaults 0 0
/dev/hda1 none swap sw 0 0
proc /proc proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs noauto,user 0 0 <------- Add this line
/dev/fd0 /floppy auto user,noauto 0 0
/dev/hdb /cdrom iso9660 ro,user,noauto 0 0
/dev/hdc /cdrw iso9660 rw,user,noauto 0 0
/dev/hdd /dvdrw iso9660 rw,user,noauto 0 0
/dev/sda1 /usbstick auto user,noauto 0 0 <------ add this line


then add this line in your /etc/modules ..

usb-storage


this will load it in startup



now u should be able to mount your usb stick with no problems :D


i hope i was some help

chemist109 11-06-2004 10:11 AM

talkingwires,

I had the same problem with udev killing my nvidia driver. (I surmise that it removes the nvidia /dev entries). I had to run as root:

apt-get remove udev

and then run the nvidia installer again. After that the x server came up like before.

talkingwires 11-06-2004 10:13 PM

No, I was able to mount it just fine by adding it the lines to my /etc/fstab file. What I'm looking to do is to plug the USB stick in, and have it automatically mount, a la Windows, OS X, and even Linux distros like SuSE. I don't want to be limited to just one mount point, or have to create more fstab entries if I plug a digital camera in too.

But if nobody out there knows how to do this, can someone please tell me how to unmount the USB stick? Using umount doesn't work (it whines about the drive still being in use) and if I just unplug it, I lose data.

As for the Nvidia situation, I went in and changed my driver in my XFREE86-Config file to the generic one. Since then, I've deleted udev, since it was causing more harm than good.

kurrupt 11-06-2004 10:17 PM

are u trying to unmount it while your IN the flash drive? because it will give u that error if u are

talkingwires 11-06-2004 10:23 PM

I'm not sure what you mean by "in the flash drive". I'm not writing to it when I try to unmount it, and whether I'm viewing the contents or not shouldn't make a difference. But for the record, I closed all programs (and logged out and back in) and still couldn't unmount it. I ended up yanking it out only to have zero-byte files for the last few I'd put on the drive.

kurrupt 11-06-2004 10:26 PM

what u mean is like are u in the flash drive while u are typing umount

eg: /home/yournick/myflashdrive/


if your typing the unmount command while your viewing your flashdrive contents.. it wont work

talkingwires 11-06-2004 10:46 PM

Heh. Whoops. I just tried mounting/unmounting it while in /home and it worked. Thanks! :)

I don't suppose you can help me with solving the automount/one-click-unmount problem, could you?

kurrupt 11-06-2004 10:49 PM

haha np man


ya i can help u..its really not that hard.. i dont have it on mine because i dont really use a gui interface

but first off what interface are u using.. kde or gnome?

talkingwires 11-06-2004 11:04 PM

I'm using Gnome 2.8.

I just installed sudo and whipped up two Nautilus scripts that looks like this:
Code:

#!/bin/bash

sudo modprobe usb-storage
sudo mount /media/usbdrive

and
Code:

#!/bin/bash

sudo umount /media/usbdrive

.
That works, but it's not automated and it's still locked to one entry in my /etc/fstab file.

kurrupt 11-06-2004 11:12 PM

ok hmm.. i havent done this in a while because i dont like things to auto mount and auto pop up :D lol i like to make decisions

but iam pretty sure this will make it do it

edit the line in your /etc/fstab to:

/dev/sda1 /usbstick auto user, auto 0 0 <--- this will automatically mount it upon startup

u had "noauto" which u had to mount manually


i hope this may help

talkingwires 11-07-2004 12:44 AM

Alrighty, that seems to work pretty well. The USB stick isn't mounted until I try to access it. But it automounts as soon as I do and an icon pops up on my desktop. But the permanent entry in my fstab file (and resulting listing under my available drives, even if it isn't plugged in) still kinda bugs me. I don't suppose you know a way get it to set all that up automatically when any USB device is plugged in, do you?

Dead Parrot 11-07-2004 12:15 PM

Using usb-stick via MToolsFM
 
I use both floppies and usb-stick to back up the data in my home directory but I have chosen a very different approach -- I prefer XFCE4, Window Maker, and IceWM to Gnome and I use MToolsFM to access my vfat formatted floppies & usb-stick. MToolsFM is a simple GUI filemanager that can deal with all vfat formatted media without mounting them, using the "mtools" utility. You'll probably want to continue accessing removable media the Gnome way, but here is how I prefer to do it:

1) First I installed MToolsFM (apt-get install mtoolsfm).
2) Next I added myself to the "disk" group (adduser my_username disk) so that I can access /dev/sda1 as normal user.
3) Then I launched MToolsFM as normal user and chose "Options -> Configure MToolsFM -> drives 'ac' -> OK", which wrote ~/.mtoolsfm file into my home directory. (I had checked before that there's a line in /etc/mtools.conf that assigns drive c: to /dev/sda1.)
4) OK, now I can access my vfat formatted floppies and usb-stick via MToolsFM without actually mounting them. I just stick a floppy to the floppy drive or a usb-stick to the usb port, and then I launch MToolsFM, which makes it very easy to copy files to and fro between removable media and my home directory.

If you've got a vfat formatted partition, it's probably also possible to access this partition via MToolsFM without mounting it. You just need to edit /etc/mtools.conf so that mtools can assign a drive letter for your vfat partition.


All times are GMT -5. The time now is 11:07 PM.