SlackwareThis Forum is for the discussion of Slackware 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.
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.
I used to be able to have my usb pen drive auto mount when inserted using hotplug and a small script in 9.1, but it's not working with 10. The script in question is located at /etc/hotplug/usb/usb-storage and it looks like:
Code:
dori@darkstar:~$ cat /etc/hotplug/usb/usb-storage
#!/bin/sh
if [ "${ACTION}" = "add" ]; then
mount -t vfat -o uid=dori /dev/sda1 /mnt/usb128
cp /var/run/usb/remover $REMOVER
fi
the copy command works, and if I run the mount command by hand after the message in /var/log/messages saying "creating device node sda1", the drive mounts fine and I can use it.
Is there a way to check if the mount error is quitting with some error? What else could be wrong?
Ah, thank you, yes there was an error: "mount: special device /dev/sda1 does not exist" it appears that the device is getting created after this script is called. I put a date command in the script and it printed Sat Jun 26 11:26:15 CDT 2004, meanwhile in /var/log/messages I see
Code:
Jun 26 11:26:15 darkstar kernel: usb 1-2: new full speed USB device using address 20
Jun 26 11:26:15 darkstar kernel: scsi18 : SCSI emulation for USB Mass Storage devices
Jun 26 11:26:15 darkstar scsi.agent[6388]: how to add device type= at /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host18/18:0:0:0 ??
Jun 26 11:26:15 darkstar kernel: Vendor: Model: USB DISK 2.0 Rev: 1.1b
Jun 26 11:26:15 darkstar kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 26 11:26:15 darkstar kernel: SCSI device sda: 253952 512-byte hdwr sectors (130 MB)
Jun 26 11:26:15 darkstar kernel: sda: assuming Write Enabled
Jun 26 11:26:15 darkstar kernel: sda: sda1
Jun 26 11:26:15 darkstar kernel: Attached scsi removable disk sda at scsi18, channel 0, id 0, lun 0
Jun 26 11:26:17 darkstar udev[6427]: creating device node '/dev/sda'
Jun 26 11:26:17 darkstar udev[6428]: creating device node '/dev/sda1'
One that *might* work, but might not is putting a sleep 5 command before the mount command. That should halt the script for 5 seconds and hopefully give udev enough time to create the device node.
That doesn't work, HuMJohn. He's using a 2.6 kernel with udev.
Using the above combination, the /dev directory is created dynamically by the udev daemon as devices are added and removed from the system. Using that script might work temporarily, but probably won't work upon reboot.
dori, if you're interested, have a look at my thread on Project Utopia and Slackware 10. One of the uses of those packages is userland automounting.
how do I start nautilus when the usb pen drive is added through this script. When I put the command in the script, it throws and error saying "... cannot open display: "
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.