Solved Install FreeBSD with Shell From Install Disk and Setup ZFS

As an exercise, I've been trying to bypass bsdinstall and set up some disks manually. I've got a FreeBSD install disk, and I just select "Shell" from the three choices that would normally lead to "Install." I looked over a few tutorials; one of the more influential ones that I used was this one: https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror .

I got about partway through and shut down the computer. To get the zpools built out on the disks, I was mounting to a directory under /tmp. I could make a directory there, give some zfs commands, and build out the pool. I got to a stopping point, I unmounted my pool, and shut down the computer. Previously, I had been able to mount and unmount the zpool with little trouble.

I did not finish the install, so I don't expect to be able to boot into FreeBSD. But, I would have liked to pick up where I left off. When I restarted the computer, I was unable to find or mount the pools I previously created.

Why?

I thought that if I rebooted into "Shell" option from the disk again that I ought to be able to recover the previously created partitions. Did I need a gpart commit? I thought a gpart create would do it. On restart, none of the work seems to have survived.

I noticed somewhere in a summary of bsdinstall that there was a step about transferring the tmp filesystem to the disk. I wonder if I have left this out; that is, I know I didn't do any such thing. What might that part be?

Anybody got a clue about what I might have done wrong? Please let me know. I thought I should be able to partition, stop working, reboot, and return to work on it. Thanks.
 
When I restarted the computer, I was unable to find or mount the pools I previously created.

What does zpool import show?

Coincidentally, today I installed on a previously partitioned disk ( multi OS setup ) root-on-ZFS manually, extracting base.txz and kernel.txz in the created dataset.
 
Bingo! We have a winner. Thanks.

Sorry, I was lost when I was doing a zpool status and zfs list and nothing was coming back. I was able to find it with the zpool import. I was able to import it with a force. zfs list now shows yesterday's work. Thanks.
 
Figure out where the installer wants the filesystem root (as install target). You have to zfs import -R <bsdinstall_target> and mount it there. Then you can preset your dataset layout & properties from within a shell, while still enjoy the installer's benefits e.g. performing some setup tasks in the right order including some checks etc.pp.
 
I'm looking to mimic the GELI encryption as well. I found several tutorials that talked about not having the root partition encrypted; I can see the hassle in that, but I've been living with having to decrypt before booting for some time now. I'm going to do another iteration where I lay in the GELI first and then go back and install the ZFS. I'm not quite sure how to do this yet. Like, one question I have is how to decrypt the mirrors or RAIDZ as one unit. But, that may be for another thread. Pretty much, mimic what bsdinstall would do. I'm guessing that eventually I will have to read that code.
 
That looks like a really good tutorial.

I was tinkering with these ideas today. I could get the disk encrypted, attached, and detached, all okay. But, once I applied geli, I could not see the individual partitions anymore. Like gpart would not find them. So, I am a little worried about checking my work.
 
OK, maybe I'll give that a try. I don't see why I can't have more than one type of filesystem on a machine.
 
Back
Top