|
Linux Backups For Real People, Part 1
Backup HardwareEveryone knows they should make regular backups of their data. But hardly anyone is as diligent with backups as they should be. So in this two-part series we're going to learn some nice simple methods for making regular backups on single PCs or small networks. Part 1 covers external backup media, and bending The type of backups we're going to make are also easy to restore files from, which is the whole point of having backups in the first place. The backups we're going to make are for short-term archiving, which means the useful life of your backup media. Making data archives for the ages is a separate problem; our goal here is to be able to make easy, fast backups, and to quickly recover from a hardware failure, theft, and other immediate problems. To follow my excellent backup scheme you're going to need a few things:
You can purchase external hard drive enclosures that will hold any SATA or PATA hard drive, or you might prefer all-in-one external drives. The all-in-ones often come with Windows- and Mac-only backup software, which is not a problem because we do not need their silly software. You may need to reformat them, as some of them are formatted in NTFS or some other filesystem you don't want. This is where GParted earns its keep: it's the best graphical partitioning and formatting tool there is on any platform. Just plug in your external storage drive, make sure it's unmounted, and then partition and format it as you like. The easiest way is to format it as FAT16 or FAT32, because using FAT saves you from having to set up user permissions. FAT filesystems don't support any kind of access controls, ownership, or permissions. This means you'll be able to easily access your backup media from any computer. FAT16 shouldn't be used on media larger than 512 megabytes because it wastes a lot of space.
Creating a Filesystem With GPartedUse the upper-right dropdown menu in GParted to select the correct physical drive. If you see a little padlock icon that means the filesystem is mounted. You can try unmounting it in GParted with the right-click menu, but sometimes this doesn't work. Your particular desktop environment or window manager may have its own graphical tools for mounting/unmounting filesystems. The safe and sure way is the command-line commando way: # umount /dev/sdc1 GParted tells you the correct device name to use. Then click GParted -> Refresh Devices, and then you can partition and format.
Persistent Backup Device NamesDepending on how your particular flavor of Linux has customized # 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
***
# mkfs.vfat -n labelname /dev/sdb1
-n is the option for volume name and labelname is the disklabel in lowercase.
What if your particular flavor of Linux does not do this? Writing good # 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. Resources
|