Is it possible to clean install Ubuntu onto new HDDs whilst running existing system?

2

I currently have Ubuntu 11.04 installed on a single non-RAID 160GB hard drive.

I've just bought some 500GB drives and want to end up with Ubuntu 11.04 installed on a RAID 1 array with exactly the same setup as current exists.

Can I do a clean install of Ubuntu on the RAID disks from within my current Ubuntu installation and then install packages and copy over config files etc? (In my head that doesn't sound possible, unless I can dual boot two copies of Ubuntu and could remove the current install once I was setup.)

Or even better, somehow copy my existing setup over onto the RAID array, rather than having to reinstall and set everything up again?

Jon

Posted 2012-02-24T13:25:31.103

Reputation: 345

Answers

0

I couldn't get either of the other two answers to work for me, and had trouble installing Ubuntu 11.04 using the alternate ISO anyway. I clearly don't have a good enough grasp on GRUB.

I ended up doing a clean install of Ubuntu onto the new drives and then copying over /etc files and /home files and reinstalling all the required packages again, a little bit like this.

Jon

Posted 2012-02-24T13:25:31.103

Reputation: 345

2

See also Is it possible to install Ubuntu from another Linux system? (Gentoo in my case)

What I would do in this situation: - Boot from the old system with the new drives installed - Create partitions on the new array - rsync everything across to the new array - shut down and remove old drive - boot from CD in 'repair' mode - get the CD to fix the bootloader without reinstalling anything

The last step is the difficult one; I know it's possible with CentOS install CDs, not quite sure how to do it with Ubuntu.

The other way to fix the bootloader is to mount the new drives at /newroot on the old system, then do "chroot /newroot bin/bash; grub-install /dev/(newdrive)"

pjc50

Posted 2012-02-24T13:25:31.103

Reputation: 5 786

1

Boot either from a livecd or into rescue mode, format the new drives, mount it, and copy the system over. If you mount the destination drive in /mnt, then just do:

cp -ax / /mnt

If you do this from a livecd, you will have to moun both the source and destination somewhere and so the source for the cp command will not be /. If you have multiple partitions ( like one for /home ) then you will need to copy those as well.

After that, install grub2 on the destination drives.

psusi

Posted 2012-02-24T13:25:31.103

Reputation: 7 195