LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Thread Tools
Old 06-09-2004, 08:00 AM   #1
grim2
LQ Newbie
 
Registered: Jan 2004
Posts: 18
Thanked: 0
Full Backup With Cpio!


[Log in to get rid of this advertisement]
Hello!

I want to make a full backup of my hard drive using CPIO command under Suse (SLES 8).
I have these partitions on my hard drive:

- /dev/sda1: /boot 100MB (reiserfs)
- /dev/sda2: /root 4GB (reiserfs)
- /dev/sda1: /swap 2GB
- /dev/sda1: /opt rest of hard drive (reiserfs)

I used CPIO command to make full backup of my hard drive:
# cd /
# find . -depth -print | cpio -ov > /babckup/full_backup.cpio

But I need to exclude some directories (proc, tmp, dev) when I make backup.
How can I do this?

In case I lose hard drive I plan to get new hard drive, install basic OS, copy backup file to new hard drive (to /) and restore it with cpio.

Will this work?

Because I have some doubts about restoring and replacing files while they are been used by OS (etc for example).

How about a TAR? Should I use that?

Thank in advance
grim2 is offline     Reply With Quote
Old 06-09-2004, 10:29 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,058
Thanked: 1
I like cpio but off-hand I haven't seen any instructions for excluding directories using that tool. It can save the output as tar and several other types though. Something like this....
find . -depth | cpio --create --format=tar > /mnt/backups/test.tar

If you use the tar utility instead, you could tell it what to backup by reading a list. You can make the list by hand or use ls to make it. Then you can edit the list to remove dirtectories which you don't want backed up.

ls -d *"/" > /home/list.txt

The tar statement would look like this......
tar -cvf /mnt/backups/test.tar \
-T, --files-from=/home/list.txt


Really though, I'm a fan of the partimage tool for making my system images.

Last edited by homey; 06-09-2004 at 10:45 AM..
homey is offline     Reply With Quote
Old 06-10-2004, 01:47 AM   #3
grim2
LQ Newbie
 
Registered: Jan 2004
Posts: 18
Thanked: 0

Original Poster
I've tried partimage.
Works OK. But when you make backup with partimage you need to unmount partition that you are backing up. I need to have all partitions available all the time.

I'll try tar, but I think that tar restore only files that don't allready exist on hard drive. So, I don't know will tar restore old config files.

Thanks!
grim2 is offline     Reply With Quote
Old 06-10-2004, 08:51 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,058
Thanked: 1
Here's another option. http://www.mondorescue.org/docs/docs.html
Somehow, it can work on a live system and you can put the backup onto a bunch of different things like an iso image or cdrom.....
homey 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
Full system backup. Terroth Linux - Newbie 11 06-21-2005 01:52 AM
using cpio to create hard drive backup file bobsmith Linux - Newbie 2 10-20-2004 11:30 AM
Using cpio to backup to CDROM Cyberhund Linux - Newbie 3 07-21-2004 02:49 PM
Full Backup.... LinuxBie Linux - Newbie 3 01-02-2004 11:43 AM
full system backup dbc254 Linux - General 6 12-26-2003 10:27 PM


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