LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > 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
 
Thread Tools
Old 09-20-2005, 04:58 PM   #1
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43
Thanked: 0
Backing Up / Restoring


[Log in to get rid of this advertisement]
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!
Arrowx7 is offline     Reply With Quote
Old 09-20-2005, 05:18 PM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,363
Thanked: 10
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 05:24 PM..
Mega Man X is offline     Reply With Quote
Old 09-20-2005, 05:34 PM   #3
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43
Thanked: 0

Original Poster
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
Arrowx7 is offline     Reply With Quote
Old 09-20-2005, 05:50 PM   #4
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,363
Thanked: 10
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!
Mega Man X is offline     Reply With Quote
Old 09-20-2005, 06:22 PM   #5
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43
Thanked: 0

Original Poster
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??
Arrowx7 is offline     Reply With Quote
Old 09-20-2005, 09:13 PM   #6
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185
Thanked: 0
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
mfeat is offline     Reply With Quote
Old 09-20-2005, 09:49 PM   #7
jailbait
Guru
 
Registered: Feb 2003
Location: atop the Blue Ridge
Distribution: Debian Lenny, CentOS 5.2
Posts: 7,250
Thanked: 31
One thing that you could consider is Mondo.

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

----------------------------------------
Steve Stites
jailbait is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 04:36 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration