LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-10-2007, 06:58 PM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
must be superuser to use mount


I'm having problems mounting my ipod as a normal user. I can mount it fine as root.

my fstab

/dev/sda2 /mnt/ipod vfat noauto,rw,users 0 0


* I've tried user and users, same error.

fdisk -l


Disk /dev/sda: 20.0 GB, 20000010240 bytes
255 heads, 63 sectors/track, 2431 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 0 Empty
/dev/sda2 6 2431 19486845 b W95 FAT32


which mount
/sbin/mount

ls -l /sbin/mount
lrwxrwxrwx 1 root root 10 2006-05-20 17:40 /sbin/mount -> /bin/mount*

ls -l /bin/mount
-rwxrwxrwx 1 root bin 60576 2006-02-27 19:17 /bin/mount*



works as root:

mount /dev/sda2
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 37G 15G 21G 42% /
/dev/sda2 19G 379M 19G 2% /mnt/ipod


does not work as me:

mount /dev/sda2
mount: must be superuser to use mount


This is driving me nuts. Any suggestions?
 
Old 10-10-2007, 07:07 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
What are the permissions on the /mnt/ipod directory?
 
Old 10-10-2007, 07:10 PM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
ahhh sorry, I knew I was forgetting something

drwxr-xr-x 3 "my user name" root 4096 2006-09-08 19:14 ipod


I changed my actual user ID with "my user name" above



Ok I changed the permissions to below and tried again

drwxrwxrwx 3 "my user name" root 4096 2006-09-08 19:14 ipod



mount /dev/sda2
mount: must be superuser to use mount
 
Old 10-10-2007, 07:16 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
The manpage for mount says fstab needs to be "user" not "users". Maybe that will help?
 
Old 10-10-2007, 07:52 PM   #5
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
I've tried user and users with the same result.
 
Old 10-11-2007, 02:31 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Check that you are a member of the users group, and change the group of /mnt/ipod to users.
 
Old 10-11-2007, 03:05 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Use the "user" and "uid=" options.
/dev/sda2 /mnt/ipod vfat noauto,rw,user,uid=ncsuapex 0 0

Last edited by jschiwal; 10-11-2007 at 03:08 AM.
 
Old 10-11-2007, 10:19 AM   #8
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
^,^^

Did both of those and still get the error:



mount /mnt/ipod
mount: must be superuser to use mount


mount -t vfat /dev/sda2 /mnt/ipod
mount: must be superuser to use mount

mount /dev/sda2
mount: must be superuser to use mount



Is there a setting somewhere that I need to change to let normal users use the mount command?




EDIT: Is the mount command supposed to be in 2 locations?


ls -al /bin/mount
-rwxrwxrwx 1 root bin 60576 2006-02-27 19:17 /bin/mount*

ls -al /sbin/mount
lrwxrwxrwx 1 root root 10 2006-05-20 17:40 /sbin/mount -> /bin/mount*

/bin/mount /dev/sda2
mount: must be superuser to use mount

/sbin/mount /dev/sda2
mount: must be superuser to use mount

Last edited by ncsuapex; 10-11-2007 at 11:46 AM. Reason: .
 
Old 10-11-2007, 06:57 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Could you post your /etc/fstab entry.

I would also recommend using either "UUID=" or "LABEL=" in place of the device name. When you plug in the i-pod, it may be given a different device.

I've used the user,noauto & uid options and have been able to enter a mount command as a normal user to mount an external (vfat) usb drive. I've also used the user & noauto options for an XFS formatted external drive (uid isn't an option here). I always use either LABEL= or UUID= instead of a device node like /dev/sdb1. Since the xfs drive is usually connected, I even have the mount command in the my .profile script.

Check if your mount program has the "SUID" bit set. How this all works, is that the mount command is run as root due to the SUID permission bit. The mount program then checks the permissions of the filesystem and the contents of /etc/fstab to determine whether to allow that user to mount the filesystem. Some filesystems like vfat and ntfs have the ownership set in the /etc/fstab entry instead of on the filesystem. In that case, you need a UID= entry and have read permissions with the fmask and dmask settings to be able to mount the drive and use it.

Also look at your mount command:
Code:
ldd /bin/mount
        libvolume_id.so.0 => /lib64/libvolume_id.so.0 (0x00002aedcd6a4000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aedcd8ae000)
I don't see anything like libpam that might be involved with further restrictions.
---

Does your version of slackware use udev. If so you can get the label or uuid number easily using udevinfo:
udevinfo -q env -n sda2

Last edited by jschiwal; 10-11-2007 at 07:04 PM.
 
Old 10-11-2007, 07:48 PM   #10
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
cat /etc/fstab

/dev/hda1 / ext2
ext2 defaults 1 1
/dev2/hdc /mnt/cdrom iso9660 noauto,user,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0


/dev/sda1 /mnt/usb vfat noauto,user,rw 0 0

/dev/sbd2 /mnt/ipod vfat noauto,user,rw 0 0

/dev/sda2 /mnt/ipod vfat noauto,rw,users 0 0
/dev/sdb1 /mnt/usb1 vfat noauto,rw,users 0 0




I have multiple entries for the sda devices as I was playing around with different settings.


ldd /bin/mount
linux-gate.so.1 => (0xffffe000)
libblkid.so.1 => /lib/libblkid.so.1 (0xb7f4e000)
libuuid.so.1 => /lib/libuuid.so.1 (0xb7f4b000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e1c000)
/lib/ld-linux.so.2 (0xb7f73000)



# udevinfo -q env -n sda2
no record for 'sda2' in database


I also did something I should have done earlier, I tried to mount a USB flash drive as my user, got the same error




EDIT:
ls -l /mnt

drwxrwxrwx 3 myusername users 4096 2006-09-08 19:14 ipod/

Last edited by ncsuapex; 10-11-2007 at 08:04 PM. Reason: .
 
Old 10-12-2007, 10:45 AM   #11
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
Not sure if this is needed but here is my dmesg from when I plug the Ipod in



ieee1394: Node changed: 0-00:1023 -> 0-01:1023
scsi2 : SCSI emulation for IEEE-1394 SBP-2 Devices
ieee1394: sbp2: Logged into SBP-2 device
ieee1394: Node 0-00:1023: Max speed [S400] - Max payload [2048]
Vendor: Apple Model: iPod Rev: 1.33
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 39062520 512-byte hdwr sectors (20000 MB)
sda: test WP failed, assume Write Enabled
sda: asking for cache data failed
sda: assuming drive cache: write through
SCSI device sda: 39062520 512-byte hdwr sectors (20000 MB)
sda: test WP failed, assume Write Enabled
sda: asking for cache data failed
sda: assuming drive cache: write through
sda: sda1 sda2
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
 
Old 10-13-2007, 04:23 AM   #12
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by ncsuapex View Post
EDIT: Is the mount command supposed to be in 2 locations?


ls -al /bin/mount
-rwxrwxrwx 1 root bin 60576 2006-02-27 19:17 /bin/mount*

ls -al /sbin/mount
lrwxrwxrwx 1 root root 10 2006-05-20 17:40 /sbin/mount -> /bin/mount*
mount is only in one directory, /bin. A symbolic link (it's like a shortcut) to /bin/mount is in /sbin.
 
Old 10-14-2007, 09:00 AM   #13
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Hello,

Try changing your fstab entry to:

Code:
/dev/sda2  /mnt/ipod   auto   noauto,user,rw 0 0
and then enter the command:

Code:
mount /dev/sda2
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
About su superuser fw12 Linux - General 3 08-14-2007 02:23 PM
Superuser sakuya84 Linux - Security 2 07-15-2007 09:56 PM
Superuser CJ_Grobler Linux - Newbie 7 06-13-2005 09:35 PM
Superuser for Mount? Jskill007 Slackware 5 08-29-2004 10:53 PM
Must be superuser to use mount... fstab is correct, however. dokterneo Slackware 8 02-11-2004 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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