LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-28-2004, 11:22 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
usb pen drive - only root can write?


I have a USB pen drive that I use quite a lot, but I can only mount, unmount & write to it as root.

I mount & unmount from the command line like this:

mount -t msdos /dev/sda1 /mnt/usbhd -o fat=32

(I use it with windows machines too)

Are there other options I can use so that users other than root can mount and/or write to it?

I had an entry in my /etc/fstab but took it out because the machine wasn't happy if the drive wasn't in place when it shut down.
 
Old 01-28-2004, 11:26 PM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Have you tried to give write permission to everyone? chmod a+w /dev/sda1 ? I am not sure if this will allow you to mount it as well... but I am pretty sure it will allow everyone to write to it.
 
Old 01-29-2004, 12:43 AM   #3
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
Not sure if this will work, but when moutning, try give the option

-o umask=000

Taking a stab in the dark here though, read through the umask man page to see what I'm on about.

Cheers.
 
Old 01-29-2004, 12:50 AM   #4
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Your mount command is wrong. You should use
mount -t vfat -o sync,users,umask=000 /dev/sda1 /mnt/usbhd

The umask will let any user write to the drive. sync will make sure the data is writen to the medium instead writing to memory. users lets all users un-mount the medium. vfat is fat32.

If you want LINUX to automatically mount your USB medium you have to use hotplug and tweak the script. hotplug is just a bash script to detect USB devices and mount them to your wishes. I suggest you do not add an entry fstab for USB devices because LINUX names each USB device and it will not be the same every time you insert a USB device. Sometimes you may put a USB hard drive first and it will work how you want it when you add the pen drive.

If you want to put an entry in your fstab and forget how it looks in the /mnt directory.
/dev/sda1 /mnt/usbhd users,noauto,sync,umask=000 0 0

Then all you need to do when you insert the USB pen drive, type mount /mnt/usbhd to mount it and umount /mnt/usbhd to un-mount it.
 
  


Reply



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
Non-root write access to a USB drive (ext2) ?? jmborr Linux - Hardware 4 10-17-2005 02:38 PM
MDK 10.x - Mount USB Pen OK, But no permission to write Xolo Linux - Software 2 05-20-2005 05:19 AM
read & write USB pen drive?? wrangler Linux - Newbie 5 03-08-2005 03:11 PM
usb pen drive, it wont let me write to it Mandrake 10 Whiskers Mandriva 9 08-22-2004 02:15 PM
External USB drive -- only WRITE as root 1kyle Linux - Hardware 0 08-03-2004 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:06 PM.

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