[plug] reinstall for new core hardware?

Craig Ringer craig at postnewspapers.com.au
Mon Jan 5 16:50:04 WST 2004


Ben New wrote:
> Hi all,
> 
> I have a machine running all the usual server-side suspects (web, mail, 
> dns, etc).  If I was to take the hard drives from that box (machine A) 
> and put them into another (machine B), including the OS partitions 
> (containing /, /usr, /etc...), would machine B boot?

You might need to reinstall the MBR if the arrangement of the disks 
changes (eg if you used to have your boot disk on a PCI ATA controller), 
but otherwise it should boot fine. If you're using GRUB, this is no fuss 
at all - make a GRUB floppy before you move the disks, just in case.

The only thing you're likely to need to change is the ethernet driver, 
but since you're running mdk you may not even need to do that - it's 
likely to autodetect the change.

If you're using a stock kernel, then your ATA controllers, etc, will be 
used automatically and without complaint. You'll need to recompile the 
kernel for the new hardware if you're using a custom kernel and have cut 
out unused disk drivers, but otherwise it's not an issue.

> Obviously there will need to be a kernel compile in there somewhere (in 
> my case, probably about 5 or 6 before I get it right) with the increased 
> number of processors and probably other things (?)

Uniprocessor kernels run fine on SMP. Once you've got it moved across, 
you can install an SMP kernel and boot into it. If you're using stock 
kernels, you can probably just use 'urpmi' to get the SMP build of your 
kernel and be done with it.

I strongly suggest that if you're using a custom kernel, you install the 
stock uniproc and SMP kernels for the transition (you can obviously keep 
your custom one installed too). After the move, you can build a new 
custom kernel for the box. The stock kernels have /everything/ enabled 
and built as modules, so whatever the distro needs to support the 
hardware will be available.

I'm increasingly running my systems on stock kernels anyway. Unless I 
need special patches for the system, I don't see the need to do a custom 
one.

> What I'm mostly interested in is the boot process, the first time in the 
> new box.  Will the OS cope with the changes to the entire set of system 
> resources?

You'll see an extreme case of 'failure to care'. The linux kernel 
detects everything anew everytime it boots anyway, so only modules 
loaded by userspace matter.

As James noted, you may also need to fix the fstab if you rearrange your 
drives. If you need to, just boot the system with 'single' on the kernel 
command line, edit the fstab, and reboot.

> How automated will the process of detecting and installing 
> the correct drivers be?  

Depends on the distro. If your install has 'kudzu' or something like it, 
it should detect the (few) required changes and make them without any 
fuss. Again, this works better with a kernel (like the stock ones) where 
all network drivers are built as modules.

> Will it be easier to just save the contents of 
> /etc and a few other locations, wipe the rest of the OS and reinstall, 
> then copy back /etc (etc)?

No.

> I'm not even sure if this is a general Linux question, or more 
> specifically a Mandrake question (probably both actually) so any advice 
> or info would be appreciated.

General linux, mostly. Hardware auto-detection varies between distros (

Craig Ringer




More information about the plug mailing list