Backing up is very important to me. On my linux server, in the beginning of the HDD, there is a logical error, but I could not fix it no matter what kind of software I use. So I really need to be prepared for a HDD failure. My backing up strategy is as follows:
1. transfer important files from my laptop to the linux server with SyncBack (a free software). I do it with the scheduler in XP, and let it run at 3am each day. (This makes sure that my laptop files are safe). I also use the same software to sync the laptop files with my home desktop. So basically, I have 3 copies of these files, one on laptop, one on desktop and one on the linux server in my office.
2. for important directories on the linux server, e.g. /etc/, /home/, /var/lib/mysql, etc., I do daily backups within the linux server, with rsback, to a secondary harddisk. So if the system disk fails, I still have the copy of configration files, database files, etc.
3. For each of the directories, I do daily rotation for 6 days, then every 7th day, I make a backup to the weekly backup folder. The superiority of rsback over other solutions is that I not only can get back the latest version of the files, but can also get back the files in various states (in XP terminology: snapshots).
4. Just as if the above is not secure enough, I use rsync (enhanced by rsback) to backup the "backup folders" on my linux machine to another linux machine in another building every week for 3 weeks, then save a snapshot every month for 3 months.
When trying to restart apache, the system locked. So I hard rebooted the machine, and it gives all kinds of weird messages, among which, the most important one is " can not mount root=LABEL=/ duplicate", and I found the problem is related to my second hard drive. the disk /dev/hda1 has the label of /, and it is conflicting with the system drive’s root at /dev/hdd2, so I used the command "e2label /dev/hda1 /useless" to mark it and rebooted. This time, it goes on smoothly, except one thing:
It says there is a problem with the hard drive. Now I’m thinking to get a partition image of the drive just in case it fails some day. Although I have all the contents backed up, I still think installing the system is a headache, not to mention I have to re-setup all the services I’m so used to use.
To get a partition image, I searched google, and two solutions come to my attention. First is called mkCdRec at http://mkcdrec.ota.be/project/index.html the other is called System Rescue CD http://www.sysresccd.org/index.en.php.
With mkCdRec, I typed "make test" and make and followed the instructions, it created some tar.gz files on a portable hard drive.
And the SysResCD should be booted and it should create some image on a mounted portable drive. I have yet to test the usability of the two solutions, but mkCdRec is very slow because it called tar to compress the files, and it can take too long.
After I get the image, I’ll "low-level" format the hard drive, and copy the image back, this ensures that the bad block will not create problems in the unexpected time.
There is a g4l package (Ghost for Linux) Ghost for Linux is a hard disk and partition imaging and cloning tool similar to "Norton Ghost"(c) and ™ by Symantec. The created images are optionally compressed, and they can be stored on a local hard drive or transferred to an anonymous FTP server. A drive can be cloned using the "Click’n'Clone" function. g4l supports file splitting if the local filesystem does not support writing files >2GB. The included kernel supports ATA, serial-ATA, and SCSI drives. Common network cards are supported. It is packaged as a bootable CD image with an ncurses GUI for easy use. The problem with G4L is that it used bit-to-bit copy, so I can not release big disk images to small disks.
And, here is a very good tutorial on GRUB and LILO from IBM: