LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can you tar or rename / ? (https://www.linuxquestions.org/questions/linux-newbie-8/can-you-tar-or-rename-565403/)

tongar 06-29-2007 11:36 AM

Can you tar or rename / ?
 
Hi,

My situation involves a lot of Linux testing where I need to get back to a clean Linux OS state repeatedly after testing.

What techniques could I use to do this?

My newbie thinking (please don't try this as home) was that after I installed and tweaked the system to the init state, I would:

1. tar / to root.tar

when I needed to go back to that state:

2. rename / to oldroot
3. untar root.tar
4. delete oldroot
5. reboot

The commands may not allow this. Also, this may not work as Linux likes to touch files when it does stuff.

thanks for any ideas,
fred

MensaWater 06-29-2007 11:41 AM

You can't "rename /" because it is "root" and is the top (or bottom) of the file heirarchy.

If you have a burner you might want to get something like mondorescue which allows you to save your system as loaded then reload it later.

Alternatively you could try something like VMWare or Xen to make virtual servers that you can clone and trash at will under the main server install.

ComputerBob 06-29-2007 11:58 AM

It doesn't compress my root partition, and it's not especially fast, but I use a bootable LiveCD of GParted to copy my PC's entire root partition onto my external hard drive. (I use the bootable LiveCD so that my PC's root partition won't be "in use" when I copy it.) Then, when I want to get things back to the way they were, I use the bootable LiveCD of GParted to delete my PC's messed-up root partition and copy my backup of it onto my PC from my external hard drive.

In the past year, I've experimented with things enough that I've had to restore my root partition to its previous pristine state at least 5 times, and GParted has never given me any problems.

stealth_banana 06-29-2007 12:06 PM

Why don't you use partimage ( http://www.partimage.org/ )

You can compresss the image.

Run it from a live cd and back up to another partition or external HD. When you want to restore, just chuck it back on. Quick and painless.

ComputerBob 06-29-2007 12:19 PM

Quote:

Originally Posted by stealth_banana
Why don't you use partimage ( http://www.partimage.org/ )

You can compresss the image.

Run it from a live cd and back up to another partition or external HD. When you want to restore, just chuck it back on. Quick and painless.

That's a really good question - one that I'm going to have to think about. I started using GParted back when I didn't know about all of the other Linux backup choices.

At one point, I did start using Partimage instead of GParted, but then I switched to using the GParted/Clonezilla bootable LiveCD, because IIRC, Clonezilla uses Partimage, but Clonezilla adds some feature(s) of its own.

Unfortunately, even as recently as last month, Clonezilla insisted on rewriting GRUB on my MBR every time I restored my Linux root partition, EVEN when I told it NOT to. That messed up my Windows XP dual-boot's MBR every time, forcing me to repair XP's MBR and then manually reinstall GRUB every time. After a few times of doing that, I finally gave up on using Clonezilla, went back to using GParted, and (probably) forgot all about using Partimage itself. :scratch:

So maybe it's time for me to take another look at using Partimage to image my Linux root partition. Thanks! ;)


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