> -----Original Message-----
> From: Stuart Henderson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 16 August 2007 6:16 PM
> To: Edwards, David (JTS)
>
> On 2007/08/16 08:53, Edwards, David  (JTS) wrote:
> >
> > Of course, that still leaves me with the other problem.  I
> > still need to identify a disk which is plugged into a certain
> > (physically labelled) cable so I can mount it.  Anyone help
> > with that one?  I'm currently grepping through dmesg output
> > at the moment.
>
> hotplugd may be of interest; 'atactl <drive>' will tell you the
> drive serial number if you need to identify a particular drive.

Ahhh, another interesting tool, thanks.  But I actually
need to work out the device name for a disk plugged into
a particular USB port.  I need to keep different backup sets
on separate USB drives and track which is which.

So, I've got some USB cables permanently plugged into
the server labelled (say):
disk_1 (to be used for backup set_1)
disk_2 (to be used for backup set_2)
etc..

So, I when the backup script runs to backup (say) set_1,
I need to figure out the disk device name (eg sd0, sd1 etc),
that is currently connected to the cable labelled "disk_1".

I can then mount the USB disk partition, dump the files and
unmount it.  As the disks are replaced daily (and moved
off-site), the device names will be a moving target.

I can do this now using usbdevs and dmesg output but it's
a bit messy and relies on a circular logging buffer (dmesg).

This is no biggy, I'm reasonably happy with the script I've
got, I'm just wondering if I've missed another method to
do this that's simple and possibly obvious to everyone
else :-)

Reply via email to