LinuxQuestions.org
Help answer threads with 0 replies.
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 06-26-2004, 10:34 AM   #1
dori
LQ Newbie
 
Registered: Jun 2004
Posts: 13

Rep: Reputation: 0
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
 
Old 06-26-2004, 10:53 AM   #2
Toth
Member
 
Registered: Aug 2003
Posts: 83

Rep: Reputation: 15
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.
 
Old 06-26-2004, 11:28 AM   #3
dori
LQ Newbie
 
Registered: Jun 2004
Posts: 13

Original Poster
Rep: Reputation: 0
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
 
Old 06-26-2004, 11:39 AM   #4
Toth
Member
 
Registered: Aug 2003
Posts: 83

Rep: Reputation: 15
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.
 
Old 06-26-2004, 11:46 AM   #5
dori
LQ Newbie
 
Registered: Jun 2004
Posts: 13

Original Poster
Rep: Reputation: 0
thanks, but no such luck, I think they are called serially

dori
 
Old 06-26-2004, 12:01 PM   #6
HuMJohn
Member
 
Registered: Jun 2004
Location: California - home of Slackware
Distribution: Slackware
Posts: 59

Rep: Reputation: 15
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
 
Old 06-26-2004, 12:16 PM   #7
Toth
Member
 
Registered: Aug 2003
Posts: 83

Rep: Reputation: 15
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.
 
Old 06-26-2004, 12:45 PM   #8
HuMJohn
Member
 
Registered: Jun 2004
Location: California - home of Slackware
Distribution: Slackware
Posts: 59

Rep: Reputation: 15
Thumbs up

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.
 
Old 03-02-2007, 02:22 AM   #9
baloon
LQ Newbie
 
Registered: Jan 2007
Posts: 20

Rep: Reputation: 0
Question 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
 
  


Reply



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
unable to mount usb pen drive in redhat 9.0 zero79 Linux - Hardware 9 01-25-2007 09:07 PM
hey i am not able to mount usb pen drive amolgupta Linux - Hardware 1 05-07-2005 01:51 AM
Difficulty to mount USB Pen Drive fatra2 Linux - Hardware 5 09-10-2004 01:58 AM
howto mount usb pen drive? name_in_use450 Linux - Hardware 2 08-24-2004 07:23 AM
Question: how to mount uclinux usb pen drive?help me. chen_shannon Linux - Hardware 3 07-10-2003 02:41 AM

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

All times are GMT -5. The time now is 05:10 PM.

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