Datamation content and product recommendations are
editorially independent. We may make money when you click on links
to our partners.
Learn More
Everyone 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 udev
to your will so that your backup devices will have persistent names. Part 2 will reveal fast, easy, reliable ways to run your backups, both automated and on-demand by clicking a button.
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:
- A reasonably modern PC that supports USB 2.0
- GParted, the excellent graphical partition editor
- An external USB storage device: SATA or PATA hard drive, USB pen drive, or Compact Flash
- Rootly powers for the initial setup
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.
Next: Creating a Filesystem With GParted »
Use 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.
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.
Resources
This article was first published on LinuxPlanet.com.
-
Ethics and Artificial Intelligence: Driving Greater Equality
FEATURE | By James Maguire,
December 16, 2020
-
AI vs. Machine Learning vs. Deep Learning
FEATURE | By Cynthia Harvey,
December 11, 2020
-
Huawei’s AI Update: Things Are Moving Faster Than We Think
FEATURE | By Rob Enderle,
December 04, 2020
-
Keeping Machine Learning Algorithms Honest in the ‘Ethics-First’ Era
ARTIFICIAL INTELLIGENCE | By Guest Author,
November 18, 2020
-
Key Trends in Chatbots and RPA
FEATURE | By Guest Author,
November 10, 2020
-
Top 10 AIOps Companies
FEATURE | By Samuel Greengard,
November 05, 2020
-
What is Text Analysis?
ARTIFICIAL INTELLIGENCE | By Guest Author,
November 02, 2020
-
How Intel’s Work With Autonomous Cars Could Redefine General Purpose AI
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
October 29, 2020
-
Dell Technologies World: Weaving Together Human And Machine Interaction For AI And Robotics
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
October 23, 2020
-
The Super Moderator, or How IBM Project Debater Could Save Social Media
FEATURE | By Rob Enderle,
October 16, 2020
-
Top 10 Chatbot Platforms
FEATURE | By Cynthia Harvey,
October 07, 2020
-
Finding a Career Path in AI
ARTIFICIAL INTELLIGENCE | By Guest Author,
October 05, 2020
-
CIOs Discuss the Promise of AI and Data Science
FEATURE | By Guest Author,
September 25, 2020
-
Microsoft Is Building An AI Product That Could Predict The Future
FEATURE | By Rob Enderle,
September 25, 2020
-
Top 10 Machine Learning Companies 2021
FEATURE | By Cynthia Harvey,
September 22, 2020
-
NVIDIA and ARM: Massively Changing The AI Landscape
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
September 18, 2020
-
Continuous Intelligence: Expert Discussion [Video and Podcast]
ARTIFICIAL INTELLIGENCE | By James Maguire,
September 14, 2020
-
Artificial Intelligence: Governance and Ethics [Video]
ARTIFICIAL INTELLIGENCE | By James Maguire,
September 13, 2020
-
IBM Watson At The US Open: Showcasing The Power Of A Mature Enterprise-Class AI
FEATURE | By Rob Enderle,
September 11, 2020
-
Artificial Intelligence: Perception vs. Reality
FEATURE | By James Maguire,
September 09, 2020
SEE ALL
ARTICLES