DIGIT-ARC read-only archive · snapshot: July 23, 2026

gzipping root partition: will it work.?

8 posts · originally from https://geek.digit.in/community/threads/gzipping-root-partition-will-it-work.101023/

shady_inc
shady_inc Original post #1
Nov 1, 2008 at 11:46 AM
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.
QwertyManiac
Nov 1, 2008 at 2:55 PM
Guess it will work, but also do the necessary changes to the bootloader configuration.
shady_inc
Nov 1, 2008 at 8:42 PM
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.?
A
adi007 #4
Nov 1, 2008 at 8:56 PM
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
Nov 1, 2008 at 9:05 PM
--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?
shady_inc
Nov 1, 2008 at 10:02 PM
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.
Faun
Faun #7
Nov 1, 2008 at 10:05 PM
time to party :D
QwertyManiac
Nov 1, 2008 at 10:20 PM
aren't proc and dev supposed to be "mounted"? :p