# Is hotplug useful for usb mass devices

## manny15

Hey, I've noticed that if I plug in a usb mass storage device after I'm logged in, the /dev/X entries don't get created. For example, if I plug in my usb zip drive and try to mount it I get

mount: special device /dev/sda4 does not exist

But if I log out, log back in, and try again it works. Actually, the drive makes "noises" when I log out as it reads the disk. Oh, I did put in a disk before pluggin it in. I thought hotplug solves this but I get the same behaivor. Maybe I need to add some kind of script, but I can't seem to find examples or good documentation of how hotplug works and how to set it up. Any ideas?

----------

## Carlos

This sounds like something relating to /etc/devfsd.conf; I think you need to find out what the symlink /dev/sda4 (or whatever the device that fails to reappear is) points to (it'll be something like /dev/scsi/host1/bus0/target0/lun1/part1), and edit devfsd.conf accordingly - sadly I don't quite know how to do that myself yet.

ejwahl's message in USB Hard Drive should be helpful, though.

----------

## manny15

Thanks for the help. I got it working now. Here's what I did. I plugged in the usb zip drive and did a dmesg to get the proper scsi stuff which is where I got

```

scsi/host1/bus0/target0/lun0

```

Then I edited /etc/devfsd.conf

and added

```

# Create /dev/sda4 for the external USB drive

LOOKUP ^sda4 CFUNCTION GLOBAL mksymlink scsi/host1/bus0/target0/lun0/part4 sda4

REGISTER ^scsi/host1/bus0/target0/lun0/part4 CFUNCTION GLOBAL mksymlink $devname sda4

UNREGISTER ^scsi/host1/bus0/target0/lun0/part4 CFUNCTION GLOBAL unlink sda4

```

I send the HUP signal to the devfsd process using "kill". Then replug the zip drive. And mount /mnt/zip then worked. I didn't have to log out! Thanks! Now I plan to do the same with my usb cdrw.

----------

## Carlos

 *manny15 wrote:*   

> Thanks for the help.

 No problem; thanks for posting details on what you did because I think I'll be able to make my setup better too - until now I've had the problem of not being able to use slots in my USB card reader unless a device was in it when booting.

----------

