-
mns
I was running a webserver in a jail, following directions in the FreeBSD Handbook. I did a 'zfs umount' of the dataset thinking that I wanted to change the mount point. I changed my mind and kept the same mountpoint. I remounted the dataset, but my data is not there. There should be a jail located at /usr/local/jails/containers/lighty but there is no such directory anymore. What am I missing?
-
mns
well besides the obvious thing of missing the data :-)
-
mason
mns: Hidden mount. Does it show as mounted?
-
mns
mason: not sure about hidden mount. How do I look for that?
-
mason
what does "mount" say about it?
-
mns
mason: doing 'mount' gives me this: zroot/jails on /usr/local/jails (zfs, local, noatime, nfsv4acls)
-
mns
oh I did a 'zfs mount -a' and that brought everything back. What's the different between 'zfs mount zroot/jails' and 'zfs mount -a' ?
-
mason
mns: So, you can have a mountpoint that sits on another mountpoint, so if the first one is missing the second one can't mount.
-
mason
Alternately, if you get mounts in the wrong order, you can hide something that's already mounted.
-
mns
after doing 'zfs mount zroot/jails', I did a 'ls /usr/local/jails' and it would show me the subdirectories that should have been there, but nothing underneath those directories.
-
mason
mns: Sounds like you've got one dataset per jail perhaps, which is fine.
-
mns
-
mason
Ah, bit more complex than I like.
-
mason
mns: Sorry, so, in this case, zfs only controls some of the mounts, but not the nullfs mounts.
-
mason
Try "mount -a" and see if that helps.
-
mns
"zfs mount -a" worked. "mount -a" I don't think makes a difference in this case since I'm using ZFS.
-
mns
mason: how do you manage your jails if the handbook is complex?
-
mason
mns: You're doing nullfs with ZFS?
-
mns
yes
-
mns
zfs to create the template jails, nullfs to mount ports and ssl certs inside the jails
-
mason
Anyway, to answer your question, I just have a dataset per jail. The duplication isn't huge.
-
mns
so what they call thick jails ?
-
mason
Relative to thin, yes.
-
mns
might have to look at that. you have to update each dataset separately when updating your jails though, yes?
-
mason
yes
-
mason
Plus side to that, I can schedule things more easily.
-
rwp
I think mns is thinking that mount is recursive down the tree of possible mounts that might possibly be mounted below. But that would cause problems so it isn't done that way. One might have two datasets such that they only want one of them mounted at a time but both on the same mount point for example. So mounting is not automatically recursive down the tree.
-
mason
Seems reasonable.
-
rwp
I'll also note that if one wants to change the mount point of a dataset that I never umount it first. Not necessary. Instead just change the mount point "zfs set mountpoint=/jails/foo zroot/jails/foo" or whatever and zfs will handle moving/umounting/mounting the mount point from a previous location to the new location. Pretty sure that works even if the mount point is busy as it moves it rather than umount'ing it.
-
mns
rwp: I would just have to make sure that the mount point exists prior to setting the mountpoint yes?
-
mns
mason: yeah that's a fair point about scheduling the upgrades
-
mns
out of curiosity, how many jails do you run on your system, mason?
-
mason
ooh, I'd have to check. Multiple systems.
-
mason
Five on one box here.
-
mason
Three on another.
-
mns
ok so multiple jails on multiple systems
-
mason
That said, more before long as I migrate some LXC containers.
-
mns
you use anything to manage them? appjail, bastille, cbsd, etc? or roll your own scripts?
-
mason
Just the base tools.
-
mason
I have a dataset with the base set in it and minimal config, and I zfs send/receive that to new jails.
-
mns
interesting. I may have to look into that sort of thing.
-
mason
If you're happy with what you've got, stick with it. But I do like this. It's quite simple.
-
mns
I'm just doing this because I was following the handbook. I just have one jail right now. Will have more down the pipeline. Main goal for now is to learn about jails and vnets
-
mns
thanks for the help and explanations mason and rwp.
-
mason
mns: Sure. Sorry my explanations were a little incoherent at first. Distracted this evening.
-
rwp
mns, zfs will create the mount point for you automatically. I don't think it will create parent directories so the parent directory must exist. But zfs will manage the mount point completely. Happy to help! I am also incoherent often too.
-
rtprio
how do you set multiple 'sharenfs' lines in zfs?
-
rwp
rtprio, Set all of the options for a dataset in one sharenfs property.
-
rwp
The sharenfs property is documented in the zfsprops(7) man page.
-
f451
IIUIC you can create a custom property. Maybe sharenfs within that? just guessing though. e&oe.
-
zilti
I just got my WayPonDEV youyeetoo X1 and can confirm that FreeBSD runs (unsurprisingly) perfectly fine on it. :)
-
rtprio
well
-
CrtxReavr
Fuck.
-
CrtxReavr
cut(1) has a fatal flaw.
-
rtprio
what's that
-
CrtxReavr
It drops the double quotes from double-quoted fields.
-
rtprio
whatever you do with cut, you could do with awk
-
ivy
CrtxReavr: it doesn't: echo '"foo","bar"' | cut -d, -f1 prints "foo" with the quotes
-
CrtxReavr
echo '"foo,bar","fubar"' | cut -d, -f1
-
rtprio
why would cut know to group that together
-
ivy
it's returning the value of the first ','-separated field, which is '"foo'
-
CrtxReavr
No shit?
-
ivy
that's how cut works, it's not a CSV parser and doesn't understand quoting
-
ivy
not a flaw in the command, it's just not intended for that use...
-
nimaje
CrtxReavr: cut does what I expect in your example, it gives me "foo
-
rtprio
if you're trying to work it that way, you'll need to use another delimiter
-
wavefunction
`tr -d '"'` would remove the quotes
-
wavefunction
(and stay posix)
-
mason
CrtxReavr: So, realize that the shell eats quotes most of the time.
-
mason
Your programs never see quotes or redirection.