scanning for new scsi devices

scanning for new scsi devices.

New devices can be added using echo “scsi add-single-device <h> <b> <t> <l>” > /proc/scsi/scsi where the variables are host, bus (channel), target (scsi id) and lun. The success (or otherwise) of this command can be determined by sending a subsequent cat /proc/scsi/scsi command.

..from the scsi-howto (proc interface) at www.tldp.org – see it for more info.

i have a script “rescan-scsi-bus.sh” here on debian which uses the above method to recheck devices.

HTH ritch.

This was written in 2005. I found the rescan-scsi-bus.sh script on medusa but have no idea which package it came from. It wasn’t on any other Fedora 14 install so it must have come from somewhere. It scans the SCSI bus and finds the drive perfectly well.

Re-scan the SCSI bus in Linux after hot-swapping a drive

A better way to find out the correct host controller:

# udevadm info -a -p /sys/class/scsi_generic/sg0

where sg0 is the device node of which you’d like to know the corresponding SCSI controller – down that tree you will find hostX mentioned as part of the device path.

And thanks for the rescanning tip, it saved my day.

via Re-scan the SCSI bus in Linux after hot-swapping a drive | Racker Hacker.

How to hot-swap SATA drives in Linux

If you want the drives to be automounted and your automount system uses pmount to do the mounting (pmount allows mounting by a normal user without an entry in /etc/fstab) you may need to edit /etc/pmount.allow. If the drives are seen as non-removable, which SATA hard disks usually are, pmount will refuse to mount them unless you add the device name to /etc/pmount.allow, for example.

echo ‘/dev/sdb1’ >>/etc/pmount.allow

echo ‘/dev/sdc[123]’ >>/etc/pmount.allow

echo ‘/dev/sdd*’ >>/etc/pmount.allow

The first allows one particular partition to be mounted by pmount, the second example permits three specific partitions on a drive, while the third lets through every partition on a drive. Note the use of single quotes to stop the shell interpreting the wildcards.

via How to hot-swap SATA drives in Linux | TuxRadar Linux.