Wednesday, February 4, 2015

Backing up your Files

Making Backups

When was the last time you've made a backup?  
Do you have a backup procedure? 
Is your data important to you? If not, then you are not a serious computer user and you don't need to care about backups, otherwise read on...
Backuping is a dry topic, not very interesting you may think. Wrong! MAKING BACKUPS IS VERY IMPORTANT, and can sometimes be fun.

Making backups is very important, and it's a task often neglected by computer users. Especially by individuals using a computer at home.

In a professional environment, the IT department takes care of the problem of backups. But for ordinary people at home with their personal computers, the task is left to them, and from my personal experience, very few people have an adequate backup procedure. In the recent years, several people came to me in despair because they had lost their data after a hard disk failure, the execution of a command by mistake (e.g. del *.*), or a virus infection.

Having backups is very important and it will save your life if anything happens. Is your data important to you? If not, then you are not a serious computer user, and you don't need to care about backups.

Usually, people store files on the hard disk of their computer. After time, the accumulate a lot of files. And one day, their drive breaks and they come to me hoping that I can retrieve their data. Sometimes, I can restore the data, or at least parts of it. The lost of data can also be caused by a virus infecting the system. When a virus or malware infects your system, it may be possible to salvage your files if the virus was not too evil. Finally, the user can delete files himself inadvertently.

I predict that your hard drive will have a failure. Your hard drive is a mechanical device that will fail you. It can fail in two minutes, in two days, or in five years, I do not know when, but I know it will fail you eventually. And when it will, you will probably loose all your files, unless you have backups of your files on other media, or even in the cloud (i.e. storage devices on Internet). The following comic strip describes the evolution of backups:
Picture: How we make backups now.
Picture: How we make backups now.

It is very important to do backups of your files, in any fashion.

Just a note: If you do backups in the cloud, be aware that the service that you will use will have access to your files. Their server can also be hacked. So, if you have files containing sensitive information, it is really not a good idea to put them in the cloud, unless you own the cloud server yourself.

How I Do my Personal Backups

A Bit About My Systems

At home, I have three computers :
  • One ASUS P4S333 desktop server with 10 hard-disks, but I can use only at most four hard disks at a given time in that machine.
    Operating Systems: MS-DOS 3.2 to 6.0, Windows 1.0 to 3.11, Windows 95, Windows 98, Windows XP profesional, Linux Mandrake 8.2, Linux RedHat 9, Linux OpenSuse 10.2
  • One notebook HP Pavilion g6
    Operating Systems: Windows 7 Premium, Ubuntu 12.10, Kubuntu 12.10
  • One laptop Toshiba Satellite L850D
    Operating System: Linux Ubuntu 14.04 LTS
Picture: My Desktop Server
Picture: My Desktop Server.

Picture: My Notebook and Laptop Computers.
Picture: My Notebook and Laptop Computers.


Where Do I Store my Backups

After over 30 years of computing, I have accumulated a lot of files: pictures, movies, music, documents, etc... These files are very important to me. You never know when something will become handy.

When I perform a full backup of all my files, I keep it, especially if it's made on optical digital media (such as CD-ROMs or DVDs).  Back in the old times when we were using magnetic media, it was tantalizing to reuse the same backup media over and over, rewriting over previous backups.

So, if I make a full backup every month, I have in reserve 12 backups after a year.

Of course, I do not always perform a full backup. Sometimes, I only save a few files on devices such as external USB drives, USB keys, other machines connected on my network, and even on my Google Drive in the cloud.

An Example of the Importance of Having Multiple Backups

At one point in time, I was using a Windows XP computer and it got infected by a virus. So, I needed to re-install Windows XP. I mean, reformatting the hard-drive, re-installing Windows and retrieving all my personal files from a backup.

The joke is that after re-installing Windows, everything was fine. But the virus had infected executable files in my last backup archive. Fortunately, after spending three days of installing and scanning, I was able to retrieve all my files, having to retrieve infected programs from previous older backup archives. It took a lot of work and I had to burn the midnight oil, but eventually I prevailed and have not lost a single file.

My Main Archive Repository

I have on a computer what I call my main archive repository. I put in this location all the files that I wanna keep.

In this archive, the permission on the files is READ-ONLY to prevent modifications by mistake. Also, the contents of the archive is restricted. Not all users can access the archive.

I have copies of this archive on several computers, on several hard-disks, also on an external 2 TB USB drive, and finally, I also create copies of the archives on optical digital media such as DVDs and CD-ROMs.

Also, I keep copies of these optical backups into another physical building in the event that my house would be completely destroyed by a fire for example.

My Full Backup Procedure

Today, I have made a new full backup. Here is the procedure I used to create a copy of my archives:

Use the command df(1) to report the file system disk space usage:
Snapshot1.png
Snapshot1.png
The following command shows the top directory of the archive and also counts approximately the number of files in the archive:
Snapshot2.png
Snapshot2.png
The following command creates a tape archive file containing all the archive contents:
Snapshot3.png
Snapshot3.png
The following command will compress in a password protected ZIP file the tape archive file:
Snapshot4.png
Snapshot4.png
The following command will split into 4.3 GB chunks the huge compressed tape archive:
Snapshot5.png
Snapshot5.png
After that, I can burn the files xa{a,b,c,d,e} to five blank DVDs and I will give my archive to a friend and ask this person to put that into his safe:
Snapshot6.png
Snapshot6.png

How to Reconstruct my Archive

If something very bad happens and if I want to retrieve the files on the DVDs, I will need to perform the following procedure:
Snapshot7.png
Snapshot7.png

  1. I need a Linux or Unix system with at least 50 GB of free space. Why 50 GB? Because the size of the archive is about 25 GB and I will need twice the amount of space temporary to reconstruct it. But, 60 GB or more free space would be preferable.
  2. I will create a new empty directory in that file system and I will copy the files xa{a,b,c,d,e} from each DVD to this new directory. In the end, I will have these five files in that directory (cf. Snapshot7.png):
  3. I will use the command cat(1) to concatenate the five files into a new tar zipped file:
    # cat xaa xab xac xad xae > my_backup.tar.zip
  4. I will use the command unzip(1) to uncompress the file. The unzip command will ask at the terminal for the password needed. In case I forget in the future the password I have used, this is a hint for me ("FLN"):
    # unzip my_backup.tar.zip
  5. To extract all the files from the tape archive file into the current directory:
    # tar -xvf my_backup.tar

No comments:

Post a Comment