View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Search this Thread
Old 02-21-2006, 03:27 AM   #1
LQ Newbie
Registered: Feb 2006
Posts: 3

Rep: Reputation: 0
Migrating an existing linux install to new disks/hardware


I'm just looking for some advice as to how to proceed with migrating an existing Linux install (White Box Enterprise Linux 4). I'm a competent Linux admin but a bit weak with on the more advanced low level stuff required for this.

Here's some background: I setup a relatively low powered box to do a couple of peripheral tasks on our network. However due to another server's failure and a few other factors it has become quite central to our network, performing a number of critical tasks. Unfortunately, as it wasn't setup with this in mind, it is not on RAID, which is making me a bit nervous. However, due to the complexity of the install (it performs a dozen different jobs, some of which done by heavily customised applications) I am very reluctant to rebuild a new box from scratch.

So I have come across to the conclusion I have a couple of options:
  1. Add a RAID array to the existing server
  2. Migrate the server to a spare server that already has RAID

Given these options I'm looking for some general advice - can anyone spot potential pitfalls or benefits to either option?

For each option what are people suggestions on how to proceed? My current thoughts are:
  • Boot of a Linux "Live CD"
  • Create & initialise the RAID array
  • DD the data across "dd if=/dev/hda1 of=/dev/md0" or something along those line
  • Fiddle around with grub to get it to boot of the RAID device

Will this work? Use of DD particularly, tends to make me nervous! Are there some ghosting tools that may do the job better or are the simply wrappers for dd? Will Linux mind waking up on a completely different partition?

2) (I am more clueless about this option)
  • Boot of a Linux "Live CD"
  • ????
  • Profit (sorry: working Linux install, I mean)

Is this possible? Given we're talking fairly disparate hardware? Can you dd over the network? I would probably setup LVM regardless of what option I went for - would this cause additional problems?

Or, am I attempting something that's very likely to fail? Should I just stop being so lazy & rebuild the server? I've done a fair bit of this kind of crap with windows installs and can usually force them to run with judicous use of the "repair install" feature & manually selecting the correct HAL but *nix is obviously a different ballgame...

Old 02-23-2006, 05:22 PM   #2
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Does your department have a disaster recovery procedure? If so this sort of thing should be included in that document.

I believe that you run the risk of having these custom applications break when you transfer the data. Many applications are written such that device names such as disks are embedded either in the application or in the data files. This is true of SQL type database software. The data files have the path to themselves embedded in the file itself. If you move one of these files the SQL server will say that the file is invalid. In these cases the DBA has to alter the database files to refect the new location.

The first thing that you can do is to practice moving the system files to the other machine. You can try various methods. I don't know what would work. I haven't tried to move a Linux system to another machine. The basic idea that I am suggesting is that you can do this as practice many times without harming the production system. You can try installing the same distribution and verion of Linux on the target machine, then doing a backup to tape from the production machine, then restoring from tape on the target machine using the tar option of NOT replacing existing files. That's just one of many possible experiments which may or may not be useful.

As you say that you have highly customised applications then the risk of this sort of problem is high. I recommend that you become intimately familiar with these applications. You will eventually learn what they require to run.

If these highly customised applications are built on standard platforms such as an SQL database server then you may be able to hire a consultant to come in and do the port.

Lastly, I don't know if Linux uses this any longer but the kernel has some data about its configuration embedded in it. You can learn about this crazy stuff my reading the man page for rdev. As I say, Linux may ignore this data. I don't know. If not, then the fact that the boot device is one of these bits of data that is embedded in the kernel could cause a problem if you move the software to another machine.

The good that will come out of this is that you should have all of this covered in a disaster recovery procedure. If you don't currently have a disaster recovery procedure then this experiment and experience will provide the basis to start writing one.
Old 02-23-2006, 11:20 PM   #3
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
If you can use the same disk in the current server and the 'new server' one way would be to setup the current server with mirrored disk, then when the miror is up to date, shut it down and move 1 disk to the new server (also mirror disks) and use moved disk to start new server and update it's mirror disk.
Obviously backup to disk or tape before you start.
Old 02-24-2006, 03:29 AM   #4
LQ Newbie
Registered: Feb 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Does your department have a disaster recovery procedure? If so this sort of thing should be included in that document.
All our data & crucial config files are backed up - with a plan to rebuild the server from scratch if necessary. Not very quick but currently our only option.

One reason for attempting this migration is so we can setup LVM to take a full snapshot of the server, hence speeding up the recovery.

chrism01 - I was thinking along this lines. However as the new server has a big raid array which would be physically very tricky to put in the old machine I would probably put the old disk in the new server & use a rescue CD to do the copy.

However, judging by stress_junkie's opinion this seem quite unlikely to work. I was more interested to see how linux dealt with "ghost style" operations. I think the general gist is that it can cause a lot of problems?

Old 02-24-2006, 01:40 PM   #5
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I encourage you to try this migration. I tried to think of as many things that could cause a problem. You may not experience any of the problems that I mentioned. All of these problems can be overcome one way or another. Just don't expect the migration to work the first time that you try it. Using a Ghost image could work. If that doesn't work by itself then maybe tweaking the configuration of a Ghost image would work.

We all learned by trying new things. Hopefully my list of things that can go wrong will give you some ideas of where to look and what to try if the migration doesn't work right from the Ghost image. Or a new operating system installation on the new computer plus overwriting that with backup of the old computer is worth a try. That may work or it may not. You can certainly get the job done given enough time.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL 3: Steps of expanding file system (add new SCSI disks) to existing SW RAID & LVM atman1974 Linux - General 2 01-12-2006 09:49 PM
How do I install LFS over an existing Linux? ninjabob7 Linux From Scratch 2 11-30-2005 11:13 AM
Manage disks on an existing system with LVM doris Linux - Hardware 1 03-02-2005 02:37 PM
Install on existing Linux partitions May1950 Linare 0 09-15-2004 04:38 PM
easiest way to install another Linux distro alongside existing linux frontier1 Linux - Newbie 10 03-22-2003 05:10 PM

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration