LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-03-2004, 09:14 PM   #1
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Rep: Reputation: 15
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

Last edited by talkingwires; 11-03-2004 at 09:20 PM.
 
Old 11-04-2004, 10:55 AM   #2
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Original Poster
Rep: Reputation: 15
Bump?
 
Old 11-05-2004, 11:33 PM   #3
kurrupt
Member
 
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
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


i hope i was some help
 
Old 11-06-2004, 10:11 AM   #4
chemist109
LQ Newbie
 
Registered: Nov 2002
Location: Mississippi Gulf Coast, USA
Distribution: Fedora Core 2, Debian unstable, Kubuntu, Mepis
Posts: 15

Rep: Reputation: 0
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.
 
Old 11-06-2004, 10:13 PM   #5
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 11-06-2004, 10:17 PM   #6
kurrupt
Member
 
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
are u trying to unmount it while your IN the flash drive? because it will give u that error if u are
 
Old 11-06-2004, 10:23 PM   #7
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 11-06-2004, 10:26 PM   #8
kurrupt
Member
 
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
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
 
Old 11-06-2004, 10:46 PM   #9
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Original Poster
Rep: Reputation: 15
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?
 
Old 11-06-2004, 10:49 PM   #10
kurrupt
Member
 
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
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?
 
Old 11-06-2004, 11:04 PM   #11
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 11-06-2004, 11:12 PM   #12
kurrupt
Member
 
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
ok hmm.. i havent done this in a while because i dont like things to auto mount and auto pop up 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
 
Old 11-07-2004, 12:44 AM   #13
talkingwires
Member
 
Registered: Jan 2004
Location: Boone, NC
Distribution: Debian SID
Posts: 49

Original Poster
Rep: Reputation: 15
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?
 
Old 11-07-2004, 12:15 PM   #14
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usb flash drives Mandrake 10.0 kostial Mandriva 2 06-19-2005 07:50 PM
Slackware 10.1 + Udev Permissions and USB Drives rignes Slackware 3 03-07-2005 09:12 PM
Give user permission to mount/use cdrom drives or usb drives zwyrbla Linux - Newbie 2 08-23-2004 04:30 PM
USB Flash Drives Last Attacker Linux - Hardware 3 06-11-2004 03:36 PM
More trouble with certain usb flash drives... Jeeper Linux - Hardware 2 04-01-2004 12:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration