FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-29-2012, 04:35 AM
Joe Aquilina
 
Default Need advice on cloning Debian server

Hello all.

I am relatively new to Linux/Debian and need some advice on "cloning"
a Debian system.


At work we have a Debian file server, running Squeeze, which needs to
be cloned to new hardware and then the old machine will be retired.
It is a file server for a small office, has 4 smallish SATA drives
and is setup with RAID 5 and LVM.


A new faster system has been built with two 2Tb SATA drives (plenty
of room to grow) and we want to set this up with RAID 1 and again LVM.


My inexperience with Linux in general and Debian means that I am
unsure how to do this efficiently, given that we are going from a 4
disc RAID 5 setup to a 2 disc RAID 1 setup instead. I recently
successfully did something similar with another server we had but
that was a RAID 1 system being cloned to a newer RAID 1 box. However,
I am unsure how to achieve a swap from the 4 disc RAID 5 setup to a 2
disc RAID 1 setup.


My thought is that I should install Debian squeeze on to it and get
it running with RAID & LVM, with partitions, logical volumes etc.
matching the original file server, and then use rsync to copy all the
data files over the internal network. I expect that this, as a
minimum, will mean a new IP address for the new box, fstab, hosts and
other changes on it compared to the original server.


Is this likely to be a major issue to sort out once the new system
has been setup? If so, what would the best way to "fix" the new
system once Debian is installed onto it? Can I also rsync the
contents of the /etc, /usr, /var, /boot, /root etc. directories or
will this cause problems (I suspect it will)? Is there anyway of
creating as exact a clone of the old system onto the new hardware as
possible? If so, how do I achieve this?


Any guidance or advice from those much wiser and more knowledgeable
than me would be appreciated.


Hope I have been clear enough above regarding what I want to achieve.
What else might you all need to know to be able to advise or suggest
how I can do the job?


Thanks in advance.

Joe Aquilina


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joe Aquilina PO Box 819 Morley WA 6943
Mobile: 0428 216069
rhadmirri@westnet.com.au or joeaquilina@westnet.com.au


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: a3njj0$nmh7n6@outbound-mail04.westnet.com.au">http://lists.debian.org/a3njj0$nmh7n6@outbound-mail04.westnet.com.au
 
Old 05-29-2012, 07:25 AM
Joe
 
Default Need advice on cloning Debian server

On Tue, 29 May 2012 12:35:40 +0800
Joe Aquilina <rhadmirri@westnet.com.au> wrote:

>
> My thought is that I should install Debian squeeze on to it and get
> it running with RAID & LVM, with partitions, logical volumes etc.
> matching the original file server, and then use rsync to copy all the
> data files over the internal network. I expect that this, as a
> minimum, will mean a new IP address for the new box, fstab, hosts and
> other changes on it compared to the original server.
>
> Is this likely to be a major issue to sort out once the new system
> has been setup?

Probably not major, but many minor issues depending on how long the
server has existed, and how many custom scripts are installed. A lot
depends on what software is installed.

> If so, what would the best way to "fix" the new
> system once Debian is installed onto it? Can I also rsync the
> contents of the /etc, /usr, /var, /boot, /root etc. directories or
> will this cause problems (I suspect it will)? Is there anyway of
> creating as exact a clone of the old system onto the new hardware as
> possible? If so, how do I achieve this?

No, I don't think so. You would use the dpkg --get-selections method to
install the same software, and in many cases the same configuration
file would work, but not all. Quite likely, you're moving from 32 bits
to 64, so all new software is a good idea, even if the 32-bit version
should work. Using grep to search /etc and /var will help for most
things. If you use bind, make sure you know where its databases are, as
there are two popular locations. Don't bother copying mysql or openldap
files, dump the databases to SQL and LDIF respectively, and import,
and do this if you can with other software that maintains databases.

>
> Any guidance or advice from those much wiser and more knowledgeable
> than me would be appreciated.
>
Maybe 'more experienced'. I'm in the final stages of doing this with a
home/small business server. and tentatively shut the old one down
yesterday. I think it's all over, but I'm not moving it until I'm
certain. I haven't got around to testing the Radius server yet, and
possibly other lesser-used things, and there are probably a few more
gotchas to come.

Don't forget the client machines. Ideally they should have automatic
everything, and nothing should need to be changed, but shortcuts may
have been taken in the past to get things working and IP addresses or
hostnames may be hard-coded here and there.

I use two workstations, one Windows 7 and one Debian sid, and a laptop
running Windows XP most of the time. None of them would get a DHCP
address from the new server. I could see nothing wrong, though it
looked as if hardly any broadcasts were happening. I set fixed
addresses and carried on with more important things. I didn't change
anything in the DHCP server (apart from addresses and hostnames, the
old config file had been suitable, as with the sid DHCP client) and had
reset the laptop to automatic for use somewhere else. A few days later,
I realised it was working fine on the home network and on checking, it
had clearly picked up DHCP OK. The sid machine would now work with
DHCP, and only the Win7 machine is still giving trouble, but now I am
confident the DHCP server is OK. The clients, including a sid machine,
seem to have had great difficulty in transferring their allegiance to a
new server. The old DHCP server was, of course, one of the first
daemons shut down.

Another gotcha is samba. If you're making use of browsing of shares,
reduce the OS level of the old samba server. If you don't, the new
server will never win a browser election, and that will cause some
subtle problems. You'll still be relying on the old server to collect a
browse list. If as in my case, the servers are two-NIC machines
functioning as firewalls, and you pull out the external connection of
the old machine, it will not see any shares in that network. I spent
about two hours chasing that one down.

Best of luck.

--
Joe


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120529082557.63e4899c@jretrading.com">http://lists.debian.org/20120529082557.63e4899c@jretrading.com
 
Old 05-30-2012, 02:40 PM
Camaleón
 
Default Need advice on cloning Debian server

On Tue, 29 May 2012 12:35:40 +0800, Joe Aquilina wrote:

> I am relatively new to Linux/Debian and need some advice on "cloning" a
> Debian system.

Then I'd ask for someone with more experience can help you with this
because cloning a full system on different hardware with the setup you
describe is not an easy task. Seriously.

> At work we have a Debian file server, running Squeeze, which needs to be
> cloned to new hardware and then the old machine will be retired. It is a
> file server for a small office, has 4 smallish SATA drives and is setup
> with RAID 5 and LVM.

(...)

I used in the past Clonezilla (LiveCD) to achieve the same but with a
simpler setup (non-raided, non-lvm system), so the main things to care
about would be the LVM volume, the raid layout (I think Clonezilla does
not support mdadm, you will have to manually configure the raid) and also
the boot loader.

Rsync, as you mention, can be also an option but I can't comment on this
because I have no previous experience in cloning with that tool.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jq5bhm$l92$7@dough.gmane.org">http://lists.debian.org/jq5bhm$l92$7@dough.gmane.org
 
Old 05-30-2012, 03:09 PM
Shane Johnson
 
Default Need advice on cloning Debian server

I haven't actually done it, but you should be able to boot to a live
CD initialize the raid and LVM and then add a removable HD to the VG.
Create new LV's the same size as your existing ones but make sure
you create them on the removable PV then use dd or similar to clone
the LV's. Once cloned you can vgsplit to make the removable drive
it's own VG that you can then make inactive with vgchange then remove
and move to the new hardware. Once on the new hardware you vgmerge to
make it all one VG then pvmove the LV's from the removable drive to
the new hardware. Once that is done you can vgreduce to remove the
external HD from the VG and then pvremove to remove the LVM info from
the external. if your system can't be down that long, you might be
able to snapshot from the live cd then reboot the old system and then
do the cloning and transferring based from the snapshot. Again -
sorry but I haven't done this to a running OS just to virtual machines
so this is a lot of theory. Another option, (that I have absolutely
no experience with,) is doing the same thing over a SAN. Another
thing that you will want to pay particular attention to is making sure
fstab and grub2 are configured properly for the new system. I am sure
where you have a working system you already know this, but for those
who find this and want to put LVM on top of a raid with Grub2, make
sure you create the raid with the .9 version of the metadata or Grub2
won't work with it.

Hope this helps
Shane

On Wed, May 30, 2012 at 8:40 AM, Camaleón <noelamac@gmail.com> wrote:
> On Tue, 29 May 2012 12:35:40 +0800, Joe Aquilina wrote:
>
>> I am relatively new to Linux/Debian and need some advice on "cloning" a
>> Debian system.
>
> Then I'd ask for someone with more experience can help you with this
> because cloning a full system on different hardware with the setup you
> describe is not an easy task. Seriously.
>
>> At work we have a Debian file server, running Squeeze, which needs to be
>> cloned to new hardware and then the old machine will be retired. It is a
>> file server for a small office, has 4 smallish SATA drives and is setup
>> with RAID 5 and LVM.
>
> (...)
>
> I used in the past Clonezilla (LiveCD) to achieve the same but with a
> simpler setup (non-raided, non-lvm system), so the main things to care
> about would be the LVM volume, the raid layout (I think Clonezilla does
> not support mdadm, you will have to manually configure the raid) and also
> the boot loader.
>
> Rsync, as you mention, can be also an option but I can't comment on this
> because I have no previous experience in cloning with that tool.
>
> Greetings,
>
> --
> Camaleón
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/jq5bhm$l92$7@dough.gmane.org
>



--
Shane D. Johnson
IT Administrator
Rasmussen Equipment


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAPLO1L7_irsWa1fE-TzRv4D9AoFdEwjpvfVAySe8z1rxhzswSA@mail.gmail.com"> http://lists.debian.org/CAPLO1L7_irsWa1fE-TzRv4D9AoFdEwjpvfVAySe8z1rxhzswSA@mail.gmail.com
 
Old 05-30-2012, 03:55 PM
Tom H
 
Default Need advice on cloning Debian server

On Wed, May 30, 2012 at 11:09 AM, Shane Johnson
<sdj@rasmussenequipment.com> wrote:
>
> I am sure where you have a working system you already know this, but for
> those who find this and want to put LVM on top of a raid with Grub2,
> make sure you create the raid with the .9 version of the metadata or
> Grub2 won't work with it.

No and just set up a VM to prove it.

root@debmdraid:~# fdisk -l /dev/sda | grep /dev
Disk /dev/sda: 21.5 GB, 21474836480 bytes
/dev/sda1 * 2048 41940991 20969472 fd Linux raid autodetect

root@debmdraid:~# fdisk -l /dev/sdb | grep /dev
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
/dev/sdb1 2048 41940991 20969472 fd Linux raid autodetect

root@debmdraid:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5]
[raid4] [raid10]
md0 : active raid1 sdb1[1] sda1[0]
20968376 blocks super 1.2 [2/2] [UU]

root@debmdraid:~# pvs
PV VG Fmt Attr PSize PFree
/dev/md0 vg-sysroot lvm2 a- 20.00g 0

root@debmdraid:~# vgs
VG #PV #LV #SN Attr VSize VFree
vg-sysroot 1 1 0 wz--n- 20.00g 0

root@debmdraid:~# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lv-sysroot vg-sysroot -wi-ao 20.00g


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAOdo=Sys8q-aox+ToATn2BoEM+4KxwcgN-MEN6BNA=1HGyBW6g@mail.gmail.com">http://lists.debian.org/CAOdo=Sys8q-aox+ToATn2BoEM+4KxwcgN-MEN6BNA=1HGyBW6g@mail.gmail.com
 

Thread Tools




All times are GMT. The time now is 08:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org