You are not logged in.

#1 2011-06-07 18:07:35

awayand
Member
Registered: 2009-09-25
Posts: 398

[SOLVED] cloning arch system root partition live with rsync

Hello,
I need to clone my existing arch installation to a different partition, that is, copying the entire root directory "/" to another partition. Small problem: I cannot boot from a different device, so I have to do the cloning live while booted from my root partition.

I have tried rsync with the -avz option and excluding /proc, /sys and /dev but for some reason I get tons of errors when booting from the cloned drive, even if I include /dev in the rsync I get errors.

Anyone know the best way to do what I want? Do I have to exclude other directories maybe?

Thanks!

PS: Yes, there are lots of threads with cloning questions, but none of them seem to need a solution for "live" cloning....

EDIT: on marking this solved, I'd like to add there sure is a way to do this, but noone really bothered to figure it out. I wish there was an easy way like on Windows, where you can just launch drive snapshot.exe on a live running system and clone the entire partition while working normally...

Last edited by awayand (2011-06-14 11:11:53)

Offline

#2 2011-06-07 19:06:00

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED] cloning arch system root partition live with rsync

When you say you cant boot from a different device - does this mean both usb and cd?
Often 'thin' machines don't have cd's but no probs booting from a usb ... ('grml' to me is the best thing since sliced bread!! - www.grml.org)

Offline

#3 2011-06-07 19:29:36

dolik.rce
Member
From: Czech republic
Registered: 2011-05-04
Posts: 43

Re: [SOLVED] cloning arch system root partition live with rsync

I think that what you want is something like:

dd if=/dev/sda of=/dev/sdb

It makes a precise copy of the partition /dev/sda to /dev/sdb. But be VERY careful and read man dd VERY thoroughly before trying it! Dd is an extremely dangerous tool and can wreck your data if not used properly. I warned you wink

If I were you I would rather think about USB boot or booting over network...

Offline

#4 2011-06-07 19:55:03

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] cloning arch system root partition live with rsync

If you can't boot from another device, how did you install Arch in the first place?

Offline

#5 2011-06-07 20:29:01

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] cloning arch system root partition live with rsync

Don't use dd from a live system, it won't work. Unless you're very lucky, I guess... (If anything writes to the disk during the copy, you're screwed.)

Instead of explicity excluding /dev, /proc and /sys, you could try the -x option (--one-file-system). It might help... Or not smile.

Offline

#6 2011-06-08 13:31:29

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED] cloning arch system root partition live with rsync

*chuckles* it would seem that the OP has gone AWOL ...

Other than that - +1 for "ANOKNUSA"!

'dd' on two disks is a toil cuz you copy gigabytes that have not been used yet - and if your target disk is smaller than your original - well ...

Me - I use Alan Cox's ...

(cd $SRC && tar cf - .) | (cd $TARGET && tar xvpf -)

- and absolutely and undeniably on a non-running system - use a live CD/usb ...
Then install the bootloader and edit fstab and Bob's your uncle.

Last edited by perbh (2011-06-08 13:41:02)

Offline

#7 2011-06-08 13:55:15

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] cloning arch system root partition live with rsync

well I guess there is no way of doing a "live" cloning. I went the grml route. and YES, I HAVE GONE AWOL!!!!

Offline

Board footer

Powered by FluxBB