# ROOT on ZFS



## vermaden (Feb 26, 2011)

I have tried these guides:
http://wiki.freebsd.org/RootOnZFS/ZFSBootSlice
http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition

... but none of them seems to work, after installation it hangs at boot like that:




I am using these guides with 8.2-RELEASE amd64 version.


----------



## graudeejs (Feb 26, 2011)

Read the *Create FreeBSD GPT ZFS bootable partition*:
https://wiki.bsdroot.lv/freebsd:quick_tips

I use default bootloader and I install bootsector on all 3 disks


----------



## graudeejs (Feb 26, 2011)

and don't forget to

```
zpool set bootfs=tank/root tank
```


----------



## vermaden (Feb 26, 2011)

killasmurf86 said:
			
		

> Read the *Create FreeBSD GPT ZFS bootable partition*:
> https://wiki.bsdroot.lv/freebsd:quick_tips


I am using MBR partitions mate ...



			
				killasmurf86 said:
			
		

> and don't forget to
> 
> ```
> zpool set bootfs=tank/root tank
> ```



Its part of these howtos that I mentioned:
[cmd=]# zpool set bootfs=zroot zroot[/cmd]


----------



## graudeejs (Feb 26, 2011)

Ye, right... 
I like gpt more...

What do you have in /boot/loader.conf

```
vfs.root.mountfrom="zfs:tank/root"
```

Frankly I never tried zfs with MBR


----------



## vermaden (Feb 26, 2011)

killasmurf86 said:
			
		

> Ye, right...
> I like gpt more...
> 
> What do you have in /boot/loader.conf
> ...



... as in the linked guides:

```
zfs_load=YES
vfs.root.mountfrom="zfs:zroot"
```

I need MBR since I need to also have Windows XP on that machine.


----------



## graudeejs (Feb 26, 2011)

I suppose you didn't export zpool before rebooting? (As you know you shouldn't export it)
Check /boot/zfs/zpool.cache is OK

What I've mentioned were my most common mistakes with same symptoms


----------



## vermaden (Feb 27, 2011)

One of the steps I do is:

```
# mkdir /boot/zfs
# zpool export zroot
# zpool import zroot
# cp /boot/zfs/zpool.cache /zroot/boot/zfs
```


----------



## JJMcKay (Mar 7, 2011)

I'm getting the exact same error after following the guides. Any ideas?


----------



## danbi (Mar 8, 2011)

Have you tried waiting longer on that stage of boot?

Sometimes, the ZFS boot loader takes eons to do what it does. Especially if you have USB devices connected to the system.


----------



## disi (Mar 8, 2011)

danbi = dan? I used this guide: https://www.dan.me.uk/blog/2010/02/08/booting-from-zfs-raid0156-in-freebsd/. Works like a charm and boots pretty fast. I installed it on a single SSD as root partition using gpt.

It should not be too hard to use the guide with mbr partitioning scheme instead...


----------



## nakal (Mar 8, 2011)

ZFS boot loader is very slow. You should wait at least 30 seconds.


----------



## volatilevoid (Mar 8, 2011)

I never had much luck with ZFS and MBR, especially on VirtualBox. See my older thread over here.

Windows XP x64 is GPT capable. But if you're on 32 bits then you're pretty much out of luck...


----------



## vermaden (Mar 8, 2011)

volatilevoid said:
			
		

> Windows XP x64 is GPT capable. But if you're on 32 bits then you're pretty much out of luck...



Windows XP x64 can read DATA from GPT partition, but is not able to BOOT from such partitions, at least that is what I have read on MS sites [1]. Only Windows Vista/7 can use GPT partition to BOOT.



> 13. Can Windows XP x64 read, write, and boot from GPT disks?
> Windows XP x64 edition can use GPT disks for data only. Only Windows for Itanium-based systems can boot from GPT partitions.



[1] http://msdn.microsoft.com/en-us/windows/hardware/gg463525


----------



## captobvious (Mar 9, 2011)

Maybe the lack of GPT is causing an issue. I just installed 8.2 amd64 last week, using this guide for a single disk GPT install and it works fine:

http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot


----------



## volatilevoid (Mar 9, 2011)

vermaden said:
			
		

> Windows XP x64 can read DATA from GPT partition, but is not able to BOOT from such partitions, at least that is what I have read on MS sites [1]. Only Windows Vista/7 can use GPT partition to BOOT.
> 
> [1] http://msdn.microsoft.com/en-us/windows/hardware/gg463525


Hm, I see. So I think it'll be really hard to have both FreeBSD (with ZFS) and Windows XP on the same disk. Sorry for the misinformation.


----------



## vermaden (Mar 9, 2011)

captobvious said:
			
		

> Maybe the lack of GPT is causing an issue. I just installed 8.2 amd64 last week, using this guide for a single disk GPT install and it works fine:
> 
> http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot



ZFS on GPT partition works fine, I have successfully setup such machine and it boots fine ... we just need MBR partitions You know.


----------



## ronnylov (Jun 13, 2011)

I am having the same problem. I have bought an Intel 320 120 GB SSD disk and first I installed Windows 7 64-bit which actually requires MBT because I do not have UEFI on my computer (it use BIOS).
See http://msdn.microsoft.com/en-us/windows/hardware/gg463525


> Q.	Can Windows 7, Windows Vista, and Windows Server 2008 read, write, and boot from GPT disks?
> 
> A.	Yes, all versions can use GPT partitioned disks for data. Booting is only supported for 64-bit editions on UEFI-based systems.



My plan is to also install FreeBSD and Arch Linux on this SSD. So I tried the guide in VirtualBox first to see how to do it before trying to do it on my real SSD. But it hangs at boot just like in the screenshot by vermaden in the first post of this thread. Maybe this is only a VirtualBox problem? Maybe I should try fixed disk size in VirtualBox instead of "dynamic growing disc" when using ZFS? Anybody tried it on real hardware instead of VirtualBox?


----------



## ged (Sep 10, 2011)

*8.2 breaks Root on ZFS on MBR slice*



			
				vermaden said:
			
		

> I have tried these guides:
> http://wiki.freebsd.org/RootOnZFS/ZFSBootSlice
> http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
> 
> ...



I was using 8.1, and upgraded to 8.2-RELEASE amd64 quite a while ago.  Never got around to upgrading the bootloader at that point, because the kernel prevents it on a running system..  I upgraded the pool to version 15 after a while.  Now a system crash forced me to do the bootloader upgrade, and I see exactly the same boot lock-up you see.

Apparently, something changed in zfsboot between 8.1 and 8.2, which now causes total lockup when the system enters the later boot stages, but before launching loader.


----------



## da1 (Sep 11, 2011)

Would GRUB be an option ?


----------



## ged (Sep 11, 2011)

da1 said:
			
		

> Would GRUB be an option ?


Hmm.  Good question.  Didn't know GRUB could boot from zfs until I googled it.  Any idea if there's a good FAQ on grub and zfs booting around?


----------



## da1 (Sep 11, 2011)

No idea, sorry. It just crossed my mind. Personally I don't use it so I cannot give you any directions except google.


----------



## ged (Sep 12, 2011)

Seems that GRUB ZFS support is fairly experimental...  If this is an issue with the 8.2 zfsloader, perhaps I need to file a bug against it...


----------



## ged (Sep 17, 2011)

OK; my system refuses to boot of the 9.0 usb image (GPT pmbr incompatibility, or something).  Does anyone have a copy of the 9.0 beta "zfsboot" that is available over ftp somewhere?  I'm having serious trouble getting a copy out of the system without doing a proper install.  I think I need the 9.0 zfsboot bootloader to fix the issue in 8.2.


----------



## ian-nai (Sep 22, 2011)

nakal said:
			
		

> ZFS boot loader is very slow. You should wait at least 30 seconds.



When you say that, do you mean it's natural to see nothing but a blinking cursor at boot for quite a while?

i.e. all I'm seeing at the moment is (imagine it's blinking):

_ 


After the bios post, after following the zfs boot instructions, etc.

-edit- nvm me, the gpt guide above's helping. I'm currently figuring out how to use 4k AF drives as root...


----------

