LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   tar my whole system? (https://www.linuxquestions.org/questions/linux-software-2/tar-my-whole-system-171362/)

shanenin 04-17-2004 02:48 PM

tar my whole system?
 
Would a person be able to tar their entire system, then save it on a dvd? Would you later be able to uncompresses it on a fresh partition and have a fully installed system?

czarherr 04-17-2004 03:43 PM

i suppose its possible... to untar it, you'd need to do it from a boot disk, but it still may not work simply being untarred... i would consider imaging the disk.

jailbait 04-17-2004 03:49 PM

"Would a person be able to tar their entire system, then save it on a dvd? Would you later be able to uncompresses it on a fresh partition and have a fully installed system?"

Yes. I have done it using 2 CDs to save an entire system and then restore it. tar to CD-RW is my standard weekly backup.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

r_jensen11 04-17-2004 10:20 PM

Quote:

Originally posted by jailbait
"Would a person be able to tar their entire system, then save it on a dvd? Would you later be able to uncompresses it on a fresh partition and have a fully installed system?"

Yes. I have done it using 2 CDs to save an entire system and then restore it. tar to CD-RW is my standard weekly backup.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Do you tar your whole system? Or just specific folders(/etc, /home, et al)?

Phorem 04-17-2004 10:27 PM

How would one make a bootable image (dvd or cd) to reformat and install my entire system back to where it was. I have it perfect right now and i don't want to do it again for a while:-)

shanenin 04-17-2004 11:24 PM

I think it would be done the same way you do a stage three install of gentoo. Only all of the configuration would already be done. You would just unpack the tarball you created instead of the gentoo stage three tarball.

jailbait 04-18-2004 11:42 AM

"Do you tar your whole system? Or just specific folders(/etc, /home, et al)?"

I tar a series of directories (/boot., /dev, /etc, and so on). I include every directory in my system. I ge everything but /usr on a single CD. /usr takes a CD and a half.

"How would one make a bootable image (dvd or cd) to reformat and install my entire system back to where it was. I have it perfect right now and i don't want to do it again for a while:-)"

To solve that problem I wrote LifeBoat. I use LifeBoat to create a bootable CD which I can use to restore the tar files (and I have done so several times). LifeBoat comes in handy as a general purpose rescue CD.

http://users.rcn.com/srstites/LifeBo...home.page.html
___________
Steve Stites

shanenin 04-18-2004 12:59 PM

I have been reading man tar, still not sure what options i need to preserve it with. What do you use.

Code:

tar -c  -p -P usr.tar usr/
is this close?

jailbait 04-18-2004 03:29 PM

"I have been reading man tar, still not sure what options i need to preserve it with. What do you use."

Here is one of the three scripts that I use to back up my system. I have two other scripts to backup parts of /usr:

-------------------------------------------------------------------------------------------------------
# This command backs up Linux to CD-RW as gzip tar balls

# Change tar-a.cd-rw.backup date
touch /root/data/backups/tar-a.cd-rw.backup.date

tar -czf /tmp/bin.tar.gz /bin

tar -czf /tmp/boot.tar.gz /boot

tar -czf /tmp/dev.tar.gz /dev

tar -czf /tmp/etc.tar.gz /etc

tar -czf /tmp/home.tar.gz /home

tar -czf /tmp/initrd.tar.gz /initrd

tar -czf /tmp/lib.tar.gz /lib

tar -czf /tmp/misc.tar.gz /misc

tar -czf /tmp/opt.tar.gz /opt

tar -czf /tmp/root.tar.gz /root

tar -czf /tmp/sbin.tar.gz /sbin

tar -czf /tmp/var.tar.gz /var

# The creation date of /cdrom/cd-rw.tar-a.backup.date is the date the CD-RW tar
# backup was created.
touch /tmp/cd-rw.tar-a.backup.date

# Create a CD image file
mkisofs -o /makeCD/cd.image -r \
-U \
-V Fedora_backup \
/tmp/cd-rw.tar-a.backup.date \
/tmp/bin.tar.gz \
/tmp/boot.tar.gz \
/tmp/dev.tar.gz \
/tmp/etc.tar.gz \
/tmp/home.tar.gz \
/tmp/initrd.tar.gz \
/tmp/lib.tar.gz \
/tmp/misc.tar.gz \
/tmp/opt.tar.gz \
/tmp/root.tar.gz \
/tmp/sbin.tar.gz \
/tmp/var.tar.gz

# Erase a blank CD-RW
cdrecord -force blank=fast dev=0,0,0 speed=24

# Copy the CD image file to CD-RW
cdrecord -data -eject speed=24 dev=0,0,0 /makeCD/cd.image

# Clean up
rm /makeCD/cd.image
rm /tmp/*.tar.gz
rm /tmp/cd-rw.tar-a.backup.date
-------------------------------------------------------------------------------------------------------

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

shanenin 04-18-2004 04:58 PM

I was playing aroung with the tar options you used. As far as I noticed that does not preserve ownership, is that correct?

Do you manually change back the ownership of files after you reinstall?

jailbait 04-18-2004 07:33 PM

"Do you manually change back the ownership of files after you reinstall?"

I am not sure but I think that I have to change ownerships after I restore. That is only necessary for the files in /home and I can change them all with one command per user:

chown username:users /home/username -R

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Phorem 04-18-2004 08:24 PM

Thanks for the help Jailbait. I'm going to give lifeboat a go. I haven't opened it yet, but i hope i can write to my dvd+r. That would be sweet. I guess if cdrdao supports it, hopefully this will too.:D

jailbait 04-18-2004 08:35 PM

"i hope i can write to my dvd+r. That would be sweet. I guess if cdrdao supports it, hopefully this will too."

LifeBoat uses two cdrecord commands to write to CD-R or CD-RW. I have never tried it on DVD because I don't own a DVD. If you change LifeBoat to work on DVD how about sending me the changes to add to LifeBoat.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

bigrigdriver 04-18-2004 08:36 PM

There are two tar options you can add to the listed tar commands which will preserve permissions and ownership of files: -p (preserve permissions) and --same-owner.

You could probably get away without backing up much of what is on your system. For instance, anything you installed from CD, with the exception of config files in /etc. Why back up if you still have the CD's? Just reinstall, then restore the configs from backup. Then also backup any apps you installed from download (not on CD), unless you kept a copy in an archive somewhere ( you did, didn't you?).

r_jensen11 04-23-2004 11:10 PM

hey Shanen, why'd you post this on TheScreenSavers? I dislike that place now. Every episode I see on there says remedial stuff like "Learn how to speed up your PC!", then they say things that are Windows-specific. Not only that, but a simple google search could tell people the exact same thing. Then they advertise video editing software. Somehow, they end up praising Microsoft's Video Encoder, God only knows why. When I used that program, I set the settings to as high as they would go, and the picture quality was still horrid. I was trying to split Band of Brothers episodes so they could be viewd as chapters on VCD's instead of one huge video file....

Bottom line; The Screen Savers is for Windows users, they seemingly ignore Linux and Apple.


All times are GMT -5. The time now is 12:19 PM.