LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 12-04-2006, 03:13 PM   #1
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,606

Rep: Reputation: 53
Post A guide to USB pen drive, mounting device in mdv2007


In mdv2007 there is normally no more playing with fstab for usb pen drive.
Saying that I am still confused with HAL, and a good howto, guide with the various options
to mount USB pen drives might be usefull. So here goes some of what matters:
(Sorry it is not super comprehensive, but it is a start, it is KDE centric)

Supermount is not used anymore. HAL should be running. You can check with
service haldaemon status
service usb status (To be confirmed, and dbus as well)


In Mdv2007 a window will appear when plugging the USB device. Pressing ok might mount the device readonly or not, and the icon on
the desktop might be mounted or not (depending on security settings I believe). Do check
/mnt/removable that will also show the device, do not rely only on konqueror media:/

I run level security draksec High=3, I have access and mount of USB pen drive no problem
so /mnt is 755 that is
drwxr-xr-x 9 root root 1024 Dec 4 21:20 mnt/
(Differemt security level will affect /mnt permission settings and that could be what cause you not being able to access your pen drive as normal user)

$ konqueror media:/
will show usb devices
$ konqueror system:/ is interesting as well because it points to one icon which is system:/media

using visudo as root I have set
myusername ALL = (root) NOPASSWD: /bin/mount
I cannot tell you yet if this is paramount (so to speak)

$ ls -l /bin/mount
-rwsr-xr-x 1 root root 111404 Jun 29 19:57 /bin/mount*

Saying that my user is part of wheel and adm, so this could help. Device get mounted as user mysusername, group root. So, the device is RW (fat format).

If nothing works you can revert to indienick's post, and add to /etc/fstab
Code:
/dev/sda1 /mnt/removable vfat defaults,exec,users,noauto 0 0
adjust device and keywords according to your needs
Hope it helps people struggling with pen drives

{edit 05/12/06 reordered text, added some comments)

Last edited by Emmanuel_uk; 12-05-2006 at 01:51 AM.
 
Old 12-04-2006, 11:13 PM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
In mdv2006, it still automatically detected my pen drive, and modified /etc/fstab accordingly, but come mdv2007, it didn't. I had to create a manual fstab entry - unfortunately I'm at work right now, so I can't copy my fstab entry for /mnt/sda1 in here, but try this:
Code:
/dev/sda1 /mnt/removable vfat defaults,exec,users,noauto 0 0
It has yet to fail me.

Last edited by indienick; 12-04-2006 at 11:14 PM.
 
Old 12-05-2006, 01:50 AM   #3
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,606

Original Poster
Rep: Reputation: 53
Quote:
In mdv2006, it still automatically detected my pen drive, and modified /etc/fstab accordingly, but come mdv2007, it didn't
This is annoying indeed. It is a bit because of this kind of experience that I started the thread.

It is good you solved your problem, but the fact that you had to edit fstab is "a bit strange" now that 2007 is supposed to mount USB automatically. I know linux often has more than 1 solution, but you would think that the new method is foolproof

I have another PC on which I set security to 4 (higher),
if I plug a USB pen, an umounted icon appears on the desktop.
It also appears in konqueror media:/.
I can click as much as I want on it, the only thing that happens is that it gets mounted
as user root group root multiple times removable-1, removable-2, removable-3.
So it is not visible from userspace, but is as root. Right hand click on icon then mount does not work.

In this case I have not figured out if the problem is just that drakperm
sets /mnt/ as 750 (if I remember correctly), or if draksec at level 4 does something else
(I have added a new rule, at the end of drakperm, again for /mnt/ but as a 755 rule.
I did not have time to test it nor to check sudoers)
 
Old 12-07-2006, 10:01 AM   #4
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Gotcha.

I have to say though, I have noticed that 2007 automatically mounts my usb thumbdrive, but only if I'm in GNOME or KDE. However, my usb drive never really leaves its usb port on my desktop. As 2007 boots, it mounts all devices with proper parameters in /etc/fstab, which - since I've hand-edited mine - automatically mounts my usb thumbdrive.

I don't find it the least bit wierd to have to have to edit /etc/fstab, myself. This is Linux, it needs a bit of help every now and then. I enjoy the fact that Linux is so perfectly stupid - it only does what you tell/have told it to, and does nothing else, unless otherwise specified. Unlike Windows sometimes automatically detecting your hardware - I can't deal with that, it's either gotta work, or not, and if not, I need to know why. At least, with Linux, I know that if something doesn't mount, it's probably because it wasn't properly unmounted, or permissions aren't allowing.

Now that I'm at home, here's my official /etc/fstab entry for my usb thumbdrive:
Code:
/dev/sda1 /mnt/removable auto user,users,noauto,exec 0 0
That line will work for any usb thumbdrive out there.


Now, as far as permissions go, the "user" and "users" entries will take care of that - if you mount it, only you and root may unmount it; and even though "noauto" is in there, 2007 still insists on mounting it (*shrug*).

Last edited by indienick; 12-07-2006 at 10:05 AM.
 
Old 12-07-2006, 07:18 PM   #5
rbonafied
Member
 
Registered: Nov 2003
Location: Delaware
Distribution: Mandriva 2007
Posts: 50

Rep: Reputation: 15
Hi,

I wasn't sure whether to start a new thread or piggy back on this one. It is a USB lack of auto-mounting question. I'm running mandriva 2007 on a laptop and I need this device to be mounted when it is plugged in. My wife wouldn't know a terminal window from a garden window. I'm pretty confused which daemon is supposed to do the auto mounting. Is it udev? Is it hal? Is it dbus?

I read in the udev faq that udev really shouldn't be used to mount drives. However, from poking around it looks like that is how Mandriva is configured to do it. By the way, I don't use kde or gnome... instead I use xfce. I want to "fix" this the right way.

For what it's worth, this is what my message log shows when I insert the usb drive.
Dec 6 19:21:08 nerja kernel: hub 1-0:1.0: over-current change on port 1
Dec 6 19:21:09 nerja kernel: usb 2-1: new full speed USB device using uhci_hcd and address 4
Dec 6 19:21:09 nerja kernel: usb 2-1: configuration #1 chosen from 1 choice
Dec 6 19:21:09 nerja kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Dec 6 19:21:16 nerja kernel: Vendor: CORNICE Model: Inc. Storage Ele Rev: 0811
Dec 6 19:21:16 nerja kernel: Type: Direct-Access ANSI SCSI revision: 00
Dec 6 19:21:16 nerja kernel: SCSI device sda: 7999488 512-byte hdwr sectors (4096 MB)
Dec 6 19:21:16 nerja kernel: sda: test WP failed, assume Write Enabled
Dec 6 19:21:16 nerja kernel: sda: assuming drive cache: write through
Dec 6 19:21:16 nerja kernel: SCSI device sda: 7999488 512-byte hdwr sectors (4096 MB)
Dec 6 19:21:16 nerja kernel: sda: test WP failed, assume Write Enabled
Dec 6 19:21:16 nerja kernel: sda: assuming drive cache: write through
Dec 6 19:21:16 nerja kernel: sda: sda1
Dec 6 19:21:16 nerja kernel: sd 4:0:0:0: Attached scsi disk sda
Dec 6 19:21:16 nerja kernel: sd 4:0:0:0: Attached scsi generic sg0 type 0
Thank you,
R
 
Old 12-08-2006, 01:07 AM   #6
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,606

Original Poster
Rep: Reputation: 53
Fair post, and one of the other reason I started
the thread (I need to setup a foolproof laptop for USB device and found that using level 4 security was making things harder.
I have a post on this somewhere else).

Quote:
Is it udev? Is it hal? Is it dbus?
Do not know exactly how it works, Not poked enough the net.
Would like to know.

[QUOTE]I use xfce. I want to "fix" this the right way.[QUOTE]
I suggest you had an entry in fstab.
Add a sudo entry for mount for your wife username.
Does this work well enough?
Not played with xfce, can you add an icon for the usb drive on the desktop
Possibly nice: symlink to /mnt/removable called /mypendrive (if that was less or more confusing; nobody seems to think the same , maybe /home/user/pendrive or /home/user/.mdk/pendrive
or something of the like
 
Old 12-08-2006, 03:25 PM   #7
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
My suggestion would be to bypass all the daemons and just manually add the /etc/fstab line I supplied.

 
Old 12-10-2006, 12:45 PM   #8
rbonafied
Member
 
Registered: Nov 2003
Location: Delaware
Distribution: Mandriva 2007
Posts: 50

Rep: Reputation: 15
I got it "automounting" using the ivman package which starts as the user (wife). I did a combination of things,

1) I added the following line to /etc/fstab.

Code:
/dev/disk/by-label/THUMBDRIVE /mnt/thumbdrive vfat noauto,umask=0,user 0 0
Since I gave the usb drive a label, I can mount using that label.

2) In addition, I put the following in a script in /etc/X11/xinit.d

Code:
ivman-launch --exit-with-session dbus-launch &
This launches ivman for the user when the login and stops it when the logout.

3) I set up the $HOME/.ivman/.IvmConfigActions.xml with the following:
Code:
        <!-- autoplay CDs -->
        <ivm:Match name="hal.volume.disc.type" value="dvd_rom">
                <ivm:Match name="hal.volume.disc.type" value="cd_rom">
                        <ivm:Match name="hal.volume.disc.has_audio" value="true"
>
                                <ivm:Match name="hal.volume.disc.is_blank" value="false">
                                        <ivm:Option name="exec" value="xmms $hal.block.device$" />
                                </ivm:Match>
                        </ivm:Match>
                </ivm:Match>
        </ivm:Match>

        <!-- autoplay video DVDs -->
        <ivm:Match name="hal.volume.disc.type" value="dvd_rom">
                <ivm:Option name="exec" value="vlc dvd://$hal.volume.mount_point$" />
        </ivm:Match>

        <!-- Mount that thumbdrive -->
        <ivm:Match name="hal.volume.label" value="THUMBDRIVE">
                <ivm:Match name="hal.volume.fstype" value="vfat">
                        <ivm:Option name="mount" value ="true" />
                        <ivm:Option name="exec" value="thunar $hal.volume.mount_point$ &amp;" />
                </ivm:Match>
        </ivm:Match>
This last bit has lines to automatically play a dvd or an audio cd. Oh and the very last bit is what does the mounting of the thumbdrive. It also starts thunar which is a file manager for xfce4.
 
  


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
problem mounting USB pen drive Gogul VectorLinux 2 04-25-2006 03:42 AM
problem in mounting a USB pen drive santhosh.linux Programming 2 04-21-2006 12:05 AM
USB Pen Drive not mounting Psirus Debian 10 01-11-2006 12:15 AM
mounting USB pen drives by device id ProtoformX Slackware 1 10-04-2005 07:52 AM
device driver for usb pen drive sagsun Programming 1 09-24-2004 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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