LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 09-18-2008, 03:45 PM   #1
flatstan
Member
 
Registered: Jul 2006
Location: London UK.
Distribution: Linux MINT, UBUNTU.
Posts: 150

Rep: Reputation: 15
Help for Mounting a USB Memory Stick in SUSE 10.3. Permission Denied.


I am running Open SUSE 10.3, I have purchased a 4GB USB Stick, it is labeled "USB DISK 2.0 Music Player" I don't know what this means as I bought it as a standard USB Stick. I edited fstab and added a line
"/dev/sdb1 /mnt/usbstick auto noauto,user,sync, 0 0"
then made a folder in mnt - usbstick, then did a "dev/sdb1 /mnt usbstick" in a console as root. I get a message " permission denied. If I try to mount the device from the desktop icon, I get the message " you are not privileged to mount volume UDISK". Can any one explain what is happening, how to get round this, what I am doing wrong. The stick works fine with windows XP. I have looked at similar theads but non have helped.
Thanks.
 
Old 09-18-2008, 11:10 PM   #2
leandean
Member
 
Registered: Oct 2005
Location: Burley, WA
Distribution: Sabayon, Debian
Posts: 278

Rep: Reputation: Disabled
10.3 is usually pretty good at auto mounting usb sticks. Be that as it may, are you sure the device is sdb1?? Did you determine this via /var/log/messages?? As for your command "dev/sdb1 /mnt usbstick", I'm assuming that's a typo and you meant "mount /dev/sdb1 /mnt/usbstick". Have you checked 'My Computer' to see if it is there??
 
Old 09-18-2008, 11:34 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
For automounting to work, make sure you don't use the "noacpi" mount option. Hald and dbusd need it to run.

Follow the kernel messages if you aren't certain what the device is:
sudo tail -f /var/log/messages

If there is a problem with the filesystem you may get a /dev/sdb but not a /dev/sdb1. Also it may have been misformatted without partitioning.

Look at "sudo file -s /dev/sdb" and "sudo file -s /dev/sdb1". That will tell you if a partition is found and the filesystem.

Run "udevinfo -q env -n /dev/sdb1". Copy the UUID number. It is better to use UUID= or LABEL= in /etc/fstab instead of the device.

Here is how a pendrive automounted on my system:
Code:
/dev/sdf1 on /media/disk type vfat (rw,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower)
In SuSE whether you automount or use fstab is mutually exclusive. You could remove or comment out the /etc/fstab entry and see if automounting works.

Code:
udevinfo -q env -n /dev/sdf1
ID_VENDOR=Generic
ID_MODEL=USB_CF_Reader
ID_REVISION=1.01
ID_SERIAL=Generic_USB_CF_Reader_2004888-0:1
ID_SERIAL_SHORT=2004888
ID_TYPE=disk
ID_INSTANCE=0:1
ID_BUS=usb
ID_PATH=pci-0000:00:0b.0-usb-0:8:1.0-scsi-0:0:0:1
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_UUID_ENC=3B69-1AFD
ID_FS_LABEL=
ID_FS_LABEL_ENC=
ID_FS_LABEL_SAFE=
I would use an fstab entry like:
Code:
UUID=UUID=3B69-1AFD /mnt/usbstick vfat rw,noauto,nosuid,nodev,noatime,flush,uid=flatstan,utf8,shortname=lower,fmask=0117,dmask=007,user
Also "users" may work better than "user". Any user will be able to mount it but only the uid= and gid= owners will be able to access it. ( It just seems that I've had better luck with the users options )

Many of the options I borrowed from how a 4 GB pendrive was mounted. The "noauto, uid, gid, and user/users" optons will permit you as a regular user to mount the pendrive without needing to use sudo. Also, on this system (and only this system) you can control access. (note: I added my own private default group) You can use "fmask=0177,dmask=0077" for only owner access.
 
Old 09-22-2008, 12:40 PM   #4
flatstan
Member
 
Registered: Jul 2006
Location: London UK.
Distribution: Linux MINT, UBUNTU.
Posts: 150

Original Poster
Rep: Reputation: 15
USB Stick

Thanks people, I'll try your suggestions & get back.
 
Old 09-22-2008, 04:29 PM   #5
flatstan
Member
 
Registered: Jul 2006
Location: London UK.
Distribution: Linux MINT, UBUNTU.
Posts: 150

Original Poster
Rep: Reputation: 15
USB Stick

Thanks all, I have tried your suggestions but I still get a message
"permission denied" each time. fdisk -l shows the device as sdb1.
Why is permission denied when I am root ??????
 
Old 09-22-2008, 05:28 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
In your first post your fstab entry for the usbstick has 'auto' and 'noauto' which are conflicts. Don't know that has anything to do with mounting.

You then indicate you issued this command, in quotes I assume?
then did a "dev/sdb1 /mnt usbstick" in a console as root

That won't do anything. To mount you need the mount command:

mount -t ext3 /dev/sdb1 /mnt/usbstick. You didn't give the mount command according to your entry and you didn't have the '/' between /mnt and /usbstick.

When you try to mount using the desktop icon, are you logged in the GUI as root or are you logged in as a normal user? Switching to root in a terminal won't make you root outside the terminal.
 
Old 09-23-2008, 02:14 PM   #7
flatstan
Member
 
Registered: Jul 2006
Location: London UK.
Distribution: Linux MINT, UBUNTU.
Posts: 150

Original Poster
Rep: Reputation: 15
USB Stick

I have tried all the reply's suggestions, I have modified and also deleted the entry in fstab.
The original mount command I posted in a console was a typo, I meant mount/dev/sdb1 mnt/usbstick.
I regularly use a slave Hard Disk Drive & I use a similar entry in fstab also a similar mount command, this works perfectly.
Sorry to be a pain but I really don't understand why I always get the message "permission denied" or similar whether or not I am logged in as root or user, at boot, or by logging off then on, or whatever variation of the mount command I use, or whether or not the additional entry is in fstab. I have always thought that root has full permission to do anything & would only get an error message if anything is wrong, not be denied permission, it does not make sense.
Using "fdisk -l" the stick is shown as sdb1 & vfat.
Would you please tell me the procedure that I should be
using, step by step, in detail, for mounting the stick from the very beginning, including the entry in fstab, if it is required.
I am running Open SUSE 10.3.
When I plug in the stick either as user or root it is recognised & an icon on the desktop shows as - "USB DISK 2.0 Music Player", if I try mounting - by right click on the icon & choosing mount, or use the mount command, either as root or user, I am still denied access. As I said the stick works OK in Windows.
Thanks.
 
Old 09-24-2008, 10:24 AM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Code:
I meant mount/dev/sdb1 mnt/usbstick
Is the line above a typo? If it's not, it's not going to work. First, you need a space between 'mount' and /dev/sdb1, second you need the forward slash '/' before mnt like this: /mnt/usbstick. I would suggest entering the following as root in a terminal:

mount -t vfat /dev/sdb1 /mnt/usbstick

After doing that, navigate to the /mnt/usbstick directory to see if files are there. I'm not really familiar with usb sticks so not sure what else could be the problem.

When you right-click on your usb icon on the Desktop and select properties, what does it show for owner/users/permissions?
 
Old 09-24-2008, 10:49 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you have an explicit entry in fstab, then the pendrive won't automount. It is your choice.
Do not use a device node in /etc/fstab for an external device. The next time you insert the device and try to mount it, it may have a different node number.

Use either "UUID=" or "LABEL=".
You can get this information using the udevinfo command using the currently used node.

Here a usb key is automounted:
Code:
sudo tail -f /var/log/messages
root's password:
Sep 24 10:37:42 hpmedia kernel: sd 9:0:0:0: [sdi] 501759 512-byte hardware sectors (257 MB)
Sep 24 10:37:42 hpmedia kernel: sd 9:0:0:0: [sdi] Write Protect is off
Sep 24 10:37:42 hpmedia kernel: sd 9:0:0:0: [sdi] Mode Sense: 03 00 00 00
Sep 24 10:37:42 hpmedia kernel: sd 9:0:0:0: [sdi] Assuming drive cache: write through
Sep 24 10:37:42 hpmedia kernel:  sdi: sdi1
Sep 24 10:37:42 hpmedia kernel: sd 9:0:0:0: [sdi] Attached SCSI removable disk
Sep 24 10:37:42 hpmedia kernel: sd 9:0:0:0: Attached scsi generic sg9 type 0
Sep 24 10:37:42 hpmedia kernel: usb-storage: device scan complete
Sep 24 10:37:43 hpmedia hald: mounted /dev/sdi1 on behalf of uid 1000
The next time I insert the pendrive, I might use a different usb port, or it may be plugged in after a different usb device.
It is using /dev/sdi1 now so that is what I will use for the udevinfo -n argument:
Code:
> udevinfo -q env -n /dev/sdi1
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.2
ID_SERIAL=SanDisk_Cruzer_Mini_20051535630A02E2F57B-0:0
ID_SERIAL_SHORT=20051535630A02E2F57B
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
ID_PATH=pci-0000:00:0b.1-usb-0:7:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_UUID_ENC=3B69-1AFD
ID_FS_LABEL=CRUZER128
ID_FS_LABEL_ENC=CRUZER128
ID_FS_LABEL_SAFE=CRUZER128
If I wanted the mount point for this pendrive to be unique, I could use the UUID number. If it is for podcasts, I could relabel more then one pendrive "PODCASTS" and use the label "LABEL=PODCASTS" instead in /etc/fstab.

Here is how the pen drive was mounted:
Code:
/dev/sdi1 on /media/CRUZER128 type vfat (rw,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower)
So for this pendrive I would use an /etc/fstab entry like:
Code:
UUID=3B69-1AFD /mnt/pendrive/ vfat rw,noauto,user,nosuid,nodev,noatime,flush,uid=jschiwal,utf8,shortname=lower 0 0
The previous post about "auto rw,noauto" was not correct. The first auto was for the filesystem and the noauto in the options means something different. I used vfat for the filesystem entry in my example however. The noauto in the options field are needed to prevent a lockup when booting up without the device plugged in. The user option, which you also used allow mounting the device as a regular user. A regular user can mount the device, but due to the "uid=" entry, only that user can read it if you also use an fmask= and dmask= entry.

If doing this doesn't work, check if the filesystem on the pendrive is ok. Also check /var/log/messages for more details on why mounting failed.

Also, after inserting the device, look at the files in /dev/disk/by-uuid/ and /dev/disk/by-label and see if nodes were created.
Code:
jschiwal@hpmedia:~/Documents> ls /dev/disk/by-label -l
total 0
lrwxrwxrwx 1 root root 10 2008-09-24 10:37 CRUZER128 -> ../../sdi1
lrwxrwxrwx 1 root root 10 2008-09-20 20:30 HP_PAVILION -> ../../sdb1
lrwxrwxrwx 1 root root 10 2008-09-20 20:30 HP_RECOVERY -> ../../sdb3
lrwxrwxrwx 1 root root 10 2008-09-20 20:30 news -> ../../sdb5
lrwxrwxrwx 1 root root 10 2008-09-20 20:30 OLDHP_RECOV -> ../../sdd1
The nodes are created by the udev daemon. Your default udev rules are probably OK for a pendrive. However if the udevd daemon isn't running the device nodes won't be created. If the filesystem is corrupt, or there is no partition, then udev can't create these nodes.

Another possibility is that the pendrive is created without a partition table, just a filesystem. You can check it like this:
sudo file -s /dev/sdi
for a pendrive assigned to /dev/sdi.

---

I am repeating information that you apparently have ignored.
You need to
  • Determine the node used presently to use for the udevinfo command
  • Use udevinfo to gather the UUID, LABEL and filesystem type
  • Use fdisk to see if the device has a partition
  • Either remove the entry for the device in /etc/fstab and rely on automounting or create a valid fstab entry using the data gathered from udevinfo.

Last edited by jschiwal; 09-24-2008 at 11:07 AM.
 
Old 10-15-2008, 02:29 PM   #10
flatstan
Member
 
Registered: Jul 2006
Location: London UK.
Distribution: Linux MINT, UBUNTU.
Posts: 150

Original Poster
Rep: Reputation: 15
Mounting USB Stick

Thanks people for your help, sorry I have not been back but I have been away for a while.
Following your advice, - as root, I can successfully mount the Stick using
- mount -t vfat /dev/sdb1 /mnt/usbstick and then unmount with umount.
I have tried your suggestions for automounting, using UUID, Label, etc, entries in FSTAB, but with no success, I am not bothered though as the manual mount works fine although a tad labourious.
How do I comment out a line in FSTAB ?
As you probably have gathered, although I have been using SUSE for a while I am still very much a learner.
thanks again.
 
Old 10-15-2008, 11:46 PM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Just precede the line in /etc/fstab with "#".

Which desktop do you use? KDE communicates with HAL via the dbusd daemon. Is dbusd running? How about kded?

If you insert a pendrive, does a requester pop up (KDE 3.5). If so, select properties. In the mounting tab, you can select to automount the disk as the user.

Also check the file "/usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy". It should contain:
Code:
  <action id="org.freedesktop.hal.storage.mount-removable">
    <description>Mount file systems from removable drives.</description>
    <message>System policy prevents mounting removable media</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>
If <allow_active>no</allow_active> is there instead, then you could see your problems.

If you get a permission denied response, monitor the kernel messages. There should be one with info on why mounting is denied. ( sudo tail -f /var/log/messages )
Here is the message for a successful automount:
Code:
Oct 15 23:39:41 hpmedia hald: mounted /dev/sdf1 on behalf of uid 1000

Last edited by jschiwal; 10-16-2008 at 12:05 AM.
 
  


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
Problems mounting USB memory stick dwhitney67 Linux - Hardware 2 08-18-2007 12:38 AM
USB memory stick mounting gangaraju Fedora 2 01-03-2006 07:07 AM
suse 10, usb memory stick thegreatgatsby SUSE / openSUSE 17 11-02-2005 05:21 PM
Mounting USB 2.0 JetFlash memory stick causes hang detly Linux - Hardware 7 05-25-2004 02:33 AM
How do I get my USB memory stick to work in SuSE 8.2? Paul_Lee Linux - Hardware 13 02-13-2004 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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