LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Thread Tools
Old 08-02-2004, 01:23 PM   #1
robbow52
Member
 
Registered: Oct 2003
Location: Kentucky, USA
Distribution: Debian "SID"
Posts: 110
Thanked: 0
Question Tar syntax to backup system...


[Log in to get rid of this advertisement]
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!
robbow52 is offline     Reply With Quote
Old 08-04-2004, 03:53 PM   #2
Finlay
Member
 
Registered: Mar 2003
Location: Oregon
Distribution: Slackware ?-10.2
Posts: 997
Thanked: 0
wouldn't it be easier to use partition magic
Finlay is offline     Reply With Quote
Old 08-04-2004, 03:57 PM   #3
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,607
Thanked: 108
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/
win32sux is online now     Reply With Quote
Old 08-04-2004, 06:49 PM   #4
robbow52
Member
 
Registered: Oct 2003
Location: Kentucky, USA
Distribution: Debian "SID"
Posts: 110
Thanked: 0

Original Poster
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!
robbow52 is offline     Reply With Quote
Old 08-04-2004, 07:05 PM   #5
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,607
Thanked: 108
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
win32sux is online now     Reply With Quote
Old 08-05-2004, 12:35 PM   #6
robbow52
Member
 
Registered: Oct 2003
Location: Kentucky, USA
Distribution: Debian "SID"
Posts: 110
Thanked: 0

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


All times are GMT -5. The time now is 08:42 AM.

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