zfs get canmount zroot/var
. If you used the installer then this property will most likely be set to off for at least the root file system. Normally this would only prevent it from auto mounting when you boot from a rescue CD and import the pool there. But I could imagine that this could also occur in other situations. sysrc zfs_enable
.Does this happen when you boot the main system or when you boot using a rescue CD? Also: is the base system installed on ZFS or... ?
zpool import
on the two pools, and then zfs mount
ed them. I brought the system down at the end of the day (I can't now remember why) and when I rebooted this morning, the zpools weren't mounted, which caused confusion til I discovered that. I don't have them listed in /etc/fstab, but they weren't listed before, either.Apart from this make sure that the ZFS services are enabled, check:sysrc zfs_enable
.
zfs_enable="YES"
in /etc/rc.conf (I just checked again).# -- sysinstall generated deltas -- # Tue Oct 21 06:59:05 2008
# Created: Tue Oct 21 06:59:05 2008
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="momcat"
ifconfig_igb0="inet 192.168.0.96 netmask 255.255.255.0"
defaultrouter="192.168.0.98"
#
ntpd_enable="YES"
nfs_enable = "YES"
zfs_enable = "YES"
enable_ppp="YES"
samba_server_enable="YES"
# ---------------
lpd_enable="YES"
dbus_enable="YES"
hald_enable="YES"
moused_enable="YES"
# ---------------
#linux_enable="YES"
sshd_enable="YES"
usbd_enable="YES"
# ---------------
mysql_enable="YES"
mysql_dbdir="/MC/mysql_data"
apache24_enable="YES"
#apache24_http_accept_enable="YES"
# ---------------
ftp_enable="YES"
apm_enable="YES"
# -- cups
cupsd_enable="YES"
devfs_system_ruleset="system"
Or do you mean the ones around the "=" in those 2 lines? Is the interpreter really that fragile?Remove the spaces in your rc.conf.
In the example with the spaces above it would have clearly mentioned that the ZFS service isn't enabled.
That might be the problem, because it returns "no" even though I do have zfs_enable="YES" in /etc/rc.conf (I just checked again).
Or do you mean the ones around the "=" in those 2 lines? Is the interpreter really that fragile?
[after a quick edit and another reboot]
Yep. Really that fragile. I'm surprised that I never tripped over that bug--and it is a bug!-- before.
So much of Unix is just thrown-together that way, fragility galore.
It’s not a bug. sh, like all languages, has a syntax that is expected to be followed, so this was a syntax error.
sh
, if that's who's doing the interpretation--no existing files would have to be changed, but extra whitespace would no longer prevent interpretation.It's not the number of whitespaces that matters (when you type commands, i.e. to list the contents of a directory,I think you'll have to agree, though, that it's a needless syntax error, like so many. In the majority of modern languages, including human ones, extra whitespace is not syntactically significant, And it would be so very easy to fix the problem insh
, if that's who's doing the interpretation--no existing files would have to be changed, but extra whitespace would no longer prevent interpretation.
(I'm a psychologist by training, and trying to prevent bad human-factors decisions like the one that produced this problem consumed most of my professional time in the computer industry)
ls -l ~
ls -l ~
It's not the number of whitespaces that matters (when you type commands, i.e. to list the contents of a directory,
orCode:ls -l ~
it's the same) but the presence of the whitespace itself that throws the error. While this could seem fragile, sticking to this conventions prevent to much unneeded complications in the code (at least this is valid for sh, for more complex programs could be unacceptable).Code:ls -l ~
# echo $TEST
# TEST = 123
sh: TEST: not found
# TEST=123
# echo $TEST
123
TEST
, with a couple of arguments (one of which is the = sign)? It can't really, and so to set a variable you have make it clear you are doing an assignment. It's just one of the limitations of trying to write a script using a shell interpreter.The context. The shell should distinguish between the whitespace(s) used, i.e. in setting a variable, and when parsing commands. Unless you quote or escape the equal sign, the interpreter will consider foo=1 as a variable assignement (and declaration, of course), but if you use whitespaces (foo = 1), will not; it'll threat them (foo, the =, and 1) as separate things.But what unneeded complications?
The problem is that /etc/rc.conf is not a config file, but a shell script, and shell isn't really a programming language so has quite a few caveats.
Code:# echo $TEST # TEST = 123 sh: TEST: not found # TEST=123 # echo $TEST 123
How can it tell the first assignment above (with the spaces), is not an attempt to run the command calledTEST
, with a couple of arguments (one of which is the = sign)? It can't really, and so to set a variable you have make it clear you are doing an assignment. It's just one of the limitations of trying to write a script using a shell interpreter.
Ideally of course, rc.conf should be read by a proper parser so it can have a real, more forgiving, "config file" format, but it's much easier and more lightweight for the rc scripts to just treat it as a script.
The context. The shell should distinguish between the whitespace(s) used, i.e. in setting a variable, and when parsing commands. Unless you quote or escape the equal sign, the interpreter will consider foo=1 as a variable assignement (and declaration, of course), but if you use whitespaces (foo = 1), will not; it'll threat them (foo, the =, and 1) as separate things.
EDIT: Didn't notice your comment usdmatt, sorry. Thank you for your clear explanation.
![]()
sh
language) doesn't have good design skills, or doesn't pay attention, or doesn't care, then the obnoxiousness will affect those who use his work forever. So it's always better for the designer to consume the obnoxiousness before it's generated rather than afflicting everyone after him.I would parse TEST = 123 the usual way:
while not finished,
read the line
capture the first token (TEST). At this point I don't know what it is, but it must be either a var or a call,
discard whitespace
find and capture the next token (=). Now I know it's an assignment, not a call
command arg1 arg2
format, than to suddenly switch to assignment if an argument happens to be =; A shell doing something different because the first argument to a command is = would be considered a bug by most people. Choosing name=value for assignment is a perfectly reasonable solution for adding variable assignment - without creating any side effects for normal command execution (apart from the fact you can't have an executable called my=program of course).