# Import the root pool, but don't mount it. Doing `-R /` instead of
# `-R $rootmnt` keeps the namespace sensible after the pivot.
[ "$quiet" != "y" ] && log_begin_msg "Importing ZFS root pool $ZFS_RPOOL"
- zpool import -R / -N "$ZFS_RPOOL"
+ ZFS_STDERR=$(zpool import -R / -N "$ZFS_RPOOL" 2>&1)
ZFS_ERROR=$?
[ "$quiet" != "y" ] && log_end_msg
if [ "$ZFS_ERROR" -ne 0 ]
then
- echo ""
echo "Command: zpool import -R / -N $ZFS_RPOOL"
+ echo "Message: $ZFS_STDERR"
echo "Error: $ZFS_ERROR"
echo ""
echo "Manually import the root pool at the command prompt and then exit."
if [ -z "$ZFS_BOOTFS" ]
then
- echo ""
echo "Command: zpool list -H -o bootfs $ZFS_RPOOL"
echo "Error: $ZFS_ERROR, unable to get the bootfs property."
echo ""
echo "Manually mount the root filesystem on $rootmnt and then exit."
+ echo "Hint: Try: mount -t zfs -o zfsutil $ZFS_RPOOL/ROOT/system $rootmnt"
/bin/sh
fi
# Force the mountpoint to the only correct value for a root filesystem.
[ "$quiet" != "y" ] && log_begin_msg "Setting mountpoint=/ on ZFS filesystem $ZFS_BOOTFS"
- zfs set -o mountpoint=/ "$ZFS_BOOTFS"
+ ZFS_STDERR=$(zfs set -o mountpoint=/ "$ZFS_BOOTFS" 2>&1)
[ "$quiet" != "y" ] && log_end_msg
# Ideally, the root filesystem would be mounted like this:
# `zfs mount -a` and the /etc/mtab refresh.
[ "$quiet" != "y" ] && log_begin_msg "Mounting ZFS filesystem $ZFS_BOOTFS"
- mount -t zfs -o zfsutil "$ZFS_BOOTFS" "$rootmnt"
+ ZFS_STDERR=$(mount -t zfs -o zfsutil "$ZFS_BOOTFS" "$rootmnt" 2>&1)
ZFS_ERROR=$?
[ "$quiet" != "y" ] && log_end_msg
then
echo ""
echo "Command: mount -t zfs -o zfsutil $ZFS_BOOTFS $rootmnt"
+ echo "Message: $ZFS_STDERR"
echo "Error: $ZFS_ERROR"
echo ""
echo "Manually mount the root filesystem on $rootmnt and then exit."