Setting up USB drives for backup

I use USB hard drives for backing up one of my machines, swapping them regularly but leaving everything else up to the backup script that runs daily. This means that I want to mount them at the same place every time, regardless of which drive I plug in or what device it is registered as. This isn’t very difficult because fstab can use UUIDs or labels to identify disks:

UUID=6B70-A309    /media/sw_backup vfat user 0 0
LABEL="SW_BACKUP" /media/sw_backup vfat user 0 0

(Note: these backup drives are formatted with FAT filesystems so that I can if need be restore on any system if required.)

To avoid having to manually add the disk every time I put a new one into rotation, I go with the label method.

To use this, each disk must be given the same label (and then not plugged in at the same time!). To set the label, first find the device:

sw@swbackup:~/backups$ sudo blkid
/dev/sda3: UUID="f31d1291-9d6f-441d-9f8d-fa34e9f569d5" TYPE="swap"
/dev/sda4: UUID="8a0b99a2-8a2e-4eae-7666-d607fbc44de5" TYPE="ext4"
/dev/sdb1: LABEL="NONAME" UUID="4A39-C8E7" TYPE="vfat"

Then sudoedit /etc/mtools.conf to add the following, where the device name is the same as above:

mtools_skip_check=1
drive s: file="/dev/sdb1"

Now mtools can change the label:

sw@swbackup:~/backups$ sudo mlabel -s s:
 Volume label is NONAME
sw@swbackup:~/backups$ sudo mlabel s:SW_BACKUP
sw@swbackup:~/backups$ sudo mlabel -s s:
 Volume label is SW_BACKUP

Getting sorted for the new year, in the Mocca Lounge

A new cafe, on the way home from a ride this morning: the Mocca Lounge, it seems to be called. I guess they mean brown and not quite one thing nor another, but at least relaxing. It’s a reasonable place to sit for a while and read a book. It’s an inside cafe with no windows (can you believe such a thing?!), but it is at least dim and carpeted and large and mostly empty, which are good things. And I’ve a coffee and a book and time, which are also good things.

So, three cheers for all that, then.

I’ve been sorting out a new filesystem nomenclature, these last few months…

  1. The top level (my home directory, /home/sam) contains one directory per year and ~/tmp, and a pile of other stuff, as usual, but that’s all maintained by various programmes and the OS.

    ~/
        1995/
        1996/
        …
        2011/
        2012/
        tmp/
    
  2. Each year has only a single level below it, topically- and old-fashionedly-named to maintain alphabetical sorting:

        2011/
            Subject, clarification/
            Subject, andother aspect of it/
            Another subject/
            Again, something else/
    

    There are no files at that level, only directories.

  3. At the turn of the year, items which are of continuing activity are moved to the new year. All else stays put. This means that the current year only ever contains things that are useful and whatever is old but still needs to be kept—and which will rarely be looked at—disappears out of sight in the old years.

    I’ve always found it annoying that computer organisation systems don’t allow things to moulder away in boxes in sheds (as it were), instead forcing everything to be current and visible — and thus liable thrown away once no longer useful. A core part of my archival system is to hide things from my own penchant for disposal.

  4. Within each item, and within the tmp directory, there is no prescribed ordering. Files take whatever names and arrangements as seem suitable.

  5. File and directory names contain whatever characters they want, with the exception of quotation marks, slashes, colons, asterisks, octothorpes, and anything else I think is likely to be annoying in scripts, moving between filesystems, or other filename handling.

  6. There is no rule six. :-)