Post installation creation of a ZFS partition...

I have a machine with two 2GB drives, seen by FreeBSD as ad4 and ad6. At install time, I created a small (4GB) partition in ad4 (ad4s1), and installed FreeBSD inside it (so it has slices).

Code:
$ ls -l /dev/ad[46]*
crw-r-----  1 root  operator    0,  89 Sep  5 19:51 /dev/ad4
crw-r-----  1 root  operator    0,  90 Sep  5 19:51 /dev/ad4s1
crw-r-----  1 root  operator    0,  91 Sep  5 21:51 /dev/ad4s1a
crw-r-----  1 root  operator    0,  92 Sep  5 19:51 /dev/ad4s1b
crw-r-----  1 root  operator    0,  93 Sep  5 21:51 /dev/ad4s1d
crw-r-----  1 root  operator    0,  94 Sep  5 21:51 /dev/ad4s1e
crw-r-----  1 root  operator    0,  95 Sep  5 21:51 /dev/ad4s1f
crw-r-----  1 root  operator    0,  96 Sep  5 19:51 /dev/ad6

Now, I wanted to create a ZFS mirror, formed from the rest of ad4, and the complete ad6. I therefore booted my FreeBSD, invoked sysinstall, and

1. sysinstall
2. Configure
3. Fdisk
4. selected ad4
5. selected the unused space
6. pressed C
7. pressed enter when asked about space
8. pressed W
9. selected none when asked about boot manager.

FreeBSD complained about:

Code:
    ERROR: unable to write data to disk ad4! 
    To edit the labels on a running system set sysctl kern.geom.debugflags=16 
    and try again.

So I did as it suggested, and this time, Fdisk responded with
Code:
Write sucessful
All seemed to be OK.

I did the same process for ad6 (created a single huge partition, ad6s1).

And then tried to create a ZFS pool from the two (using mirroring):

zpool create zroot mirror /dev/ad4s2 /dev/ad6s1

But apparently, even though ad6s1 was there, ad4s2 ... was missing! I thought - maybe the kernel needs to see the partition table upon booting and can't tolerate changes during runtime - so I rebooted and got:
Code:
Invalid partition table.

Boot failed :-(

What did I do wrong? And more importantly, how can I recover?

Thanks in advance for any help,
Thanassis.
 
Your problems have started when you used sysinstall. Only use it for the initial install and never ever after that.

It's quite likely you've nuked your original slices/partitions. There may be a way to restore it but I would suggest a reinstall as it's usually quicker.
 
Well, even if it is too late - can you show me the explicit commands with the arguments I should have used to create the two partitions without sysinstall?
 
ttsiod said:
Just a quick note: the link you pointed to does include "sysinstall" in the suggestions...

I know, just skip that bit ;)

Sysinstall is horrible and about to be surgically removed anyway (9.0-RELEASE will use a different installer).
 
Back
Top