LinuxQuestions.org
Visit Jeremy's Blog.
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-17-2004, 08:25 AM   #1
yotamk
Member
 
Registered: Nov 2004
Location: ~
Distribution: Debian
Posts: 145

Rep: Reputation: 15
How to mount usb stick


On Debian sarge, kernel 2.6.8 with hotplug,

how do I mount my usb?
Is it automatically mounted and where?
If not, is there a way for me to have it automatically mounted?

I need access to my usb stick (disc-on-key) badly

Thanks.
 
Old 11-17-2004, 10:16 AM   #2
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Ċrhus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 588

Rep: Reputation: 45
Hi,

1) make sure you have a line like

/dev/sda1 /mnt/usb vfat noauto,user,fmask=133,dmask=022 0 0

in your /etc/fstab.

2) mount it:

$ mount /mnt/usb

3) If it is not formatted, use

# fdisk /dev/hda

delete what is there before and make a new partition. Format it

# mkfs -t vfat /dev/hda1

(I am not completely sure about command syntax, check it).

best,

Ott
 
Old 11-17-2004, 02:10 PM   #3
yotamk
Member
 
Registered: Nov 2004
Location: ~
Distribution: Debian
Posts: 145

Original Poster
Rep: Reputation: 15
Thanks
 
Old 11-18-2004, 05:37 AM   #4
yotamk
Member
 
Registered: Nov 2004
Location: ~
Distribution: Debian
Posts: 145

Original Poster
Rep: Reputation: 15
OK, I can now mount usb successfully, but how do I get it to auto-detect my disc-on-key and mount it automatically when plugged in?

in fstab I've changed noauto to auto in the usb line, but this doesn't seems to do the trick...
 
Old 11-18-2004, 11:01 AM   #5
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Rep: Reputation: 31
Quote:
Originally posted by yotamk
OK, I can now mount usb successfully, but how do I get it to auto-detect my disc-on-key and mount it automatically when plugged in?

in fstab I've changed noauto to auto in the usb line, but this doesn't seems to do the trick...
If you changed fstab, then it should do the trick, but in order for fstab settings to take effect you have to restart the computer.

My fstab looks like this:
/dev/sda1 /mnt/usb auto rw,user,noauto 0 0

and the stick gets mounted when I open the /mnt/usb folder (just like a floppy).


You probably don't want to change the noauto to auto, because that will try to mount on boot (I think)--you don't want that. Just put a line like mine or the other one above and the stick will mount when you open the folder.

I'm I'm using Fluxbox and Rox-filer on Debian Sarge with 2.6.8, so this might make some difference.
 
Old 11-19-2004, 11:51 AM   #6
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Quote:
My fstab looks like this:
/dev/sda1 /mnt/usb auto rw,user,noauto 0 0

and the stick gets mounted when I open the /mnt/usb folder (just like a floppy).
I haven't used Rox-filer but it's a neat trick if it can mount filesystems when accessing folders that are mentioned in fstab. However, as I see it, the problem is not as much in the mounting of devices as it is in unmounting them. You see, the Linux kernel doesn't necessarily write changes immediately when you move files between hard disk and removable media, so if you remove your floppy or usb-stick before properly unmounting them you may lose data.

Personally I'm not into automounting. I've installed xvmount and assigned an appicon (that is, a quick launch icon) for it in WindowMaker. (xvmount is a GUI tool that allows you to mount devices mentioned in fstab with one click and unmount them with another click.) Now, whenever I need to access a cdrom, floppy, or usb-stick, I launch xvmount and click on the xvmount button for the device I wish to mount. Then I leave xvmount open in the background so that I can tell with just one look if there are any unmounted devices. With automount systems you can never be sure if they work as expected but using xvmount I can make sure that all data has been transferred before I remove cdrom/floppy/usb-stick.

An alternative way would be to use MToolsFM (provided you use vfat formatted floppies/usb-sticks), as I describe in this thread: http://www.linuxquestions.org/questi...hreadid=250852
Using MToolsFM you don't need to mount devices and, hence, there's no fear of losing data when you remove floppy or usb-stick.

Last edited by Dead Parrot; 11-19-2004 at 11:21 PM.
 
Old 11-21-2004, 12:46 AM   #7
yotamk
Member
 
Registered: Nov 2004
Location: ~
Distribution: Debian
Posts: 145

Original Poster
Rep: Reputation: 15
Thanks, I'll check it...
 
  


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
How do I mount a USB Stick on FC3? ai.user Fedora 6 09-09-2005 02:03 PM
Unable to mount the USB Stick reply2vinay Linux - Hardware 2 08-24-2005 11:21 AM
mount/umount usb stick - PQI Intelligent Stick 2.0 sandbag Linux - Software 5 05-06-2005 11:12 AM
usb memory stick mount nadroj Linux - Hardware 10 01-13-2005 10:41 PM
Mount USB stick in Mandrake 9.2 Liakoni Mandriva 13 03-15-2004 03:16 PM


All times are GMT -5. The time now is 08:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration