# More installation troubles: ZFS on 8.0



## tjr (Nov 8, 2009)

I am trying to reinstall the 8.0 with ZFS on root using this guide.  I was able to successfully install everything once using that guide, but I ended up having to reinstall and now following the same directions does not result in a bootable HDD.  The BIOS simply reports that there are no bootable drives.  Anyone have any ideas?


----------



## mousaka (Nov 8, 2009)

To start completely over, you must delete the partition table.
Run the following commands before step 3 in the mentioned guide:

```
# dd if=/dev/zero of=/dev/ad0 bs=1k count 1
# dd if=/dev/zero of=/dev/ad1 bs=1k count 1
```

mousaka


----------



## tjr (Nov 8, 2009)

Unfortunately that's not it.  Even after using dd to wipe the partition table, some information about the zpool persists, and I think that's the issue.  When I try and add my disks to the zpool, it gives me a warning that they might already be in a zpool, so I know that something isn't getting wiped properly.  I can force it to add the disks and complete the installation procedure, but I still end up with an unbootable disk.

I chose freebsd because of the data integrity mechanisms in ZFS, but it seems to me that there are quite a few issues to be worked out.  Maybe the safest thing for my data would be to go with debian or something for now and wait until ZFS is better supported on freebsd.


----------



## graudeejs (Nov 8, 2009)

ZFS works for me since day 1
Just do as I do, use USB flash to boot, and you won't have problems 

http://wiki.freebsd.org/ZFSOnRoot


----------



## tjr (Nov 8, 2009)

That's the guide I was using.  I'm glad it worked for you on day one, but I guess I'm not as lucky.


----------



## crsd (Nov 8, 2009)

tjr said:
			
		

> That's the guide I was using.  I'm glad it worked for you on day one, but I guess I'm not as lucky.



Or just missing some steps, like bootcode installation.


----------



## graudeejs (Nov 8, 2009)

tjr said:
			
		

> That's the guide I was using.  I'm glad it worked for you on day one, but I guess I'm not as lucky.



according to your first post you're wrong
you used this guide:
http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror

When I suggested this one:
http://wiki.freebsd.org/ZFSOnRoot


----------



## tjr (Nov 8, 2009)

crsd said:
			
		

> Or just missing some steps, like bootcode installation.



The instructions included the following: 
	
	



```
Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad0
 Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad1
```

which I assume installs the bootcode.  Also, as I mentioned, the guide successfully worked once, but in trying to reinstall I am having errors.


----------



## tjr (Nov 8, 2009)

killasmurf86 said:
			
		

> according to your first post you're wrong
> you used this guide:
> http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror
> 
> ...



You're right - I thought that the guide you linked was the non-zmirror version of the guide I was using, not MBR version.  I'll see about giving that one a go then.


----------



## graudeejs (Nov 8, 2009)

I'd also suggest reading:
http://forums.freebsd.org/showthread.php?t=6230

and if you know FreeBSD basics and some more stuff, and you feel like you could improvise a bit, I suggest reading and mixing
http://forums.freebsd.org/showthread.php?t=2775
and 
http://www.daemonforums.org/showthread.php?t=1538

the last one is especially useful not only for zfs but for other things as well


----------



## tjr (Nov 8, 2009)

Thanks for the links, killasmurf, but they're mostly over my head.  Also, using the first link you sent, the first command (fdisk -BI ...) just gives me: 
	
	



```
fdisk: Class not found
```
.

What I'd really like to know is how the zpool information is managing to persist, despite wiping partitions and the partition map.  Each time I try and add my disks to it, it says that they are already part of a potentially active pool.  I'd try just dd the whole disks, but they'd take about two days apiece.


----------



## phoenix (Nov 9, 2009)

ZFS (as with all the GEOM classes) stores metadata in the last sectors of the file/partition/slice/disk (depending on what the physical backing store is).  Thus, wiping the first few sectors won't clear the ZFS metadata.

You need to zero out the last couple of MB to clear all traces of ZFS.


----------



## mousaka (Nov 9, 2009)

> ZFS (as with all the GEOM classes) stores metadata in the last sectors of the file/partition/slice/disk (depending on what the physical backing store is). Thus, wiping the first few sectors won't clear the ZFS metadata.


That's good to know.

Some weeks ago (8.0-Beta2) I was following the guide from Beat GÃ¤tzi (in German), and did have to start over as well. Deleting the GUID partition table did work for me, without deleting the last sectors.
The above guide has some slight differences to the one in the FreeBSD-wiki, e.g. Swap is on ZFS and there is no mirroring between 2 disks.

Some guy even made a script from the above instructions.

mousaka


----------

