Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-04-2006, 04:13 PM
|
#1
|
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:
|
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 02:51 AM.
|
|
|
12-05-2006, 12:13 AM
|
#2
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Rep:
|
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-05-2006 at 12:14 AM.
|
|
|
12-05-2006, 02:50 AM
|
#3
|
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:
|
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)
|
|
|
12-07-2006, 11:01 AM
|
#4
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Rep:
|
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 11:05 AM.
|
|
|
12-07-2006, 08:18 PM
|
#5
|
Member
Registered: Nov 2003
Location: Delaware
Distribution: Mandriva 2007
Posts: 50
Rep:
|
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
|
|
|
12-08-2006, 02:07 AM
|
#6
|
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:
|
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
|
|
|
12-08-2006, 04:25 PM
|
#7
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Rep:
|
My suggestion would be to bypass all the daemons and just manually add the /etc/fstab line I supplied.
|
|
|
12-10-2006, 01:45 PM
|
#8
|
Member
Registered: Nov 2003
Location: Delaware
Distribution: Mandriva 2007
Posts: 50
Rep:
|
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$ &" />
</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.
|
|
|
All times are GMT -5. The time now is 11:43 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|