LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-02-2004, 12:23 PM   #1
robbow52
Member
 
Registered: Oct 2003
Location: Kentucky, USA
Distribution: Debian "SID"
Posts: 110

Rep: Reputation: 15
Question Tar syntax to backup system...


I'm thinking about resizing a couple of partitions on my system drive and to do this, I want to backup the system to my backup drive. I also would like to just do a simple backup using a script. I've only used tar in the simplest of ways so I would like to check it's usage before I trash things.

I "think" that I want:

tar -cfz /backup/backup(todays_date).tar.gz --exclude=/dev --exclude=/proc --exclude=/tmp --exclude/home/* /

I "think" again, that both /dev and /proc are "virtual" things that will be recreated when I boot into the new system??? (Can someone shed light on this???)

I "think" too that the /tmp folder will be created upon boot also (or do I want --exclude=/tmp/* to save the mount point)????

I have to exclude the files and folders "under" /home (but not the mount point) because my /home is on it's own drive.

Then once I've repartitioned my disk,created file systems and mounted everything (using a recovery cd):

tar -xvvzf /backup/backup(todays_date).tar.gz /(mount_point_of_root)

Will this work or do I need to change some things?

Thanks in advance for your advice!
 
Old 08-04-2004, 02:53 PM   #2
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
wouldn't it be easier to use partition magic
 
Old 08-04-2004, 02:57 PM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
robbow52, i'm not sure what kinda backup you're trying to achieve... if what you're looking-for is a quick way to restore your whole drive (a bare-metal restore) it's better to use something like mondo rescue:

http://www.mondorescue.org/
 
Old 08-04-2004, 05:49 PM   #4
robbow52
Member
 
Registered: Oct 2003
Location: Kentucky, USA
Distribution: Debian "SID"
Posts: 110

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by win32sux
robbow52, i'm not sure what kinda backup you're trying to achieve... if what you're looking-for is a quick way to restore your whole drive (a bare-metal restore) it's better to use something like mondo rescue:

http://www.mondorescue.org/
I have been using Ghost as a "quick" recovery method for my installation. It will not allow me to resize my partitions exactly the way I want, however, so I am just looking for a quick method of "copying" my file system to my backup drive.

I will look into Mondo and see what it's about.

Thanks!
 
Old 08-04-2004, 06:05 PM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally posted by robbow52
I am just looking for a quick method of "copying" my file system to my backup drive.
boot a live linux cd... mount the source partition you want to backup and the empty destination partition... then just copy the contents of one into the other...

for example:

mount -t reiserfs /dev/hda1 /mnt/hd

mount -t reiserfs /dev/hda6 /mnt/hd_backup

cp -vR /mnt/hd/* /mnt/hd_backup


then to restore just do the opposite:

cp -vR /mnt/hd_backup/* /mnt/hd
 
Old 08-05-2004, 11:35 AM   #6
robbow52
Member
 
Registered: Oct 2003
Location: Kentucky, USA
Distribution: Debian "SID"
Posts: 110

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by win32sux
boot a live linux cd... mount the source partition you want to backup and the empty destination partition... then just copy the contents of one into the other...

for example:

mount -t reiserfs /dev/hda1 /mnt/hd

mount -t reiserfs /dev/hda6 /mnt/hd_backup

cp -vR /mnt/hd/* /mnt/hd_backup


then to restore just do the opposite:

cp -vR /mnt/hd_backup/* /mnt/hd
Thanks! I've got some ideas now to try.
 
  


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
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 03:15 AM
tar system backup...best pack/unpack order? mikeybsae Linux - Software 3 08-20-2004 10:12 AM
system backup with tar tjay Linux - General 3 06-09-2004 11:32 AM
Backup entire system with tar sln Linux - General 2 04-30-2004 03:32 AM
Tar syntax JTD Linux - Newbie 2 10-28-2003 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:07 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