LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   External USB hard drive not auto-mounting - broken HAL? (https://www.linuxquestions.org/questions/slackware-14/external-usb-hard-drive-not-auto-mounting-broken-hal-653759/)

dewert 07-05-2008 12:07 PM

External USB hard drive not auto-mounting - broken HAL?
 
Hello all

Running Slack 12.1.

I'm having some issues with getting an external hard drive to mount automatically with the proper permissions. It's an ntfs drive, and I can mount it manually as root, and also as user, after editing fstab to allow such a thing. However, upon trying to browse as a regular user, I can't enter any of the directories on the drive. So it seems to be a permissions thing so far.
pmount fixes the permissions problem, but this is still manual.

At one point, when I plugged it in, KDE was even popping up with a nice window asking me what to do.

However, responding with "open window to view files" or some such nonsense ended up with an error message saying that it would only work on systems with HAL.

Now I thought my system had HAL. The package is installed in any case. It would seem it's a little broken. Anyway, the drive is now not showing up in /media.

Here is my fstab entry for the drive (sdb1):
Code:

/dev/sdb1        /mnt/ext        auto        rw,users                      0  0
So, what I would like is to plug this in as a regular user, and have the drive mount automagically. Everything on the hard drive should then be accessible, executable, writable etc.

Thank you in advance!

jschiwal 07-05-2008 03:37 PM

Can you try ejecting the device, commenting out the fstab entry and re-inserting the drive. Different distro's may have slightly different architectures for how udev/hal/kde or gnome work together. On mine, an fstab entry will interfere with the functioning of hal. Make sure that you don't have a NOACPI kernel boot option. Also make sure the dbus and hal daemons are running.

Your fstab entry, if that is what you want to use, probably should use a FS_UUID value instead of a device. Device nodes change for external devices change. Also, use a file system type. If you want write access use the fuse module's "ntfs-3g" filesystem. Since the ntfs filesystem is foreign, you need to specify the ownership and permissions of the filesystem in your mount command. Use the uid= and gid= options. You can use either your UID & GID number or your username & group name. For the permissions, use "fmask=" and "dmask=". I think you also want the "nls=utf8" option. Check the mount manpage or mount.ntfs-fuse to be certain. This will give you write access if you want it. The "uid","gid","fmask" and "dmask" missing options are why only root had access.

If commenting out the fstab entry and restarting the hal and dbus daemon works, then your username will be the group owner of the device (by udevd) which is what will give you access. I'm not certain how kde & gnome & the hal daemons work together, and my system will be different than yours.

PS, the "users" option is OK if you have an fstab entry. I forgot the "noauto" entry which will prevent problems if the device isn't plugged in when you boot up. Together you should be able to mount the device as a normal user. You can use "udevinf -q env /dev/sdb1" and copy/paste the FS_UUID number into your /etc/fstab entry. For a fat32 pendrive, it will look like "ID_FS_UUID=486F-D871
". Use "UUID=486F-D871" in your fstab entry instead of the device.

Woodsman 07-05-2008 05:03 PM

Comment out the fstab entry.

In Slackware ensure the following are executable: /etc/rc.d/rc.hald, /etc/rc.d/rc.messagebus, and /etc/rc.d/rc.udev.

Ensure the HAL daemon actually is running. Try ps ax | grep hald. You should see several entries and some of those should contain the word "polling."

After physically connecting the drive, verify the drive is recognized by again running the ps ax command. Also use the lssci command to view the scsi list before and after physically connecting.

You mentioned KDE. There are two configuration files maintained by KDE. They are in ~/.kde/share/config: mediamanagerrc and medianotifierrc. These files control how KDE responds to new devices. You might want to edit the files (or temporarily rename) to delete any references to the USB drive.

In the KDE Control Center, in KDE Components, Service Manager, ensure the two media startup services are enabled and running (KDED Media Manager and KDED Notifier Daemon). Both services must be enabled and running to have automounting work correctly.

Another nice troubleshooting tool is to enable both the Mounted Removable Medium and Unmounted Removable Medium desktop icons. Enable these options in the Control Center, Desktop, Behavior. Enabling these icons will provide you visual feedback on the desktop whether KDE recognizes the drives.

You mentioned the drive is formatted ntfs. Hopefully some of the other Slackers here with experience with the ntfs tools can provide additional guidance with that.

dewert 07-06-2008 11:56 AM

Hi, and thanks for the quick reply. I've commented out the fstab entry - no luck. The services are executable, but hald is not found when running ps ax | grep hald. I tried bringing it up manually, and then ps ax'ing again, but... nothing. I'm assuming this is my problem, right? How would one troubleshoot hald?

lsscsi works quite nicely, and the drive is recognized.

In kde, the services are fine, but I see no evidence of any configuration files of that name. I already had the desktop icons enabled (for purposes of troubleshooting), and they do nothing upon plugging/unplugging.

I would really prefer to not use fstab entries, because recognition and mounting is really something that I'd prefer to have happen automagically. I'm planning to use this laptop as my main computer, and I want to be able to get files from other people's pendrives without too much trouble.

I'm going to google for the problem of hal not running. Will be back soon if I find anything.

Cheers.

dewert 07-06-2008 12:10 PM

To try and get a clue of what hal is doing, I tried
Code:

hald --daemon=no --verbose=yes
and it gave me a LOT of feedback. Anyway, at the end it said:
Code:

10:03:18.503 [I] device.c:3823: add_dev: subsys=acpi sysfs_path=/sys/devices/LNXSYSTM:00/device:00/PNP0C14:00 dev= parent_dev=0x00000000
10:03:18.503 [I] coldplug.c:214: pool_num_freed = 78 (of 895)
10:03:18.503 [I] hotplug.c:142: /sys/devices/pci0000:00/0000:00:00.0 is a device (subsystem)
10:03:18.503 [I] device.c:3823: add_dev: subsys=pci sysfs_path=/sys/devices/pci0000:00/0000:00:00.0 dev= parent_dev=0x00000000
Segmentation fault

Segmentation fault is bad, right? :P But I don't know why it's doing this.
Any advice?

jschiwal 07-06-2008 03:53 PM

Did you check that you don't have a "noacpi" or similar boot option. Also check if the dbus daemon is running.

I'm thinking that either might cause a failure to start hald.

dewert 07-08-2008 12:41 AM

Nope, that doesn't seem to be the problem.

ps ax | grep dbus:
Code:

2873 ?        Ss    0:00 /usr/bin/dbus-daemon --system
 3312 ?        S      0:00 dbus-launch --autolaunch 6126efd389663f5236449d5c483196c8 --binary-syntax --close-stderr
 3313 ?        Ss    0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
 6545 pts/1    R+    0:00 grep dbus

And here is my /etc/lilo.conf:
Code:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/sda
#compact        # faster, but won't work on all systems.
# Standard menu.
message = /boot/boot_message.txt

# Append any additional kernel parameters:
append=" vt.default_utf8=0"
#prompt
#timeout = 5
# VESA framebuffer console @ 1024x768x256
vga = 773

# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sda3
  label =
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

Hmm...

So, what do I try next?


All times are GMT -5. The time now is 02:19 PM.