LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-21-2006, 08:32 AM   #1
andrew_cz
LQ Newbie
 
Registered: May 2006
Distribution: Cygwin
Posts: 10

Rep: Reputation: 0
Non-root users unable to write to auto mounted usb drive.


I've recently installed SuSE 10.1. I've a couple of issues...

1) When I insert my Kingmax 1GB usb drive, SuSE automounts it to /media/usbstick. However, only root is able to write to it. I'm forced to chown the drive to the user that wants to use it instead. Is there a way to make suse automount and allow write to the stick for nonroot users?

2) I don't know if this is a bug or not but I would think it is...when I try to mount it upon boot time in /etc/fstab I noticed dmesg reports that no /dev/sda1 special drive was found...however, a few lines later it detects the drive but it's not automounted (shouldn't the drive be detected before reading /etc/fstab?). So I have to remove the drive and reinsert it so that SuSE automounts it to /media/usbstick.
I'd like it automounted to /mnt/usb instead with write access to nonroot users at boot time. My current workaround was to add this to /etc/rc.d/rc:

mount /dev/sda /mnt/usb
chown username /mnt/usb

I'm sure there's a cleaner and/or more proper way of doing it.

Andrew.
 
Old 06-21-2006, 09:21 AM   #2
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
You can use
Code:
mount /dev/sda /mnt/usb -o gid=(GID of users group),mode=666
to mount it owned by the GID of the users group and/or use "mode=" to change the mode of the mount.
You probably can't mount it at boot though, because the proper modules need to be loaded before it maps the USB device to a pseudo SCSI device. You could add "noauto,users,rw" to fstab to stop it trying to mount at boot and alow users to mount and write.
 
Old 06-21-2006, 10:25 AM   #3
andrew_cz
LQ Newbie
 
Registered: May 2006
Distribution: Cygwin
Posts: 10

Original Poster
Rep: Reputation: 0
I think you meant sda1 instead of sda. I tried a similar command without using mode=666 and that didn't work. Unfortunately your code doesn't work either as it returns a long message...to make it brief:

mount: wrong fs type, bad option, bad superblock on /dev/sda1

So I tried these instead:

mount -t auto /dev/sda1 /mnt/usb -o gid=100,mode=666

mount -t ext3 /dev/sda1 /mnt/usb -o gid=100,mode=666

But that just returned the same message. I tried using just sda instead of sda1 as you suggested but same error message.

Any other ideas? Anyone?
 
Old 06-21-2006, 10:33 AM   #4
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
Quote:
mount: wrong fs type, bad option, bad superblock on /dev/sda1
This usually means that there is something wrong with the filesystem on the device. Maybe it's corrupt somehow

Can you mount the USB stick at all?
If not you may have to use (c)fdisk to check the partition table.
And maybe mkfs to reformat it.
 
Old 06-21-2006, 01:12 PM   #5
andrew_cz
LQ Newbie
 
Registered: May 2006
Distribution: Cygwin
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by binary_y2k2
This usually means that there is something wrong with the filesystem on the device. Maybe it's corrupt somehow

Can you mount the USB stick at all?
If not you may have to use (c)fdisk to check the partition table.
And maybe mkfs to reformat it.
Mounting it is no problem and all files are readable/writeable.

I found the answer though just prior to finding your reply. I backed up my usb drive and repartitioned it using cfdisk and formatting it as dos (fat32). I then followed the rest of the article just like before and had no problems this time. Thanks for trying to help.

I still can't get it to auto mount the way I want it during boot without doing it manually through /etc/init.d/rc.
 
Old 06-21-2006, 05:18 PM   #6
frank golden
Member
 
Registered: Jun 2006
Location: Stevensville, Michigan, USA
Distribution: Ubuntu 6.06 LTS dual boot with XP Pro
Posts: 37

Rep: Reputation: 15
Quote:
Originally Posted by andrew_cz
Mounting it is no problem and all files are readable/writeable.

I found the answer though just prior to finding your reply. I backed up my usb drive and repartitioned it using cfdisk and formatting it as dos (fat32). I then followed the rest of the article just like before and had no problems this time. Thanks for trying to help.

I still can't get it to auto mount the way I want it during boot without doing it manually through /etc/init.d/rc.
You must have had it NTFS.
 
Old 06-24-2006, 12:47 PM   #7
andrew_cz
LQ Newbie
 
Registered: May 2006
Distribution: Cygwin
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by frank golden
You must have had it NTFS.
Definitely not. It was FAT16 but it must've been corrupted.
 
  


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
Unable to mount AND write to USB jump drive TimmerKahuna Linux - Hardware 5 08-13-2006 01:31 PM
FireWire/USB-drive (Maxtor) - works mounted as root only. fstab included... -=TRA=- Linux - Hardware 4 04-17-2006 04:17 AM
how come usb flash drive doesn't get auto mounted? darkhatter Fedora 5 02-26-2006 08:04 PM
Unable to write to external USB drive m_lp_ql_m Linux - Newbie 2 08-29-2005 03:21 PM
usb pen drive - only root can write? BrianK Linux - Newbie 3 01-29-2004 12:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:14 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