LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   can I backup a root disk and boot from the new backup disk (https://www.linuxquestions.org/questions/linux-enterprise-47/can-i-backup-a-root-disk-and-boot-from-the-new-backup-disk-242548/)

linuxbkp 10-14-2004 08:29 AM

can I backup a root disk and boot from the new backup disk
 
HI all I need to do a disastory recovery plan(I work on solaris and new to linux)
I have redhat linux 9 kernel 2.4.20-31.9 on an intel box p-4
I have 2 disks with the following partions
HDD1
hda1====> /boot (/boot partition)
hda2=====> / (root partition)
HDD2
hdb1====>/export/home(all home dirs and downloads etc)
I take backup over the network and can restore no problems!!!
My QUESTION :-
I would like to backup /boot and /root to a different HDD in such a way that in case my HDD1 fails I should be able to bring up the system in no time by just inserting the HDD3(this is the disk which I backed up the / and /boot)
how should I proceed
(presently I have tape backups using dumps)
do let me know the best possile way to proceed
should I use dump commands,or copy, will be new disk boot up if I install it in place of the HDD1 after I remove it
regards
gmb

rjlee 10-14-2004 08:42 AM

If you have an identical disk, with the same size, geometry information and partition table, then you can do this to take an image of the physical hda disk:
Code:

bzip2 < /dev/hda > hda.img.bz2
You will need to have all hda partitions unmounted (or mounted readonly) for this to give you a usable image.

You can then copy this onto another (unmounted and identical) disk, say hdc, using the command
Code:

bunzip2 < hda.img.bz2 > /dev/hdc
Provided that the new disk is inserted while configured as a master device, and your bootloader is actually on the disk (or at least unchanged), you can then boot off the new disk as if it were the old one.

With only Linux partitions, you can also do the same by copying the files (using cp -rp) and then installing the bootloader onto the new disk. This has the advantage that hda* can be mounted read/write during the process. However, this is more fiddly because you have to make sure that the boot-loader is installed to hdc but will try to boot from hda (because it will be hda when run).

A third option is to copy the files recursivly, and boot off a system rescue disk. Then just install the bootloader onto the new disk (see the grub or lilo documentation) and reboot.

Hope that helps,

—Robert J. Lee

/bin/bash 10-15-2004 06:52 AM

Make it easy on yourself: http://www.partimage.org/

rjlee 10-15-2004 06:42 PM

Quote:

Originally posted by /bin/bash
Make it easy on yourself: http://www.partimage.org/
This will copy the partitions, and save space over using bzip2 directly. But it won't copy the boot record(s) (unless I've misread something on that page). So the copy disk won't be bootable.


All times are GMT -5. The time now is 02:35 PM.