Solved Moving from mirror to raidz

I wanted to move my home server from to 2-way mirror to 3-way raidz. I did it using https://unix4lyfe.org/zpool/ The difference from that tutorial is that I have only 3 HDD's and I use ZFS on root. I've correctly moved to 3-way raidz, but it seems like I can't boot anymore (I've checked that the data is still in the pool). Of course, I did it from LiveCD. The loader is there, but I'm getting a message that it couldn't find /boot/zfsloader, and then that /boot/kernel/kernel was not found. Which is strange, because those files actually are in /boot. Another strange thing is that I use GPT. To be sure, I've reinstalled bootcode using gpart(8) on all 3 disks (with gptzfsboot), but it got me nowhere. I'm right now using the fresh 10.2-RELEASE on amd64.
 
I've pulled up an all-nighter, backed up my data and reinstalled FreeBSD. When I copied some of my data, restored /etc/rc.conf and rebooted I got:
Code:
zfs i/o error - all block copies unavailable
As I needed to go for a few weeks out of home, I won't have access to my server during that time (that's why I wanted to set it up before leaving). However, what can I do about it when I return?.
 
Ok. Sorry I can't be of more help. I did something similar in concept with my home NAS with just a 3 drive RAIDZ with a freebsd-zfs partition on each disk and UFS SSD for the OS drive. After the SSD drive died on me one day, I just made a freebsd-boot partition, did a manual FreeBSD install over the existing drive, and wrote boot code to each of the 3 drives. Things were just easy and worked. I'm not sure what else to suggest at this point without more details.
 
I think I had the same problem 1 week ago, for my case it was a broken SATA cable, I think I read somewhere that this might be a hardware problem.
 
Last edited by a moderator:
I returned to home and reinstalled FreeBSD. After rebooting straight after installation, the OS boots successfully. However, when next reboots are unsuccessfull and I get https://imgur.com/a8GeV9j
The SATA cable I use, has been used successfully before.
 
It's quite strange. After the next reboot, FreeBSD actually boots correctly. Any ideas why is it so random and why it worked with 2 HDD's? The 3rd HDD is brand new, so it shouldn't be broken. Still, even if it is, RAIDZ should be able to boot with 1 broken HDD.
 
Did you put the boot code onto each of the drives in the raidz?

# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

Where ada0 refers to the harddrive, and then iterate through all of them. That way, you can boot from any of the drives, regardless of which order the BIOS detects them. If you don't do that, and the BIOS renumbers the drives, and you boot off a drive without bootcode installed, you get similar messages to what you posted.
 
Did you put the boot code onto each of the drives in the raidz?

# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

Where ada0 refers to the harddrive, and then iterate through all of them. That way, you can boot from any of the drives, regardless of which order the BIOS detects them. If you don't do that, and the BIOS renumbers the drives, and you boot off a drive without bootcode installed, you get similar messages to what you posted.
As for the first situation, yes, I did.

As for now, I just used the ZFS partitioning from FreeBSD installer, so it should do that automatically. Strangely, I didn't reinstall FreeBSD again, or change anything in its configuration, but now it boots correctly every time I reboot.
 
Did you set the bootfs property on the new pool?
Can't see that mentioned in the guide from the first post, and I'm sure I've had similar errors when I tried to do a manual install from memory and forgot that step.
 
Did you set the bootfs property on the new pool?
Can't see that mentioned in the guide from the first post, and I'm sure I've had similar errors when I tried to do a manual install from memory and forgot that step.
At first I didn't, but since I was trying quite a lot of things then, at last I set it. But I think the situation before reinstallation is closed now, since I can only pull things out of memory now. As for the situation after reinstallation, I hope it's gone now, but will report back if there are any errors when doing next reboots.
 
Back
Top