On Tue, Oct 16, 2007 at 12:32:21PM +0930, Edwards, David  (JTS) wrote:
 
> I was hoping to use physical lables on the USB disks
> with labelled USB cables but I've just found out during
> testing that the connection between a USB device and a
> physical cable is not as simple as I first thought.
> 
> I unplugged all the disks and plugged one back into
> a labelled port.  That port used to be /dev/usb4 "addr 5".
> but it seems it's now /dev/usb4 "addr 3" and "addr 5" doesn't
> seem to exist anymore.
> 
> Looks like I'm going to have to use disklabel to label each
> disk and hotplug to mount them.  The backup script will
> have to check the mount point to make sure the disk is
> mounted and unmount it after the backup is finished.
> 
> In other words, the script I posted earlier is useless
> folks..
> 
> My problem now is to figure out how to get our people
> to work with this.  Preparing a new USB disk is not going
> to be easy for them.  I'm probably going to have to write
> a web interface for it <sigh>.

As far as I know, every time you put a filesystem on a device, you can
lable it but it will also be assigned a UUID.  Whoever first uses a USB
disk/stick can either give it a name from whatever namespace you specify
or note the UUID that it gets assigned and put that on a physical label
on the device.  

Then, make a set of mount points, one for each device and put a line for
each in fstab.  Stick the devices into whatever USB slots you like, and
have the backup script mount all the devices at which time it can verify
that all devices have mounted successfully.  Then it can go ahead and
run the backup and umount them at the end.

I don't see, and never have seen, a use for hotplug, especially if
things are scripted anyway.  

As for preparing a new USB disk, write a new-disk script that tells
people step by step what to do.  like (psudocode)

get tail /var/log/syslog
print "plug new device into any USB port"
get tail /var/log/syslog
diff the two, grep for sd*,  if more than one device
        print "more than one device showed up, lets try again"
        loop back to top
print "This device is showing up as /dev/sde and is listed as a 
        Seagate super-duper 100 TeraByte pocket USB drive.  Is this
        correct?" Y/N
Y
print "placing new filesystem on device..."
print "UUID is DAKA90Q20KA002IWWA2IWREKA"
print "creating mount point and fstab entry"
print "New device is now registered with the backup system."
print "Create a physical label with the UUID and place it on the drive".

Or:
print "The printer is now printing out a barcode UUID label."
print "Please affix this this to the drive and then store the drive."
print "Thank you."


Doug.

Reply via email to