Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
AND VOILA
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.
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.
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).
My mistake. You did say that.
Quote:
Originally Posted by rholme
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.
I meant another disk to use as the target of the restore. A good experiment requires that you disconnect the production disk and replace it with a test disk. That way you can see if all of the software works on the new disk. I am essentially suggesting a "fire drill" where the production disk is not used, just as if it had broken and were being replaced.
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.
Quote:
Originally Posted by rholme
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 just looked the the Fedora Core v11 installation page. It says that it comes on a live CD. That means that you can boot a fully functional Fedora Linux from the CD. Maybe the DVD isn't a live version; I don't know. There's a limit to how much I'm willing to research to answer a question.
Okay. You need two new disks to perform the fire drill.
Quote:
Originally Posted by rholme
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
a) boot a live CD.
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.
Quote:
Originally Posted by rholme
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.
The external WD disk is fine. You can restore directly from that.
Quote:
Originally Posted by rholme
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.
Let's try to keep it simple. You'll be glad you did if you are restoring from a real disaster late on a Sunday night.
Lastly, what exactly is your dump command?
Code:
dump -A dump-file /
???
I haven't used dump since 2003 on Sun O/S.
Last edited by stress_junkie; 07-07-2009 at 04:27 PM.
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".
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.
Quote:
Originally Posted by rholme
Thanks for your comments.
1) you are quite right - I did not mention making partitions and yes they need to me made.
Now we're on the same page.
Quote:
Originally Posted by rholme
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
Separate on Intel machines.
Quote:
Originally Posted by rholme
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 ...
Okay that's good news. I haven't worked with other architectures in several years so I wouldn't be very helpful on anything but Intel boxes.
Quote:
Originally Posted by rholme
- 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 :=<] )
That's unfortunate. Your manager will probably appreciate this effort as long as it doesn't interfere with your availability at your principal work site AND if it doesn't cost the business any money. Otherwise s/he will probably not want to see you off site or spending money on disaster recovery validation. (Nice phrase, eh? Disaster recovery validation? I just made that up. )
Quote:
Originally Posted by rholme
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 )
Can we get you to pay for your lessons?
Quote:
Originally Posted by rholme
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
On the menu bar near the top of the page is a link named Search. Click on that. It will open a search form. In the box labeled Search by keyword(s) enter "backup mbr". In the box labeled Search by user name enter stress_junkie since I said that I had written about this. Near the bottom of the page click on the button labeled Search Now.
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.
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)
I don't doubt you. I have lots to learn too.
Quote:
Originally Posted by rholme
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 :=] )
Come to think of it I never used the dump utility in a production environment. My Sun/Solaris machine used Veritas Backup Datacenter software. So I'm completely ignorant of dump.
Quote:
Originally Posted by rholme
6) you can boot fine from the install DVD (just takes less of them to do the job- :=])
Okay. Good. So the main idea is that you have a fully functioning Linux system to work with when you are restoring from backup. That's good.
Quote:
Originally Posted by rholme
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
Right on. Things have gotten much more reasonable with regards to low level system administration in the last 10 years. Thank goodness.
Quote:
Originally Posted by rholme
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
Belt and suspenders. A few syncs here and there won't hurt.
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.
Last edited by stress_junkie; 07-08-2009 at 01:30 PM.
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.
Answer? remastersys!!
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.
Your choice.
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. http://www.redhat.com/docs/en-US/Red...ted_Notes.html
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.
Your choice.
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. http://www.redhat.com/docs/en-US/Red...ted_Notes.html
Fresh installs for version upgrades are my preference too.
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!!!
Last edited by stress_junkie; 07-08-2009 at 07:38 PM.
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).
Stress Monkey:
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 (rayholme@yahoo.com). In either case, I will write up my experience and post it wherever you suggest for future use by others.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.