gzipping root partition: will it work.?

Status
Not open for further replies.

shady_inc

Pee into the Wind...
Hi there.!

I have an Arch Linux installed on a 5 GB partition.I plan on buying a new hard disk soon and have only Arch's root partition plus a home partition on it.Will gzipping the current root partition and then gunzipping it on the new hard disk's root partition work, since I really don't wanna reinstall Arch again.

Thanks.
 
OP
shady_inc

shady_inc

Pee into the Wind...
Guess it will work, but also do the necessary changes to the bootloader configuration.
A bit of reading the man pages tells me that tarring / will be a better option than gzip..Running tar -cvf / will include even my home partition in tar file.How do I ignore the /home partition from being included in the tar file.?
 

adi007

Youngling
Hmmm... how about creating the images using some live cd or Norton Ghost or Drive Image and then restoring the backup ...?
I think their is a Open source software too but forgot the name :p
 

QwertyManiac

Commander in Chief
--exclude=home perhaps?

Tar it via an external source? (Live CD, even Windows?) So that you can mount only / and not /home/ and thus tar worry-free. Do mind the permissions, they have to remain consistent. :)

Why not gzip? Its just got compression (Lempel Ziv). You anyways would have to extract it via a Live CD or so I guess?
 
OP
shady_inc

shady_inc

Pee into the Wind...
The good old cp command did the trick.! :p
I booted in a Knoppix LiveDVD, mounted only my Arch root partition and the would-be root partition and then ran the command :

cp -pidvxR /old_partition/* /new_partition/

The options mean:
p - preserve file permissions, timestamps etc...
i - prompt before overwrite (just in case).
d - To copy symlinks as symlinks rather than the file they point to.
v - to be verbose about the process.
x - To stay on one filesystem.
-R copy recursively.

Works like a charm.Now I can truly say I will NEVER EVER have to re-install Arch Linux again.! :p

BTW, don't forget to make appropriate changes to /boot/grub/menu.lst and /etc/fstab after copying..

Another BTW: I could have perhaps run to cp command from within Arch, but it was the special directories like /proc and /dev that had me worried.So I chose a liveCD for the task.
 
Last edited:
Status
Not open for further replies.
Top Bottom