On Thu, Aug 16, 2007 at 06:37:57PM +0930, Edwards, David  (JTS) wrote:
> > -----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 :-)

For a simple - and simple is good where backups are concerned -
solution, mount them all and create a file /mnt/<disk>/serial. (Of
course, mount them read-only to prevent nastiness in case of a power
cut...)

Or do as AMANDA do, treat the thing as a tape drive and write a 512-byte
header before the backups.

                Joachim

-- 
TFMotD: mkstr (1) - create an error message file by massaging C source

Reply via email to