Linux Backups For Real People, Part 1: Page 3

(Page 3 of 3)

Depending on how your particular flavor of Linux has customized udev, it is possible that removable USB devices won't always be assigned the same names when you plug them in. You need them to always be the same when you run backup programs. The correct way is to configure udev to handle this. Ubuntu, Fedora, Red Hat, Mandriva, PCLinuxOS, and doubtless many more have an easy way to control this: simply add a unique device label to your backup partition. For example, suppose you're using a Compact Flash card for your backups. You'll need the tools specific to your filesystem to do this, so for FAT16/32 fetch the mtools package. First add an entry like this to /etc/mtools.conf to map a Windows-style drive letter to your filesystem. You may use any letter:
# Lexar compact flash
drive u: file="/dev/sdc1"

Then create your new device label:

#  mlabel u:

 Volume has no label
Enter the new volume label : backup1

Verify it this way:

$ mlabel -s u:
 Volume label is BACKUP1

Now when you plug in your Compact Flash card it will automatically be mounted at /media/BACKUP1. (Sorry, I don't know how to make MS-DOS disklabels not shout at you; you're stuck with uppercase.)

What if your particular flavor of Linux does not do this? Writing good udev rules is something we'll cover in detail soon, so in the meanwhile you can resort to good old /etc/fstab. First create the /media/backup1 directory, then make an entry in /etc/fstab like this:

# Lexar 2G compact flash, backup1
LABEL=BACKUP1 /media/backup1 vfat user,noatime,noauto,rw,dev,exec,suid 0 0

You'll have to mount it manually. Any user should be able to mount and unmount the device like this:

$ mount /media/backup1
$ umount /media/backup1

Don't worry, our ace backup scheme can handle this with ease. Come back next week to find out how.


This article was first published on

Page 3 of 3

Previous Page
1 2 3

Comment and Contribute


(Maximum characters: 1200). You have characters left.



IT Management Daily
Don't miss an article. Subscribe to our newsletter below.