| Summary: | Contents of ZFS datasets invisible after being mounted inside a jail with nullfs (Even after a reboot!) | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Troels Just <tsuroerusu> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed Not A Bug | ||
| Severity: | Affects Only Me | ||
| Priority: | --- | ||
| Version: | 11.1-RELEASE | ||
| Hardware: | amd64 | ||
| OS: | Any | ||
|
Description
Troels Just
2017-08-14 08:49:58 UTC
With a little bit of help, I managed to figure out what the problem was. It turned out that I had run, head first, into the wall of nullfs not operating across file systems. Thus inside the jail, the data was being saved to a regular directory on my "storage/cloud"-dataset (Mountpoint: /storage/cloud), whereas outside the jail the child file system "storage/cloud/bc", having been left empty, was mounted over the folder "bc" on "storage/cloud", where the files actually resided, thus "hiding" them from view outside the jail. A simple "zfs unmount storage/cloud/bc" revealed them. Anybody reading this in the future after a Google search: If you are using ZFS and want to put a file system and all of its children into a jail then you cannot use nullfs. Instead you need to either change the actual mount point using "zfs set mountpoint=/jails/jail1/storage storage/path/to/filesystem" or to attach the entire dataset to the jail, and allow it to be managed from within the jail using "zfs jail". I would like to propose that the man page for mount_nullfs contain a short sentence about nullfs not crossing file system boundaries. From what I can tell by, admittedly, giving it a quick look, I didn't see anything about that, so it's possible that I simply missed it if it actually is in there. I apologize for any inconvenience caused by this report. |