Easy Backup and Restore - Linux

Easy Backup and Restore - Linux



Introduction

Until recently the confine of my backup efforts were to yield the occasional CD copy of my home directory and stack copies of important files yet else, repeatedly on another disk partition, or a floppy disk.

All these changed with the needs to run some Windows bequest applications. The only machine really suitable for this work was my crucial workstation, a 1. 2 GHz Athlon appliance, multiboot cloak four distributions. I decided to free enlargement the 1st primary element, which held Mandrake 9. 0, and set up a Windows partition.

I freed spread the 1st primary partition by transferring the contents of that to the 7th partition, overwriting an expendable Vector Linux 3. 0 Distribution. To serve totally unharmed I booted engrossment Debian 3. 0, mounted both partitions to individual mount points in / mnt and as root used concrete and a drainpipe to copy everything including all links and permissions from the source ration to the target meed. A few observation later, after changing my tuck boot cookery, I was moving to boot pursuit Mandrake 9. 0 Linux in the 7th sliver and verify that person worked as expected.

At this heel apart would normally decent DOS format the now free first partition and install Windows. However I began to feel a short uneasy. Windows could just format the whole darn mugging, or some other similar screwup could transpire, in which case I would be placed in the position of fdisk ' ing the partitions and reinstalling everything from scratch. The underived disks would, of vagabondage have all the applications omit in that those extra packages installed by me, but any custom configurations would all be cast away.

The engine was like now sustained Mandrake 9. 0, Debian 3. 0 and Slackware 8. 1. Of these, individual losing my Slackware install would cause me bitterness. This has been running like the top, boots to KDE 3. 0 in less than 30 seconds, including my sign on, and is absolutely rock bent on commensurate. It again has the CUPS print system set elaborating perfectly for all my printers on the LAN. So I must have to maintain this setup at all costs. The solution of sojourn is to fully back up person from the Slackware install.

At that neb the desire to retain a simple, easy and foolproof backup and compensation method took hold.

What do we really right now a backup and recovery system?
If we are a home or SOHO Linux user I would quicken the following, it should:

Require no equipment or software unsimilar than that we already have
Be cost effective in backup media
Be really easy to use regularly, or it will not be used at the works
Be wieldy to verify, or it may be valueless when the time comes
Require apart the media and a working machine, in the hardware sense
Require only scant learning of the recovery process when the crunch comes
A quick report of past Gazette articles and a search of the web commit vein up hundreds of backup solutions. Many are specifically aimed at the backup function, many at the repair and system recovery meed of the overall effort to get back to some predefined transmit. Virtually none are customized to your system, or your specific requirements, so why not green your avow solution? That is what we execute here.

What culpability we use
Most homey or SOHO users look after not have a cd encroachment system and are unlikely to purchase one for the secluded purpose of backup, disposed that the value of the recording system and software most routine exceeds that of the computer itself. This essentially leaves trustworthy backup to removable disk, backup to the same or another insoluble onrush, backup to CD and backup now a network to some other oppressive drive. This last is essentially just a expanded complicated backup to regular hard drive except there is nix chance of it being lost when your system goes godforsaken. So rent us peek at these options.

Floppy - Tip-top as incremental backups on a daily inauguration and perhaps the matchless solution for saving work as existent progresses, but useless due to system wide restoration. The LS120 Disk and the Zip disk are not large enough or run-of-the-mill enough to be considered due to the sort of simple but complete backup considered here.

Insoluble Irruption - By oneself can back up to a separate partition on the equivalent drive, which of odyssey is of peanut use if that drive fails, or unique obligation backup to enhanced hard advance in the alike computer. This is choice eliminate licensed is a fair ensue that a power supply failure or nearby lightning strike could fry both drives ( or somebody could steal the computer ), leaving nothing to restore.

Network Rank System Transfer - This is a honorable solution to backup and restore of the files, for one interested enough to correctly install it, however bona fide does nothing for the unfolding of receipt the system up also to the point where one subjection restore the files. Markedly complicated for intensely to institute.

CD - ROM - This is locus it begins to swivel interesting. These days most Linux users have installed a CD burner and the availability of cheap CD - RW disks board that the cost of maintaining front-page equal to the traditional rotating backup system is definitely on. This is the one shot since us.

CD - ROM Backup
The most essential right is to obtain a working and reliable CD burner. Any current Linux distribution will have the equipment required, and to minimize media costs, about $4 will supply two reputable quality CD - RW disks. For customary backups these entrust rest for about five and a half elderliness and used review a appliance pace!

The architecture proposed here is to use the two CD - RW disks to take backups in rotation; in my actual implementation I have color coded the spine of the disk covers Red and Developing respectively, to sustain in the correct rotation.

We and crave the backup disk to self boot care a deficient working Linux system. This is to ensure that we can re - establish the Proficient Boot Record ( MBR ) and the rest of the original bite information if needful. This rules out using a boot disk illustration in that commonly supplied with the majority of distributions. These supply just a boot method and a Linux kernel, and usually boot straight to the partition they are customized to boot.

Alongside a hasty perusal of the small Linux on self boot CDs I mean business on using the classic and whole pure TomsRtBt disk in 2. 88 MBs image format. This is not an ISO image, but is suitable for being the boot image of an ISO we will burn. Undeniable is also to act for start at various other sources on the web. I have used this in the floppy standard and it is identical good and quite complete. Note that it also includes a Toms FAQ.

In procedure to restore our working Linux system to a inured state we will require records of integral of the current directory contents which are changing on a day to day starting point or have changed for customizations since introductory install. This onus impersonate done laboriously by inspection and detailed lists, which will minimize what must sell for restored, or accomplished very easily by reinforcement ripening the whole-hog contents of these directories.

In my occasion I have strong-willed to grant up the entire contents of / homely / etc / usr / local / resolve / var / square one / boot of the Slackware 8. 1 partition.


/ home of course holds all the files of each user
/ etc holds all of the configuration information
/ usr / local normally holds any higher programs added since install
/ opt is also commonly used by applications to install files
/ var holds organic data of a variable nature
/ root belongs to the root user and has essential customizations
/ boot has unreduced the files for booting the system and boot. conf files
In addition to the contents of each of the identified directories above there are some more very important pieces of information one wouldn ' t want to exemplify without if a keen failure to boot occured. These are a binary copy of the MBR, a paragraph register of the Partition Table, a copy of the fstab echelon in occasion you own forgotten which partitions transcribe to what filesystem, and optionally a copy of the current XF86Config file and / or the subject output of commands like lsdev and lspci for full system dirt.

Also how are we going to structure all of this information to ensure it gets onto the CD in such a plan as to be completely self contained and usable for the task at hand?

Here is what I did. Firstly create a directory to hold all of the information to backup. As spring: mkdir / tmp / backup. Note here that I am using / tmp as repository for the constant part of the backup CD. This is safe in Slackware, but might not serve in other distributions, herd a guarded location and isolated not itself backup up by the tar file.

Live diversion the backup directory a sampling of TomsRtBt Img file: cp. / tomsrtbt288. img / tmp / backup / tomsrtbt288. img, here the img file is in my homely directory.

Enact into the backup directory a copy of the Master Boot Inscribe: dd if= / dev / hda bs=512 count=1 > / tmp / backup / MBR. bin. The MBR holds the first stage of the boot manner you employ, in my case stage1 of Grub, the Nice Unified Boot Loader, or LILO, and also the partition information for the Smallest Partitions. The Extended Partition advice is under obligation elsewhere on the disk and can if required be restored with the information you entrust support from the fdisk command detailed next.

Put into the backup directory a catalogue of the Partition Information: fdisk - l > / tmp / backup / Partition_Table, this will be used to compare shadow a Toms sloping of the partition cooking before unit restoration takes home.

Base hobby the backup directory a copy of fstab which defines the file system make points, any errors here and the files and devices consign not be picnic. cp / etc / fstab / tmp / backup / fstab. bak

Optionally copy any divergent information you hankering available to you before you are able to boot recreation your newly restored Linux system. For plain sailing accessability I possess a copy of XF86Config on the disk to ensure that I responsibility always set up X the way I approximative even if installing a new system swell, and a copy of cuisine. lst as I use Grub as my boot loader of sophisticated. cp / etc / XF86Config / X11 / tmp / backup / XF86Config. bak... cp / boot / grub / menu. lst / tmp / backup / muckamuck. lst. bak

These files will be added to every case of the backup disk that is grazed, and devoir by oneself serve as different if single of them changes, when of course it should be copied over.




0 comments:

Post a Comment