Played with unionfs, now system doesn't even reboot

I am trying to mount a rw folder over a ro base on a dir:
- read-only nullfs mount mount_nullfs -o ro,noatime ro mounts/root
- a rw union fs mount above mount_unionfs -o noatime rw mounts/root

Here's the result:
Code:
/root/uniontest/roroot on /root/uniontest/mounts/root (nullfs, local, noatime, nfsv4acls)
<above>:/root/uniontest/rwroot on /root/uniontest/mounts/root (unionfs, local, noatime, nfsv4acls)

And now I am stuck:
- trying to cd, ls or autocomplete a path in mounts/root or ro or rw hangs
- umount hangs
- shutdown -r now is not working

What's going on? How can I fix this?
 
Hmm. That's hard to tell, specifically. But if I had to guess unionfs caused a storage overlay (using IBM mainframe term) within the kernel. Or to put it in simpler terms, some kernel data was inadvertently clobbered by something (probably unionfs).

Have you tried hitting the reset button?

What version of FreeBSD are you running?

Looking below I am using unionfs successfully on my firewall/gateway to mount /etc on top of a shared nullfs (/jails/template). This is similar what you're trying to do, to mount a union fs I use a very recent (rebuilt this morning) 15-CURRENT.

Code:
cwfw# df -htunionfs
Filesystem                           Size    Used   Avail Capacity  Mounted on
<above>:/jails/external/local/etc    194G     98G     96G    50%    /jails/external/root/etc
<above>:/jails/localsrv/local/etc    194G     98G     96G    50%    /jails/localsrv/root/etc
cwfw#

Here is how I mount my unionfs filesystems.

Code:
cwfw# grep unionfs /etc/fstab
/jails/external/local/etc       /jails/external/root/etc        unionfs rw,late0 0
/jails/localsrv/local/etc               /jails/localsrv/root/etc        unionfs rw,late  0 0
cwfw#
 
Anticipating that you're running a 13.something or 14.something RELEASE, there have been a number of fixes that went into unionfs in 15-CURRENT that have not been nor will they be MFCed to any stable branch. You're two options are to either wait for 15-RELEASE or plop 15-CURRENT on a machine or VM and play there.

I've been using unionfs in a production mode here at home on my firewall gateway for a couple of jails. I use it for /etc within the jails. /etc isn't heavily written to so I can't say unionfs is really exercised there. But FWIW, it's been pretty stable in that configuration.
 
I am running 14.1-RELEASE.

I ended up doing a hard reset because I need that box to run. ACPI reset does not work either.
(Rebooted fine since I was just playing with mount commands so nothing reboot-proof in fstab.)

Edit: Okay so it's definitely coming from unionfs. I got rid of the nullfs part and ran into the same issue.
Here's how I do it:
Code:
mkdir -p roroot/ro
echo test > roroot/ro/test
mkdir unionroot
mount_union -o below roroot unionroot
mkdir unionroot/rw
ln unionroot/ro/test unionroot/rw/linktest
ls -i unionroot/rw # This works
ls -i unionroot/ro # This hangs indefinitely and there's no escape from there.
 
I cannot find my bug described (as in hanging and blocking the whole system without error). But I guess this warning should be enough:

THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T
WORK) AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT
YOUR OWN RISK.
 
Back
Top