Dougal
August 28th, 2005, 05:48
Hi all,

A few months back I helped setup a Mini-itx running OpenBSD 3.6. The setup included 2 HDD's, a 2 gig laptop drive for the OS and a 300 gig full size drive for the data.. Now it turns out this wasn't worth it due to the heat the 2 drives push out so I'd like to convert to using the single 300 gig drive, ideally without having to copy all the data off and back on again..

Currently, the laptop drive is split into a number of partitions (/, /var, /tmp, etc....) and the large HDD is mounted as /data.. Is there any easy way I can transfer the existing config from the laptop drive to the big drive without loosing data and being left with a bootable system afterwards?

Thanks,

Martin

Kernel_Killer
August 28th, 2005, 20:07
Whatever your 300 is mounted as, like /datadrive, then move your stuff on that drive.

cd /datadrive
mkdir newdatadir
mv * newdatadir/

Then you should have all your stuff in /datadrive/newdatadir/ . Next, copy all your stuff from your root drive (laptop drive).

cp -ax / /datadrive

Next, run sysinstall and go to Configure, and Boot Manager, and set the 300G drive to be bootable, and install the boot loader. Make sure you change your new /datadrive/etc/fstab to have the 300G drive as the / and take the laptop drive mount out.

That is the easiest way. If you want to keep all the partitions seperate, you are going to have to resize your 300G drive, and add new partitions with bsdlabel. That is a risky way to make partitions, but the only way to keep your data without haveing to repartition the entire drive. If you want to do it this way, I can leave instructions on how to do so, but they must be followed accordingly, and carefully.

Dougal
August 29th, 2005, 07:31
Hi Kernel_Killer,

That sounds like a plan to me. I had hoped it would be possible without having to reinstall.

All being well I'll get through this over the next few days.

Thanks,

Martin

Dougal
October 1st, 2005, 11:28
Hi Kernel_Killer,

We stumbled at the copy stage :-

bash-3.00$ cp -ax / /data
cp: unknown option -- a
usage: cp [-R [-H | -L | -P]] [-fip] src target
cp [-R [-H | -L | -P]] [-fip] src1 ... srcN directory
bash-3.00$

It seems -ax are unknown switches on OpenBSD.

Any clues?