LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-05-2007, 10:56 AM   #1
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Exclamation 12.0 and HAL - READ THIS!


NOTE: This post has been edited to place all of the thread's high points in one place.

First, this post assumes knowledge of what's in CHANGES_AND_HINTS.TXT -- if you haven't read that yet, go do that before you even bother with this thread...

Many people have figured this out by now, but there's one "gotcha" with automounting removable devices using HAL.
Console users are automatically added to the cdrom and plugdev groups at login via /etc/login.defs

Code:
 # List of groups to add to the user's supplementary group set
 # when logging in on the console (as determined by the CONSOLE
 # setting).  Default is none.
 #
 # Use with caution - it is possible for users to gain permanent
 # access to these groups, even when not logged in on the console.
 # How to do it is left as an exercise for the reader...
 #
 CONSOLE_GROUPS          floppy:audio:video:cdrom:plugdev
The idea behind doing this was that it would "just work" without the need for admins to manually add users to the plugdev and cdrom groups, but due to the way dbus functions, it didn't work out that way.
When the messagebus service is started, it reads the content of /etc/group and then determines whether users have rights to mount removable devices based on that. This is why the 'reload' option was added to /etc/rc.d/rc.messagebus, as you need to make it aware of any changes to /etc/group if you happen to edit that file to add users to plugdev, cdrom, power, or video groups while dbus is running.

Long story short, you will need to manually add users to the affected groups - do not rely on the output of groups(1) to determine whether a user is in the appropriate group as it pertains to dbus and HAL.

For those interested in further reading, note that this is not a Slackware-specific problem - it's being discussed in various other distribution forums as well.
http://www.debian-administration.org.../308#comment_7
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377689
http://www.mail-archive.com/debian-d...msg240793.html
Note that the "solutions" presented in the first two links are *ugly* - so my recommendation is to not even consider them, but of course, it's *your* system. The *best* way until/unless something changes in the dbus code (which doesn't seem to be easy to do in an effective and secure manner) is to manually add users to the needed groups in /etc/group.

---------------------------------------------------------------------

Re: hal-device-manager

/usr/bin/hal-device-manager needs PyGTK and a few things from gnome in order to work. Pat elected to leave the binary in the package due to the fact that some users will elect to install one of the third-party gnome builds, and any of those should provide the necessary dependencies for hal-device-manager to work.

--------------------------------------------------------------------

Re: entries in /etc/fstab

Okay, here's another hot topic that seems to be troubling a lot of people. From CHANGES_AND_HINTS.TXT:

Code:
Note that HAL will honor settings in /etc/fstab if a device is 
present there, so you could technically have removable devices 
defined in /etc/fstab, but if the fstab settings do not allow normal
users to mount them (with the "user" or "users" option), then HAL/dbus
will not allow them to be mounted either.
Also note that you will need to run "/etc/rc.d/rc.messagebus reload" 
after adding any users to plugdev, power, or video groups so that it 
re-reads the /etc/group file.
Put yourself in the cdrom and plugdev groups regardless, but here's an example to hopefully clarify what's written above.

Without a custom udev rule and an fstab entry, my Sandisk Cruzer Micro will be automatically assigned the next available /dev/sd* node by udev, and then I can mount it using HAL (well, actually DBUS via either KDE or XFCE, but that's inconsequential details for now) at /media/CRUZER_1024 (note that "CRUZER_1024" is the filesystem label that I put on it). The device will be mounted in /media with whatever name the filesystem label has.

Suppose I like for the device to be mounted in some other location for whatever reason. I would create a custom udev rule (how to do that is left as an exercise to the reader - there's ample documentation available on the subject) to assign a persistent /dev/cruzer1024 symlink to the device node, and then I would add the device to /etc/fstab like this:
Code:
/dev/cruzer1024 /mymountpoint vfat noauto,user,rw,dmask=0022,fmask=0133 0 0
At this point, I can mount/unmount the device from a command line *exactly* like I could in Slackware 11.0, or I can *still* use HAL (subject to same "actually" comment as above) to mount the device, and it will be mounted to the place and with the options specified in /etc/fstab.

---------------------------------------------------------------------

Re: Mounting devices in console (not in X)

For those using a desktop environment other than KDE, GNOME, or Xfce and still want to make use of HAL, have a look at http://slackbuilds.org/repository/12.0/system/ivman/ and http://slackbuilds.org/repository/12.0/system/pmount/.
I have not really messed with these much (aside from building and basic testing), so configuration is up to you. I also have binary packages on my site (see signature).

---------------------------------------------------------------------

Re: Using ntfs-3g instead of the in-kernel ntfs driver for NTFS filesystems

First, install ntfs-3g (I'll put in a plug for http://slackbuilds.org on this one) :-)

Note: policy files in /etc/hal/* override the defaults in /usr/share/hal/*
Next, create /etc/hal/fdi/policy/10-ntfs-policy.fdi with the following content:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
    <device>
        <match key="volume.fstype" string="ntfs">
            <match key="@block.storage_device:storage.hotpluggable" bool="true">
                <merge key="volume.fstype" type="string">ntfs-3g</merge>
                <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
                <append key="volume.mount.valid_options" type="strlist">locale=</append>
            </match>
        </match>
    </device>
</deviceinfo>
Next, restart the HAL service: /etc/rc.d/rc.hald restart
All should be well.
Note: this information was gleaned from http://wiki.archlinux.org/index.php/HAL

---------------------------------------------------------------------


Other Notes:

Use one of the generic kernels.
Do not report bugs until/unless you have verified that they are also present when using one of the generic kernels - otherwise, I (and presumably others) will ignore you.

Whatever user account you are using (yes, even root, if you're using that account) must be a member of the plugdev group in order to mount devices using HAL/DBUS.

---------------------------------------------------------------------

Last edited by rworkman; 10-01-2007 at 08:05 PM. Reason: Add ntfs-3g information
 
Old 07-05-2007, 11:17 AM   #2
erklaerbaer
Member
 
Registered: Mar 2006
Posts: 381

Rep: Reputation: 30
should be stickied
 
Old 07-05-2007, 12:56 PM   #3
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware and OpenBSD
Posts: 740

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by erklaerbaer
should be stickied
Agreed. Thanks for the heads up, Robby.
 
Old 07-07-2007, 11:33 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Quote:
Originally Posted by erklaerbaer
should be stickied
Just did it!
 
Old 07-08-2007, 06:54 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Original Poster
Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
One more thing - I meant to note this in CHANGES_AND_HINTS.TXT, but I forgot... :/

/usr/bin/hal-device-manager needs PyGTK and a few things from gnome in order to work. Pat elected to leave the binary in the package due to the fact that some users will elect to install one of the third-party gnome builds, and any of those should provide the necessary dependencies for hal-device-manager to work.
 
Old 07-08-2007, 11:10 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Thanks for the tips Robby! Helped.
 
Old 07-09-2007, 12:53 AM   #7
lchxr
Member
 
Registered: Mar 2006
Posts: 42

Rep: Reputation: 15
Does HAL auto-umount USB memory stick?

When I plug in a USB memory stick, HAL gives me an icon on the desktop. The USB stick is mounted only when I double clicked the icon. Is this correct?

One more question: Does HAL auto-umount the device when I plug out the USB stick? Or I need to umount by hand?

Regards,
 
Old 07-09-2007, 02:15 AM   #8
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Original Poster
Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by lchxr
When I plug in a USB memory stick, HAL gives me an icon on the desktop. The USB stick is mounted only when I double clicked the icon. Is this correct?
This is correct.

Quote:
One more question: Does HAL auto-umount the device when I plug out the USB stick? Or I need to umount by hand?
You definitely need to unmount the filesystem. If you right-click on the desktop icon, it will give you an option to unmount the filesystem. In that respect, it's no different from MS Windows - "unmount" is a rough equivalent of "safely remove."
 
Old 07-09-2007, 02:58 AM   #9
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Original Poster
Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Okay, here's another hot topic that seems to be troubling a lot of people. From CHANGES_AND_HINTS.TXT:

Note that HAL will honor settings in /etc/fstab if a device is present there,
so you could technically have removable devices defined in /etc/fstab, but if
the fstab settings do not allow normal users to mount them (with the "user" or
"users" option), then HAL/dbus will not allow them to be mounted either.
Also note that you will need to run "/etc/rc.d/rc.messagebus reload" after
adding any users to plugdev, power, or video groups so that it re-reads the
/etc/group file.

Put yourself in the cdrom and plugdev groups regardless, but here's an example to hopefully clarify what's written above.

Without a custom udev rule and an fstab entry, my Sandisk Cruzer Micro will be automatically assigned the next available /dev/sd* node by udev, and then I can mount it using HAL (well, actually DBUS via either KDE or XFCE, but that's inconsequential details for now) at /media/CRUZER_1024 (note that "CRUZER_1024" is the filesystem label that I put on it). The device will be mounted in /media with whatever name the filesystem label has.

Suppose I like for the device to be mounted in some other location for whatever reason. I would create a custom udev rule (how to do that is left as an exercise to the reader - there's ample documentation available on the subject) to assign a persistent /dev/cruzer1024 symlink to the device node, and then I would add the device to /etc/fstab like this:
/dev/cruzer1024 /mymountpoint vfat noauto,user,rw,dmask=0022,fmask=0133 0 0
At this point, I can mount/unmount the device from a command line *exactly* like I could in Slackware 11.0, or I can *still* use HAL (subject to same "actually" comment as above) to mount the device, and it will be mounted to the place and with the options specified in /etc/fstab.

Did that help? :-)
 
Old 07-09-2007, 04:05 AM   #10
helo
LQ Newbie
 
Registered: May 2007
Distribution: slackware
Posts: 18

Rep: Reputation: 2
Quote:
Originally Posted by rworkman

I would create a custom udev rule (how to do that is left as an exercise to the reader - there's ample documentation available on the subject) to assign a persistent /dev/cruzer1024 symlink to the device node, and then I would add the device to /etc/fstab
Or you could use the device nodes under /dev/disk/by-label that udev already puts there, they work for me.
 
Old 07-09-2007, 10:13 AM   #11
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Original Poster
Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Good point - no need to bother with custom udev rules if it's not necessary... :-)
 
Old 07-09-2007, 12:16 PM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Robby, the above statement would be for users that must have their hand held. I like it both ways. A lot of time at cli, most of the time. It's the user(s) that need the turnkey.
 
Old 07-13-2007, 06:17 AM   #13
SJD
LQ Newbie
 
Registered: Jan 2007
Posts: 25

Rep: Reputation: 15
Hi there,

Apologies if I'm not meant to post on a sticky but I didn't want to start a new thread. I am very new to Linux and I want to sort out the mounting of USB drives but how do I add a user to the group in /etc/group? I've looked at the file, but I don't know which bits to change? I only have root on system and that is all I will ever have.

Thanks for your help,

Steve
 
Old 07-15-2007, 04:40 PM   #14
adriv
Member
 
Registered: Nov 2005
Location: Diessen, The Netherlands
Distribution: Slackware 15
Posts: 700

Rep: Reputation: 43
Just add the name of the user to the group, like this:
Code:
cdrom::19:adri
BTW, it is highly recommended NOT to log in as root, unless you really need to.
So you better use adduser and add the username.
 
Old 07-17-2007, 05:24 AM   #15
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
Quote:
Or you could use the device nodes under /dev/disk/by-label that udev already puts there, they work for me.
Aren't you better of using uuid? So that if anyone changes the label, it will still work!

Forgive me, I am still on Slackware11 , but Is my understanding below correct?
If I have a usb disk with specific uuid/label that I want to always mount to /mnt/usbdisk whenever I connect it, I should use fstab, add
/dev/disk/by-uuid/<id> /mnt/usbdisk 000
to it?
then whenever I connect the USB disk , HAL will detect it and automatically mount it to /mnt/usbdisk after reading the fstab? (and not to some stupid media:/ or something?)

Also, if I connect some ntfs drive, will HAL use the standard NTFS driver or can I specify ntfs-3g? I can use fstab for my drives, but what about drives that my friends bring over? Cos won't hal auto mount it as ntfs?

Some solutions are there at http://forum.linux-ntfs.org/viewtopic.php?t=456
but they have said "it is a distro specific thing , bug the distro devels" which I am doing here.

Last edited by duryodhan; 07-18-2007 at 01:04 PM.
 
  


Reply

Tags
compile, error, install, installer, make, nvidia, slackware, trolling



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
How to use HAL wesd Linux - Software 1 06-11-2007 04:00 PM
HAL won't load akjo Slackware 9 01-23-2007 09:03 AM
hal problem fibbi Linux - Software 3 01-11-2006 09:19 AM
hal krusty_lab Fedora 3 10-10-2005 10:23 AM
Hal gamehack Programming 7 12-16-2004 02:03 AM

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

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