restoring a backup
I currently do a full backup periodically to an external disk drive.
I would like to know how to restore from that drive in the event of failure.
Years ago using Sun OS, I was able to boot up to something called mini-unix (a totally memory resident version of the OS) and from there I could use the following sequence to restore the system.
a) make new file systems (2 using "newfs" - one with the "install boot option")
b) mount the file systems on two newly made directories (e.g. /a and /b)
c) go to each of the directories and issue the "restore" command
(I used a tape OR piped the output from dump on another machine over the net)
d) sync, sync
I believe most of this is do-able now but am scared to try (I only have one box right now). I don't know how to stop the installation and mount my external disk drive to get the backup DUMP file. I am also unsure if the intermediated running fedora kernel is memory resident or depends on the DVD (suspect latter), as I could copy the dump file to a DVD and restore from there as an alternative.
This seems like one of the most important things that one needs to know as an administrator. I am really scared of having to rebuild all the software installed on this box. Things fail and it is really nice to know you can get it all back.
Thanks for suggestions, clues, ..
I agree with you that maintaining good backups is an important part of being a GOOD system administrator.
I applaud you for being proactive and wanting to test your backups before you have a disaster that requires you to rebuild your server (hopefully from backups).
It sounds like we have a lot in common.
You didn't mention what type of hardware you are using or if your 'one box' is a test machine or if you are doing this on a server in work or at home. You also didn't mention how you perform a backup. I'm going to guess that since you are coming from a UNIX background you either use dd or tar to backup the entire spindle at once via a disk partition that spans all of the other disk partitions. (I never liked that method.)
If possible get a second disk. This will be great to use for testing your system rebuild procedure. Disks today are really affordable. Even SCSI disks are becoming reasonably priced as better performing disks in the ATA class are invented.
Since there are so many unanswered questions I'm going to stop here. At a minimum you should try to get a spare disk to experiment on.
Terribly sorry, I thought that I said I used "dump" to make a full backup and planned to use "restore" to get it back (tar is great but not for special files, dump does it all). Secondly I do have a second disk - it is an external drive (WD passport to be particular). I am able to keep several backups on this drive with the option to go back to any of them and yes I have used them to get files I have lost. I could get another hard drive, but that seems to be overkill.
So assuming I bring up fedora from the installation dvd, I would plan to stop the installation and get to single user mode (how - not sure yet, but I knew how to do this with Unix and Sun OS). Then I would mount the external disk; make the partitions needed on the hard drive; mount them; cd to them individually - there are two; and restore.
I am looking for advice on how to
a) get to single user mode
b) mount the external hard disk
c) make sure /boot has a boot blocks
As an alternate plan, I could put my restore set on a DVD and restore from that, but fear that the running Linux kernel will be needing the installation DVD in place.
Note: I used to do this using a tape drive OR a combination of "rsh dump" from an alternate system (neither is an option on this box). I could copy the dump file to an old Sun and use the local net, but that seems a crazy waste.
Thanks for your thoughts. I only have one box here, but elsewhere there are many boxes that could benefit from this strategy. In the alternate world with many boxes, all of the machines are backed up to the same external disk, making restore of any easy and one movable backup that can be put in a fire proof box.
You still didn't mention what hardware architecture you are using. There may be some specific differences in a good procedure on different hardware platforms.
Okay. You need two new disks to perform the fire drill.
b) don't you want to make partitions first?
c) if you are using an Intel machine then you should have backed up your disk MBR as part of your backup process. Then you can restore the MBR boot code onto a new disk. There are other threads here that have details. I know because I wrote them. Use the LQ search for MBR.
Lastly, what exactly is your dump command?
I haven't used dump since 2003 on Sun O/S.
stress_junkie's advice is good.
You really need to get yourself a new HDD, remove your current one, install a blank, unformatted one and then see if you can restore from your "backup".
You need to test that you can restore from a completely "dead" system. If you haven't tested this properly, it may not work when you need it. I speak from experience - it once took me a whole weekend to do a restore from tape, because I made the "backups" stupidly. It should have taken me 40mins (most of would have been disk-writes, but I had to reset paths and whatnot, thanks cpio, but I managed it (just) and learnt a lot).
The failsafe strategy is to make a backup, shut down the PC, install an empty HDD in place of the running one, and then attempt a "restore".
Does it work?
If not, your strategy needs adjusting.
Thanks for your comments.
1) you are quite right - I did not mention making partitions and yes they need to me made.
and I don't remember if you install the boot blocks as a separate command or part of creation of the
file system after making the partition
2) I am running on Fedora 8 now and about to upgrade to 10, so I have a "window" in which to try things
without buying another hard drive. Hardware is a Dell Inspiration AMD64 - twin cpus. one hard drive, one DVD/CD drive ...
- the second site has 5 or 6 boxes that can be played with (3 identical to mine) - and yes that is where I would have
like to try this (but that takes a plane ride or trusting someone else's fingers - the latter scares me :=<] )
BTW - the person at the other site has failed to find out how to do this with with my original thoughts
and I don't think it is going to be that bad ( I could even get him to pay for the lessons )
3) I am a newbie to this forum so I will need to learn to dig -
"Use the LQ search for MBR" will take some fun learning, but I will do my best and I see on this page - other references
4) I left Sun in '90 so your experience was later - I could be wrong - but dump is safer than tar for full backups
of the root partition (does block+char specials correctly; tar did not and I would assume doesn't)
- I could be wrong, but doubt that has changed and YES tar would be fine for other partitions (both compress NOW)
5) here is the command for the root backup that I am using (after doing a CD to the mounted external drive)
dump -u0 -A root.toc -f root.dmp -L root -z2 /dev/mapper/VolGroup00-LogVol00
(not sure why I bothered with "-A root.toc" as I think the TOC is in the dump file too - unsure if TOC file used
but I have restored files often enough and it works fine - programmer over-zealous-clean damage :=] )
6) you can boot fine from the install DVD (just takes less of them to do the job- :=])
7) KISS is my middle name - I did what I had to do before CDs and DVDs and before external drives could be plugged in
this should be much easier with the mountable WD disk
Now to try it - I really want to get my ducks lined up pretty solid, so I have minimum down time. My intention to to restore the fedora 8 image and then to upgrade to 10 - being down for more than a few days will hurt badly. I need to do my homework on (I have not done this for a LONG time)
a) partitioning (2- I believe)
b) mounting the WD device when running the DVD kernel
c) making file systems on the two partitions and making sure the first one (/boot) has the critical hidden boot blocks
d) mounting the newly made file systems
e) doing the restore is a cake walk then and the final sync(s) are superstition, but I need to do these now when I do the dumps so maybe not just folklore
You are doing really well. I wish more people were as responsible as you are. Okay, ... we are. :)
Okay so now I'd be a jerk if I insisted that you do that. Here is my last post on the subject. The section labeled Code is the part with the commands.
On Intel machines the MBR of a disk contains both the boot code and the partition table in the first 512 byte block. My procedure to save the MBR will save both the boot code and the partition table.
When you want to restore the boot code but not change an existing partition table you restore the first 446 bytes. That will leave the partition table intact.
Another thing to keep in mind is how your boot loader recognizes its target drive. If you are using GRUB then you may have to do two things after the restore. You may have to edit the /boot/grub/menu.lst to tell GRUB what disk and partition it should boot from, and you may need to run grub-install from a chrooted environment (chrooted to your restored partition). More on that if it becomes necessary. It is possible to write a book about what could happen. That's why a fire drill is so important before a disaster actually happens.
That was my question too when I started using Linux. I wanted to put it on a new hard drive with all the programs I already had Installed.
Go to this link, http://forums.linuxmint.com/viewtopic.php?f=90&t=27426 and read the second post. You can burn a iso live dvd with all your stuff on it and if something happens to your drive you just plop in the live dvd and install just like a fresh install but with all your data and programs that you have already installed already loaded. Perfect way to back up your whole system for the cost of a blank dvd every month or so.
BTW, the std recommendation, at least for Fedora (& RHEL/Centos) is to do a fresh install when moving to a new major version.
Some people have claimed to be able to upgrade Fedora in-place, but it doesn't always seem to be stable in the long run.
FWIW, the tech docs for RHEL say upgrades across major versions eg 4 -> 5 are theoretically possible, but NOT supported.
Only minor upgrade eg 5.2 -> 5.3 are.
I didn't mention it because the O.P. may have a very very complex system from a software configuration point of view and we were concentrating on the restore. But I officially hate trying to upgrade. Too many loose ends and gotchas waiting to surface at the worst possible time. Paychecks not printing because the printer is acting up after the upgrade, SQL database not authenticating during working hours because the old PAM module doesn't work with the new distro version; upgrades are very risky. At least with a fresh install you know what needs to be done before you start and you (should) have the old distro in place to roll back to. Fresh install on a different partition to keep the old version intact and ready to run.
Now back to restoring from backup!!! :)
To all other than Stress Monkey:
Thanks for the advice on upgrading. I intended to do that anyway (full fedora 10 install and then add software). I NEVER trust upgrades in place (Thank Solaris for the lesson and the burn several years ago - ouch).
I don't know how to be fancy with the neat little quote boxes, but will use the classical mail method to answer:
>You are doing really well. I wish more people were as responsible as you are. Okay, ... we are.
Perhaps several years as a system administrator helps me be cautious. I am only working on sweat equity projects now (yes it hurts), but for many years I had to deal with various OS platforms, finally Unix for 14 years. It hurts but it hurts more to not be careful. :=]
The other site is trying to become a company so we can all get paid for over 5 years of development with no pay, they are shipping me a HDD so I can do this right (yahoo). But YES, I have proposed that we should pay someone (you if willing and we can connect) to help out. I am in Maine, so we are not zillions of miles apart - I don't have much of a budget, but can find something and we can publish the results if you like for others. ?Disaster recovery validation? - neat - I could tell you stories there - you would laugh yourself silly - a whole backup tape library wiped out by a large induction motor (IBM mainframe - hundreds of tapes - erased!).
I did do a search and could not find your post but forgot to add your acronym. Will save time by the link - thanks.
>Come to think of it I never used the dump utility in a production environment. ..
Veritas is great, tar will do the job for all normal files, but fails for special files. It works great and now with the -z option I don't have to pipe it to compress to make it reasonable. It also has a nice interactive mode for restoring the file(s)/dir(s) you just accidentally clobbered with fat finger syndrome.
>Things have gotten much more reasonable with regards to low level system administration in the last 10 years.
Yes, true. But some folks like to use graphical interfaces - my analysis so far is welcome to Hades when you do - you will get burnt. I like just typing the command and reading it three or four times before I press ENTER.
So, I will read your notes and try a restore as soon as I get the HDD. Will post back and let you know how I made out. If you care to contact me, perhaps we can try together and you can get paid (email@example.com). In either case, I will write up my experience and post it wherever you suggest for future use by others.
Thanks for all the help. :=]
|All times are GMT -5. The time now is 08:15 PM.|