среда, 7 июля 2010 г.

Moving data to FreeBSD

Now I decided to move from OpenSolaris to FreeBSD.
Just for now I emulate this procedure in VirtualBox, later I'll do it on real hardware...
1) Installed OpenSolaris 09.06 and updated it to b134, updated zfs pool to version 19, added mirror disk to pool. So, I have configuration identical to my workstation.
2) Splitted pool (used zpool split for this task), destroyed second pool (which appeared as result of split) and filled first sectors of disk with zeroes (dd if=/dev/zero of=/dev/rdsk/) to erase all signs of zfs pool.
3) Booted from FreeBSD dvd (i386) and made everything similar to http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition. Some caveats: I didn't manage to get zpool.cache from first time, had to import/export pool to get it. At the end of the procedure I got zfs pool consisting from /dev/ad1s1.
4) After some time I managed to boot from my pool (made several errors during install, e.g. forgot about zpool.cache and accidentally wrote wrong rc.conf).
5) Booted in OpenSolaris and imported my pool under alternative /fbsd root. Create on the FreeBSD zfs pool filesystem /old and zfs send all data from OpenSolaris /export fs there.
6) Rebooted. Couldn't boot FreeBSD. So I booted from FreeBSD DVD, imported ZFS pool and moved /boot/zfs/zpool.cache to zpool's /boot/zfs/zpool.cache
7) Now I have running ZFS FreeBSD installation
a) add second mirror drive (old OpenSolaris drive) to new ZFS pool and put boot code and loader there.
b) tune i386 FreeBSD for ZFS usage...

After completing these tasks I'm going to make this procedure on physical system... (Certainly, after creating backup...)

3 комментария:

  1. I've just added second disk to the pool and added loader to second disk. Everything worked fine.
    Some troubles:
    1) After changing zpool configuration using LiveCD you need to copy zpool.cache to /boot/zfs/ on your ZFS pool.
    2) To write booter on second disk while ZFS pool is mounted you have to offline disk, write booter and after this procedure take it online.

  2. Some updates on this story. I've just installed FreeBSD 8.1 on one disk from Solaris zfs mirror. Unfortunately, I forgot to detach this disk from Solaris pool. Now I have FreeBSD on one disk and OpenSolaris on other. However I hit OpenSolaris 6923585 bug and couldn't boot OpenSolaris. (I wanted to move my data from OSOL rpool to FreeBSD zpool, OpenSolaris can work with FreeBSD pool, but not vice versa). So I have to burn OpenSolaris b134 CD to copy my data...

  3. One more difficulty: OpenSolaris b134 uses ZFS version 4. FreeBSD understands ZFS v3. So, zfs send|zfs recv is not a decision, but. as always, tar helps in this siutation.