Page 1 of 1

Root on ZFS?

Posted: 03 Sep 2015 14:34
by MrWhite
Why there are still UFS? Is there any way to move root from ufs to zfs without a pain?..

Re: Root on ZFS?

Posted: 03 Sep 2015 15:18
by raulfg3
MrWhite wrote:Is there any way to move root from ufs to zfs without a pain?..
NO.

Root on ZFS is used on FreeNAS install as default so perhaps need some time to do the same here.

Re: Root on ZFS?

Posted: 04 Sep 2015 03:05
by armandh
I know of no hardware that can read a ZFS file directly and boot an OS from it.
there for, I assume, an OS that can read ZFS must be booted from something else.

one of those "you can't get there from here" problems

Re: Root on ZFS?

Posted: 04 Sep 2015 10:47
by raulfg3
armandh wrote:I know of no hardware that can read a ZFS file directly and boot an OS from it.
FreeNAS boot disk does, please try on a VM or real hardware to test it.

Re: Root on ZFS?

Posted: 04 Sep 2015 14:36
by MrWhite
armandh wrote:I know of no hardware that can read a ZFS file directly and boot an OS from it.
there for, I assume, an OS that can read ZFS must be booted from something else.

one of those "you can't get there from here" problems
PC hardware knows nothing about FS you use on your disks. (except for uefi and fat32 in modern mb's).

What about FreeBSD - there are a lot of different methods, to boot from ZFS. You can read about it here: https://wiki.freebsd.org/RootOnZFS

Re: Root on ZFS?

Posted: 04 Sep 2015 20:00
by armandh
MrWhite wrote:PC hardware knows nothing about FS you use on your disks. (except for uefi and fat32 in modern mb's).
What about FreeBSD - there are a lot of different methods, to boot from ZFS. You can read about it here: https://wiki.freebsd.org/RootOnZFS
from the link

1.1.1. UFS /boot

This installation boots FreeBSD from UFS filesystem /boot filesystem, and then mounts FreeBSD-ZFS partition as the root filesystem (/).
Installing FreeBSD Root on ZFS using UFS /boot

you are not "cold" booting from ZFS files

PC hardware and bios must be compatible with the initial boot storage file system.

Re: Root on ZFS?

Posted: 04 Sep 2015 20:19
by MrWhite
armandh wrote: from the link

1.1.1. UFS /boot

PC hardware and bios must be compatible with the initial boot storage file system.
"UFS filesystem /boot " - this is just one of the several available methods. Read more. Especially about FreeBSD-Boot partition. Which is not UFS.

Initial boot storage - in general, is the first sectors of the disk / fat32 partition in case of uefi boot.
PC Hardware or bios knows nothing about UFS, EXT2, EXT3, EXT4, NTFS, or other known FS. Except for fat32 in case of uefi boot.

Re: Root on ZFS?

Posted: 04 Sep 2015 20:35
by armandh
I can see creating a MBR slice for a ZFS reader
it is still not booting directly from a zfs file format
but at this point it is splitting hairs.

Re: Root on ZFS?

Posted: 04 Sep 2015 23:03
by MrWhite
armandh wrote:I can see creating a MBR slice for a ZFS reader.
MBR slice on GPT. Ooookay.... :) By the way, mbr or gpt is not a filesystem. :)

Re: Root on ZFS?

Posted: 05 Sep 2015 01:34
by armandh
The MBR holds the information on how the logical partitions, containing file systems, are organized on that medium. Besides that, the MBR also contains executable code to function as a loader for the installed operating system—usually by passing control over to the loader's second stage, or in conjunction with each partition's volume boot record (VBR). This MBR code is usually referred to as a boot loader.

OK it is not a file system but holds executable code
call it whatever you will it still smells like a file system to me
one the hardware can read directly.

but it gets even more confusing
back in the day when one specified the heads and sectors one tailored the compatibility then partitioned/formatted the drive
now all done by drive firmware, bios and boot loader. so I'll concede the point with a custom boot loader ZFS will boot.
so where is the check box for making the ZFS format bootable?

Re: Root on ZFS?

Posted: 08 Sep 2015 12:01
by raulfg3
congratulations, you can use HOWTO by JoseMR to do that: viewtopic.php?f=66&t=9522

Re: Root on ZFS?

Posted: 08 Sep 2015 12:15
by MrWhite
There are only two commonly used partition formats - MBR and GPT. Almost all hardware supports it. And, there are hundreds filesystems, that hardware knows nothing about.
armandh wrote:now all done by drive firmware, bios and boot loader.
Only heads/sectors set automatically by bios. :) You still needs to partition drive and format that partitions (create filesystems on partitioned space).
armandh wrote:so I'll concede the point with a custom boot loader ZFS will boot.
There is no need of custom ones. Original boot loaders, that came with freebsd started from v7 (or v8) - 'gptzfsboot' or 'zfsboot' - able to boot from mbr or gpt partitioned disks with zfs.
armandh wrote:so where is the check box for making the ZFS format bootable?
That was my initial question. :) Why there are still root UFS in nas4free? :)

I've experimenting with nas4free, and was able to move it to zfs root. But, got tons of errors during boot, especially from /etc/rc.d/rcconf script (as far as i remember). Looks like startup scripts trying to mount fs by ufsid, and execute commands on this, but there are no ufsid anymore.
Despite this, it seems everything is working.

Anyways, i've decided to wait until guys implement zfs root on nas4free. Hope, some day it will be implemented.

Re: Root on ZFS?

Posted: 08 Sep 2015 12:18
by MrWhite
raulfg3 wrote:congratulations, you can use HOWTO by JoseMR to do that: viewtopic.php?f=66&t=9522
Nope, this is not what i'm asking about. The question was about zfs on root. It means, no ufs at all, only zfs.
There are no any problems of making data partition with zfs.

Re: Root on ZFS?

Posted: 08 Sep 2015 13:06
by raulfg3
sorry you are right, I missread post and think that the described trick is suitable for partition 1 or 2 ( boot partition), I re-read and is clear that is not the case.

Re: Root on ZFS?

Posted: 08 Sep 2015 13:08
by b0ssman
if you want to boot a zfs parition you need grub2

see here for the parameter to boot freebsd using grub2 from zfs.

Re: Root on ZFS?

Posted: 08 Sep 2015 13:21
by MrWhite
b0ssman wrote:if you want to boot a zfs parition you need grub2

see here for the parameter to boot freebsd using grub2 from zfs.
Will grub2 let me avoid all errors i've got from rcconf nas4free script?
Because to boot freebsd from zfs i don't need grub2. I can move nas4free to zfs root, but get tons of errors during boot process, from rcconf script. It seems this scriot uses ufsid's (and there is no any ufs at all).

Re: Root on ZFS?

Posted: 08 Sep 2015 21:56
by daoyama
MrWhite wrote:That was my initial question. :) Why there are still root UFS in nas4free? :)
At least, single pool is not an option for N4F.
If you get an error/trouble on ZFS pool, you cannot read config required by WebGUI on it.
(it's high risk even if you have hotswap bay.)
Also UFS is stable under low free memory / heavy load.

Note:
Not all mother board support GPT boot.
We cannot ignore it since N4F concept is reuse PC/hardware.

Re: Root on ZFS?

Posted: 08 Sep 2015 22:10
by MrWhite
daoyama wrote:
MrWhite wrote:That was my initial question. :) Why there are still root UFS in nas4free? :)
At least, single pool is not an option for N4F.
If you get an error/trouble on ZFS pool, you cannot read config required by WebGUI on it.
(it's high risk even if you have hotswap bay.)
Also UFS is stable under low free memory / heavy load.
If webgui cannot read config - then how it works? :)
If UFS is stable under low free memory/heavy load - why there are zfs for storage pools? Why not only ufs?
daoyama wrote: Note:
Not all mother board support GPT boot.
We cannot ignore it since N4F concept is reuse PC/hardware.
That's why freebsd perfectly boots from mbr with root on zfs.

By the way. I've got router, working on freebsd10.1, boots from gpt partitioned drive. Now, it works on gigabyte GA-8IPE1000, first bios for this motherboard was released on 15/05/2003 (12 years ago!). It knows nothing about gpt or uefi. And it boots without any problems, from gpt partitioned drive.

There is no need of supporting gpt by mother board. Grub2 does, and freebsd boot loader does. https://www.freebsd.org/cgi/man.cgi?que ... TSTRAPPING - there are quite detailed description of freebsd boot process:
...
Both types of bootstrap code are used to boot from the GUID Partition Ta-
ble. First, a protective MBR is embedded into the first disk sector from
the /boot/pmbr image. It searches through the GPT for a freebsd-boot
partition (see the PARTITION TYPES section) and runs the next bootstrap
stage from it. The freebsd-boot partition should be smaller than 545 KB.
It can be located either before or after other FreeBSD partitions on the
disk. There are two variants of bootstrap code to write to this parti-
tion: /boot/gptboot and /boot/gptzfsboot.
...
/boot/gptzfsboot is used to boot from ZFS. It searches through the GPT
for freebsd-zfs partitions, trying to detect ZFS pools. After all pools
are detected, /boot/zfsloader is started from the first one found.

Re: Root on ZFS?

Posted: 14 Sep 2015 20:12
by armandh
and circuitously grub2 in that case wont be in ZFS
[if I understand this]

Re: Root on ZFS?

Posted: 01 Jan 2016 04:44
by JoseMR
Sorry for the old thread :roll: , but interested/experienced users digging about this topic, can play/test on a VM with my RootOnZFS installer for NAS4Free 10.x, currently supports GPT single ZFS disk and ZFS mirror installs, for Full platforms only.

RootOnZFS: viewtopic.php?f=17&t=9959#p62256

Regards

Re: Root on ZFS?

Posted: 16 Feb 2016 04:41
by danmero
MrWhite wrote:That was my initial question. :) Why there are still root UFS in nas4free? :)
ZFS is not a partion nor a filesystem known by BIOS , please take a look at Booting From a ZFS Root File System,
Booting from a ZFS file system differs from booting from a UFS file system because with ZFS, the boot device specifier identifies a storage pool, not a single root file system."
The "the boot device specifier" is located in the filesystem >> located in the active partition(GPT or MBR) >> that is recognized by BIOS.


Hi Everybody , sorry for my ugly first post ;) long time no see!