LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-20-2005, 03:58 PM   #1
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43

Rep: Reputation: 15
Backing Up / Restoring


Hello guys I have a question,
I have a drive with 3 partitions, one of which is linux FC4. I was wondering if I could backup the linux partition image, reformat the entire drive, and then repartition it, and restore the linux partition image on one of the partitions.
Is this possible? how can I get linux's image.

Thanks in advance guys!
 
Old 09-20-2005, 04:18 PM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
How does your file system looks like? I mean, I like to keep all my important things at /home/, so when I need to make a backup, format and restore, I simple compress all my /home/ with tar and gunzip and then when the system is fully reinstalled, I simply uncompress the file at my home again. Even the config files for every individual applications are saved (I'm referring to those hidden files/folders starting with a dot).

That should be the easiest way to backup/restore a system. If you want/can use this method, then simply:

tar cvf files.tar /home/user

where c = create, v = verbose, f = to file output(?) instead of using tape archive

tar(short for tape archiver, when we actually used tapes to store data...does anyone still uses that by the way? ghehe...) won't actually compress anything, but archive the file structure and create one file (here suggested as files.tar) where user is your actual user. Before compressing, it's always a good idea to look inside the file to see if the structure is correct:

tar tv files.tar

where t=table of contents, v=verbose. If everything looks fine, then compress it:

gzip -cv files.tar

c=create, v=verbose. You can use other tools for compressing, such as "compress" (old) or "jar" (does not compress as well as "compress" or "gzip"...).

When you are done backing up your files and your new system is completely restored, then create a new home directory:

mkdir /home/newuser
cd newuser


and uncompress the files:

gunzip files.tar.gz
tar xvf files.tar


where x=extract. You can, alternatively, extract individual files from the tar file. I use this when I've backup something that I don't need to restore right now (like wallpapers or other useless things that I might add later ). That is done with:

tar xvf files.tar filename1 filename2 filename3

Move the files if you need. When your file system structure is good enough, you can move the newhome to your user real name/home directory and hopefully, nothing was lost

Regards!

Last edited by Mega Man X; 12-12-2005 at 04:24 PM.
 
Old 09-20-2005, 04:34 PM   #3
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks a lot Megaman X! A great walk-through.
The only thing I fear is my drivers, which I'll probably lose. Is there a way to tar up and gzip the "/" directory, which is everything and then unzip it? Out of curiosity
 
Old 09-20-2005, 04:50 PM   #4
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
You're welcome . Now that is a good question. Some "places" in the Unix file structure are created upon installation of the Operating system, such as /dev/. This can be a problem if you simply uncompress the hole root into it (thus places as /dev). A few encrypted things (as /etc/shadow) may be a little bit picky too. Setting/restoring permissions for the structure would not be very funny either.

There might be some backup/restoring applications for Linux that creates an exact copy of your system. I know, for example, that you can run 2 HD's in a machine where those HD's are actually mirrored. That is a great way of backing up files, in the case one of the HD's goes bad.

Since I've no experience with it, I will let a more experience Linux user (since I am an eternal newbie) to answer how to create an image of your root and then restore it. I'd also like to know if that's possible and how , ghehe.

Good luck!
 
Old 09-20-2005, 05:22 PM   #5
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43

Original Poster
Rep: Reputation: 15
when I shut down linux, I can see that it compresses itself and all i get is a linux image /img/sysimage Is this the image file of the whole filesystem??
 
Old 09-20-2005, 08:13 PM   #6
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Rep: Reputation: 30
a side note:

you can combine the tar and gzip by adding "z" to the command:

tar cvzf files.tar /home/user

and to extract:

tar xvzf files.tar
 
Old 09-20-2005, 08:49 PM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
One thing that you could consider is Mondo.

http://freshmeat.net/projects/mondorescue/

----------------------------------------
Steve Stites
 
  


Reply



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
Backing up ChristineCrawford Linux - Newbie 8 12-17-2005 07:21 AM
Backing up /etc. Gag Halfrunt Linux - Newbie 1 12-05-2004 03:40 AM
backing-up? jamaso Slackware 5 06-16-2004 08:03 AM
Backing up Cichlid Linux - General 1 12-16-2002 10:03 PM
backing up and restoring linux graystarr Linux - General 8 01-06-2002 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration