LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 04-26-2002, 10:45 AM   #1
hacketta
LQ Newbie
 
Registered: Oct 2001
Distribution: SuSE
Posts: 9

Rep: Reputation: 0
Recovery Using tar backup


The usual "probably a stupid question" caveat applies,but here goes...

I've been experimenting with some backup and recovery scenarios on a spare machine running Red Hat 7.1. First I do a full backup with:

cd /
tar cvf /dev/st0 /

Then I randomly change some files to check that they are overwritten by the backup when I restore from tape:

cd /
tar xvf /dev/st0

The restore completes and the files are as they should be e.g. back to how they were. Next I reboot. At this point I am given warnings that the swap partitions could not be unmounted (failed) and the machine black screens. When the box restarts the BIOS ticks over then the letters LI_ appear on screen and nothing happens.

I realise I've ruined my Linux installation (not worried as this is all a test anyway) but I was wondering why. If anybody could shed some light on this it would be much appreciated as would any tips on the best ways of using tar to backup your entire system to tape (all the things I've found seem to suggest I'm doing it right, although some exclude /proc but I can't seem to do this when it's to tape e.g. back up all except /proc).

Thanks

Austin
 
Old 04-26-2002, 07:16 PM   #2
ph34r3d
Member
 
Registered: Apr 2002
Location: Tamaqua, Pa
Distribution: Slackware. Gentoo 1.4rc3, RH9, Mandrake 9.1, Debian, FreeBSD, OpenBSD, Fedra Core 3 x86_64
Posts: 71

Rep: Reputation: 15
try make a tar file name like :


tar zcvf "blah.tar.gz" / and so on..

It doesn't look like you actually created a file name, I may be wrong in this, but that is what it all looks like.
 
Old 04-29-2002, 03:20 AM   #3
hacketta
LQ Newbie
 
Registered: Oct 2001
Distribution: SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the tip, but I'm not sure if that's the problem. My understanding was that when writing to tape you don't specify an archive name, though I may well be wrong. The files were definitely backed up because tar -tvf /dev/st0 produced a huge list of files. Thanks. Austin.
 
Old 05-01-2002, 10:40 AM   #4
hacketta
LQ Newbie
 
Registered: Oct 2001
Distribution: SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
OK, I think I've sorted this now. So for the benefit of others:

I wasn't really going about this the right way. Some files like shared libraries, /proc etc. cannot be restored to a running system. So, you need to boot your machine using a rescue disk. There is a boot disk how to athttp://www.ibiblio.org/pub/Linux/doc...Bootdisk-HOWTO . The rescue floppy needs to have the modules for your tape drive, and you'll need tools like tar, mkswap, mke2fs etc. You'll need the libraries required for these commands too (or use statically linked versions). Also you need to be sure your tar backup is relative (leading member names removed, tar does this by default). Boot up using the boot disk, and then recreare your partitions, and swap partitions. Format the file systems, mount the new root under /mnt, and also mount the others filesystems. Restore your backup:

tar xvf /dev/st0 -C /mnt

Reboot and run lilo to restore the MBR.

If all this sound too daunting, like it did to me then help is at hand. There is a tool http://mkcdrec.ota.be/ called mkcdrec. Using this you can create a bootable iso image and burn it to CD. Also you can backup your files. By booting from the CD you can run a script dynamically created by mkcdrec that will resore your system. Definitely worth it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup/Recovery aerogate Mandriva 2 11-11-2005 04:17 AM
cvs backup and recovery varun_33 Linux - Software 4 06-02-2005 12:28 PM
Backup/recovery recommendations stutterbug Red Hat 2 04-25-2005 03:17 AM
Best backup recovery suite ldaled Linux - Software 6 09-27-2003 05:51 AM
Backup and Recovery Tips hacketta Linux - Newbie 0 10-08-2001 04:58 AM


All times are GMT -5. The time now is 05:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration