View previous topic :: View next topic |
Author |
Message |
shepmaster Tux's lil' helper
Joined: 20 May 2004 Posts: 105
|
Posted: Sat Dec 13, 2008 9:08 pm Post subject: [solved]best way to copy partitions from old machine to new? |
|
|
This is my current setup:
Machine 1 - Current computer
3-disk RAID0+1 (it's strange...) w/ LVM
about 250 GB of data
Machine 2 - New computer
3-disk RAID5
about 1.5 TB of space
I want to move all of my data from machine 1 to 2, while hopefully minimizing downtime. My current plan is something like the following:
- drop machine 1 to a lower runlevel (boot? default?)
- try to stop as many services as possible on machine 1
- copy the files over for each partition from machine 1 to 2 *
- chroot on machine 2
- fix things like fstab and grub
- shut down both machines, swap places, restart
Copying
One trick is that I have to do this over the network - neither machine has enough power or [PS]ATA ports to handle all the drives. These machines are connected to each other via GigE. I plan on using tar over SSH to get the best speed - jnettop reports about 18-21MB/sec in some isolated tests I have tried. If, for some reason the copy fails, I'll probably fallback to rsync, as hopefully the savings in transfer will counteract the checksumming time.
So my question is, does this seem like a workable solution? Is there something I have forgotten? Something better I should know?
Thanks!
Last edited by shepmaster on Mon Dec 15, 2008 4:31 pm; edited 1 time in total |
|
Back to top |
|
|
poly_poly-man Advocate
Joined: 06 Dec 2006 Posts: 2477 Location: RIT, NY, US
|
Posted: Sat Dec 13, 2008 10:38 pm Post subject: Re: best way to copy partitions from old machine to new? |
|
|
use rsync. Leave machine 1 as-is, simply exclude /var/log (should really be the only spot written to, right?)... worst case, remount some of your partitions ro for a little while. No downtime at all in ideal conditions.
ftp is another option, scp if you hate yourself (this... is... slow... compared to others at least.) _________________ iVBORw0KGgoAAAANSUhEUgAAA
avatar: new version of logo - see topic 838248. Potentially still a WiP. |
|
Back to top |
|
|
shepmaster Tux's lil' helper
Joined: 20 May 2004 Posts: 105
|
Posted: Sun Dec 14, 2008 4:10 am Post subject: Re: best way to copy partitions from old machine to new? |
|
|
poly_poly-man wrote: | use rsync. Leave machine 1 as-is, simply exclude /var/log (should really be the only spot written to, right?)... worst case, remount some of your partitions ro for a little while. No downtime at all in ideal conditions.
ftp is another option, scp if you hate yourself (this... is... slow... compared to others at least.) |
Interesting point about mounting the partitions read-only. I'll probably do that regardless, as it is a good way to force nothing to change.
When you suggest that only /var/log should be written to, do you mean even with services running? I know that won't be totally true in my case - mail goes to a special partition, mythtv might record to another partition, etc. However, those are all things I've changed to specifically write to those locations. Here are what services I currently have running, do you have any specific suggestions for what to stop, and what could keep running?
Code: | apache2
atd
bootmisc
checkfs
checkroot
clock
consolefont
dbus
ddclient
dnsmasq
dovecot
hald
hostname
hotplug
iptables
keymaps
local
localmount
mdadm
metalog
modules
mysql
mythbackend
net.lan0
net.lan1
net.lan2
net.lan5
net.lo
net.wan
netmount
nfs
ntp-client
ntpd
numlock
portmap
postfix
proftpd
rmnologin
samba
saslauthd
snmpd
sqlgrey
sshd
upsd
upsdrv
urandom
velocity
vixie-cron |
|
|
Back to top |
|
|
poly_poly-man Advocate
Joined: 06 Dec 2006 Posts: 2477 Location: RIT, NY, US
|
Posted: Sun Dec 14, 2008 3:28 pm Post subject: Re: best way to copy partitions from old machine to new? |
|
|
shepmaster wrote: | dnsmasq
dovecot
mysql
mythbackend
nfs
ntp-client
postfix
samba
sqlgrey |
kill those definitely... if your ftp server allows writes, kill it to.
To be safe, touch /etc/nologin as well. _________________ iVBORw0KGgoAAAANSUhEUgAAA
avatar: new version of logo - see topic 838248. Potentially still a WiP. |
|
Back to top |
|
|
shepmaster Tux's lil' helper
Joined: 20 May 2004 Posts: 105
|
Posted: Mon Dec 15, 2008 4:30 pm Post subject: |
|
|
Everything worked out mostly OK - I decided to stop almost all of the services except for dnsmasq - it was too nice to not have to set up the network by hand.
I booted from the livecd, then mounted my new partitions in /mnt/gentoo. I then ran rsync like so:
Code: | $ rsync -av --progress --stats --exclude='/dev*' --exclude='/sys*' --exclude='/proc*' -e 'ssh -c arcfour' /mnt/gentoo/ root@192.168.3.1:/ |
The -e 'ssh -c arcfour' was an attempt to minimize how much processing had to be done to encrypt the transport - I only had these two computers connected to each other. I would have preferred no encryption, but my ssh didn't have the "none" cypher, and I didn't have rsh installed.
The only thing that bit me was the exclude of /dev*. Turns out, you need /dev/null and /dev/console to successfully boot. After failing to boot once, I checked the Gentoo udev guide and created those two nodes. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|