Slackware This 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.
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.
|
|
06-26-2004, 11:34 AM
|
#1
|
LQ Newbie
Registered: Jun 2004
Posts: 13
Rep:
|
can't mount usb pen drive with hotplug
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?
thanks,
dori
|
|
|
06-26-2004, 11:53 AM
|
#2
|
Member
Registered: Aug 2003
Posts: 83
Rep:
|
Try changing the mount command to something like this:
Code:
mount -t vfat -o uid=dori /dev/sda1 /mnt/usb128 2> /tmp/mount.errors
That should dump any mount error messages to /tmp/mount.errors allowing you to see them.
|
|
|
06-26-2004, 12:28 PM
|
#3
|
LQ Newbie
Registered: Jun 2004
Posts: 13
Original Poster
Rep:
|
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'
Any help on how I might fix this?
thanks,
dori
|
|
|
06-26-2004, 12:39 PM
|
#4
|
Member
Registered: Aug 2003
Posts: 83
Rep:
|
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.
|
|
|
06-26-2004, 12:46 PM
|
#5
|
LQ Newbie
Registered: Jun 2004
Posts: 13
Original Poster
Rep:
|
thanks, but no such luck, I think they are called serially
dori
|
|
|
06-26-2004, 01:01 PM
|
#6
|
Member
Registered: Jun 2004
Location: California - home of Slackware
Distribution: Slackware
Posts: 59
Rep:
|
read the man page for MAKDEV
then make the following devices:
brw-r----- 1 root disk 8, 0 1995-04-29 03:33 /dev/sda
brw-r----- 1 root disk 8, 1 1995-04-29 03:33 /dev/sda1
brw-r----- 1 root disk 8, 10 1995-04-29 03:33 /dev/sda10
brw-r----- 1 root disk 8, 11 1995-04-29 03:33 /dev/sda11
brw-r----- 1 root disk 8, 12 1995-04-29 03:33 /dev/sda12
brw-r----- 1 root disk 8, 13 1995-04-29 03:33 /dev/sda13
brw-r----- 1 root disk 8, 14 1995-04-29 03:33 /dev/sda14
brw-r----- 1 root disk 8, 15 1995-04-29 03:34 /dev/sda15
brw-r----- 1 root disk 8, 2 1995-04-29 03:33 /dev/sda2
brw-r----- 1 root disk 8, 3 1995-04-29 03:33 /dev/sda3
brw-r----- 1 root disk 8, 4 1995-04-29 03:33 /dev/sda4
brw-r----- 1 root disk 8, 5 1995-04-29 03:33 /dev/sda5
brw-r----- 1 root disk 8, 6 1995-04-29 03:33 /dev/sda6
brw-r----- 1 root disk 8, 7 1995-04-29 03:33 /dev/sda7
brw-r----- 1 root disk 8, 8 1995-04-29 03:33 /dev/sda8
brw-r----- 1 root disk 8, 9 1995-04-29 03:33 /dev/sda9
|
|
|
06-26-2004, 01:16 PM
|
#7
|
Member
Registered: Aug 2003
Posts: 83
Rep:
|
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.
|
|
|
06-26-2004, 01:45 PM
|
#8
|
Member
Registered: Jun 2004
Location: California - home of Slackware
Distribution: Slackware
Posts: 59
Rep:
|
Thanks, I'll keep this in mind when I add another partition on this system and install 10.0 to use the 2.6.<current> kernel.
|
|
|
03-02-2007, 03:22 AM
|
#9
|
LQ Newbie
Registered: Jan 2007
Posts: 20
Rep:
|
how to nautilus from the script
hello
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: "
how do I patch this up ?
-B
|
|
|
All times are GMT -5. The time now is 11:14 AM.
|
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
|
|