Variable assignment in sh
freebsd at edvax.de
Wed Feb 1 20:16:43 UTC 2017
On Wed, 1 Feb 2017 14:59:29 -0500, James B. Byrne wrote:
> On Tue, January 31, 2017 14:01, Polytropon wrote:
> > I know, those are very special cases, and if your goal is not
> > portability and "guaranteed availability", then it won't hit you.
> > I just thought it's worth being mentioned.
> Thank you. I have found your explanation of what goes on under the
> covers very interesting. In this case I am dealing with a zfs system
> so if /usr is not there then neither is /bin.
That depends on your actual partitioning. Commonly / contains
/bin (but ZFS layout can easily differ from that concept). On
the / partition, you'll find everything to successfully boot
the system into single user mode (sometimes called "maintenance
mode" or "emergency mode"), which is a state where only / is
mounted read-only and a shell is presented. Historically, the
different partitions resided on different physical disks (due
to size limitation), which today doesn't apply anymore. However,
ZFS allows you to manage system disk content as "fine grained"
as you like, for example different ZFS partitions for /usr/src
and /usr/ports and /usr/local are possible. That /usr/local is
the place where 3rd party software (binaries and libraries) are
stored to per default, and if that partition cannot be mounted
(be it /usr or /usr/local), bash won't be available.
A typical "functional partitioning" approach for UFS consists
of partitions for / (which includes /bin), /tmp, /var, /usr,
and /home. ZFS allows you to be much more precise, and you
can also apply different additions like compression depending
on the use of "sub-partitions" as mentioned above.
In a worst case scenario, rely on what the system provides, and
don't try to override those defaults without good reasons and
sufficient precaution (like a statically linked /bin/bash for
example). There is almost nothing worse than a system that
successfully boots into single user mode, but then surprisingly
cannot start a shell... ;-)
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions