# ZFS: i/o error - all block copies unavailable after upgrading after make installkerne



## chmiels (Sep 2, 2011)

I've got strange problem after updating my system from source. I'm running -CURRENT setup with instructions from wiki: http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot (it was originally stable/8 upgraded to -CURRENT using source). It was running fine until yesterday, exact steps which I've performed:
`# zfs snapshot zroot@8.2`
`# make buildworld`
`# make buildkernel KERNCONF=MYKERNEL`
`# make installkernel KERNCONF=MYKERNEL`
`# reboot`
...
after reboot boot loader gives me following error message:

```
ZFS: i/o error - all block copies unavailable
```
when I rollback to previously created snapshot (8.2) system boots fine. zpool.cache in /boot/zfs wasn't touched during update.
It's very strange to me, because as I understand `# make installkernel` does nothing with bootloader or gptzfsloader. I've being updates from source many times before on this setup and never experienced such problem. Updating boot loader using `# gpart bootcode` didn't help 
(symptoms are the same for gptzfsboot from http://people.freebsd.org/~pjd/zfsboot/ and loader from my -CURRENT installed during 'make installworld' earlier).
Partition layout:

`# gpart show`

```
=>       34  250069613  ada0  GPT  (119G)
         34        128     1  freebsd-boot  (64k)
        162       1886     5  bios-boot  (943k)
       2048   16777216     2  !0fc63daf-8483-4772-8e79-3d69d8477de4  (8.0G)
   16779264   33554432     3  freebsd-ufs  (16G)
   50333696  199735951     4  freebsd-zfs  (95G)
```

Partitions 3 and 4 are separate zfs pools (3 is geli encrypted home pool and 4 is for
operating system).  

`# zfs list`

```
NAME                        USED  AVAIL  REFER  MOUNTPOINT
home                       10,4G  5,24G  10,4G  /home
zroot                      90,2G  3,27G  1,16G  legacy
```

/etc/fstab

```
# Device		Mountpoint	FStype	Options			Dump	Pass#
zroot			/		zfs	rw,noatime		0	0
/dev/acd0		/cdrom		cd9660	ro,noauto		0	0
proc 		/proc 		procfs 	rw 			0	0
```
Any ideas?


----------



## akil (Sep 2, 2011)

Hi

By default 8.2 support zpool v15, so after upgrading sources you also upgrade supported version of v28. That means you have to upgrade your pool from v15 to v28. Maybe that explain what is the root cause. 

Could you check what is your pool version ?
`# zpool get version zroot`


----------



## chmiels (Sep 2, 2011)

My pool is at version 15, I didn't upgraded pool because my rescue disk is in version 8.2 (so I'm still able to rollback). 
Please notice that 8.2 I've used in snapshot name doesn't mean OS version it is only a name of snapshot. There are also some other snapshots in this pool. It's already running -CURRENT, so I still don't understand why it fails to boot after 'make installkernel' which simply copies kernel image from build directory to /boot. I'll try comparing kernel images, checking disk for errors and freeing some space.
Problem with 'gptzfsboot' is that it's not to verbose and doesn't have test or debug mode.


----------



## chmiels (Sep 7, 2011)

For those interested - problem occurs when you have almost full filesystem with compression.


----------



## avilla@ (Apr 24, 2012)

chmiels said:
			
		

> For those interested - problem occurs when you have almost full filesystem with compression.



Just for reference, while this may help, it's not necessarily the solution. To "fix" this I had to move /boot elsewhere and copy it back to ensure files were rewritten properly.


----------



## mariusvw (Nov 22, 2013)

After first looking into this post: http://forums.freebsd.org/showthread.php?t=30059, I ended up with no fix. Moving away the boot dirextory and copy it back again fixed the problem for me too.

The problem did not occur due to a full FS, still got 242 out of 500 GB free.


----------

