ZFS Mounting local filesystem ; eval : zfs not found - eval: touch not found - /etc/rc : date not found

I should I mount the zroot pool before to issue your command,because at the moment it is not mounted. I do this with the command :

Code:
zpool import -f -R /mnt/zroot zroot

is that right ?
 
Code:
# zfs list -ro mounted,canmount,mountpoint,name

MOUNTED  CANMOUNT  MOUNTPOINT            NAME

yes      on        /nomadbsd-zroot       nomadbsd-zroot
no       on        none                  nomadbsd-zroot/ROOT
no       noauto    /                     nomadbsd-zroot/ROOT/13.1-RELEASE-p5_2022-12-10_231812
no       noauto    /                     nomadbsd-zroot/ROOT/13.1-RELEASE-p5_2022-12-11_012125
yes      noauto    /                     nomadbsd-zroot/ROOT/default
yes      on        /home                 nomadbsd-zroot/home
no       off       /usr                  nomadbsd-zroot/usr
yes      on        /usr/obj              nomadbsd-zroot/usr/obj
yes      on        /usr/ports            nomadbsd-zroot/usr/ports
yes      on        /usr/ports/distfiles  nomadbsd-zroot/usr/ports/distfiles
yes      on        /usr/ports/packages   nomadbsd-zroot/usr/ports/packages
yes      on        /usr/src              nomadbsd-zroot/usr/src
no       off       /var                  nomadbsd-zroot/var
yes      on        /var/audit            nomadbsd-zroot/var/audit
yes      on        /var/crash            nomadbsd-zroot/var/crash
yes      on        /var/mail             nomadbsd-zroot/var/mail

no       off       /mnt/zroot/zroot      zroot
no       on        none                  zroot/ROOT
no       noauto    /mnt/zroot            zroot/ROOT/13.1-RELEASE-p2_2022-11-11_174736
no       noauto    /mnt/zroot            zroot/ROOT/13.1-RELEASE-p3_2022-11-17_193042
no       noauto    /mnt/zroot            zroot/ROOT/13.1-RELEASE_2022-09-01_041825
no       noauto    /mnt/zroot            zroot/ROOT/31-03-2022-a
yes      on        /mnt/zroot            zroot/ROOT/31-03-2022-b
yes      on        /mnt/zroot/tmp        zroot/tmp
no       off       /mnt/zroot/usr        zroot/usr
yes      on        /mnt/zroot/usr/home   zroot/usr/home
yes      on        /mnt/zroot/usr/ports  zroot/usr/ports
yes      on        /mnt/zroot/usr/src-   zroot/usr/src-
no       off       /mnt/zroot/var        zroot/var
yes      on        /mnt/zroot/var/audit  zroot/var/audit
yes      on        /mnt/zroot/var/crash  zroot/var/crash
yes      on        /mnt/zroot/var/log    zroot/var/log
yes      on        /mnt/zroot/var/mail   zroot/var/mail
yes      on        /mnt/zroot/var/tmp    zroot/var/tmp
 
The errors during boot say zfs,touch,date not found.
Verify if exists:
Code:
/usr/local/sbin/zfs
/bin/date
/usr/bin/touch
Try things like
Code:
mount -av /
&
Code:
zfs mount -a
To avoid problems make sure only one zpool is imported during the boot process.
Perform any necesarry "zpool export" follow by:
Code:
cp /etc/zfs/zpool.cache /boot/zfs/zpool.cache
 
On nomadbsd :

Code:
# ls /usr/local/sbin/zfs
ls: /usr/local/sbin/zfs: No such file or directory

# ls /bin/date
/bin/date

# ls /usr/bin/touch
/usr/bin/touch

On /mnt/zroot :

Code:
# ls /mnt/zroot/bin/date
/mnt/zroot/bin/date

# ls /mnt/zroot/usr/local/sbin/zfs
ls: /mnt/zroot/usr/local/sbin/zfs: No such file or directory

ls /mnt/zroot/usr/bin/touch
/mnt/zroot/usr/bin/touch

The zfs file is missing on both installations.
 
zfs its on /sbin/zfs and /mnt/zroot/sbin/zfs. No problem with the missing files,they are there. In which kind of scenario I should be,before to issue these commands ?


Code:
mount -av /
zfs mount -a
cp /etc/zfs/zpool.cache /boot/zfs/zpool.cache

at the moment I'm running nomadbsd and I have mounted the zroot pool.
 
The boot error you posted an image. It shows some commands are not found, which mostly means something is not mounted.
There is no danger in issuing to two mount commands to see if it fixes.

Then
Code:
zpool list -v
export any unnecesary zpools to boot.
Then
Code:
cp /etc/zfs/zpool.cache /boot/zfs/zpool.cache
On next boot the unnessary zpools are no longer imported.
 
The boot error you posted an image. It shows some commands are not found, which mostly means something is not mounted.
There is no danger in issuing to two mount commands to see if it fixes.

Then
Code:
zpool list -v
export any unnecesary zpools to boot.
Then
Code:
cp /etc/zfs/zpool.cache /boot/zfs/zpool.cache
On next boot the unnessary zpools are no longer imported.

Code:
# zpool list -v


NAME             SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT

nomadbsd-zroot   298G  67.9G   230G        -         -     2%    22%  1.00x    ONLINE  -

  da1s2          298G  67.9G   230G        -         -     2%  22.8%      -    ONLINE

zroot            460G   412G  48.2G        -         -    47%    89%  1.00x    ONLINE  /mnt/zroot

  ada0p4         460G   412G  48.2G        -         -    47%  89.5%      -    ONLINE

---> export any unnecesary zpools to boot.

with which command ?
 
I think I would try zfs set canmount=noauto zroot/ROOT/31-03-2022-b and then reboot. I assume the nomad zpool is on a USB stick and can be removed before the system boots. You could also try (while currently booted) chroot /mnt/zroot and look around to see if everything appears where it should.
 
Can you post the output of,
Code:
kenv | egrep "currdev|mountfrom|kernel_path|kernelname"
to see you current boot kernel & root filesystem.
 
I'm confused. /dev/ada0p1 obviously holds a FFS filesystem and is not ZFS.

Is ada0p1 your intended root filesystem?

where did u read ada0p1 ? it is the efi partition of the broken FreeBSD/ZFS installation. Its root partition is ada0p4 and it is zfs. da1p2 is the root partition of nomadbsd.
 
Code:
# kenv | egrep "currdev|mountfrom|kernel_path|kernelname"

currdev="zfs:nomadbsd-zroot/ROOT/default:"
kernel_path="/boot/kernel"
kernelname="/boot/kernel/kernel"
vfs.root.mountfrom="zfs:nomadbsd-zroot/ROOT/default"
 
All data necesarry to correctly boot should be in dataset "nomadbsd-zroot/ROOT/default".
Do you still see the boot error "eval zfs not found" ? Which is strange.
If this is an nomadbsd-installation you should ask their forum.

Do you have /sbin/zfs ?
 
I think I would try zfs set canmount=noauto zroot/ROOT/31-03-2022-b and then reboot. I assume the nomad zpool is on a USB stick and can be removed before the system boots. You could also try (while currently booted) chroot /mnt/zroot and look around to see if everything appears where it should.

This is what I did :

zfs set canmount=noauto zroot/ROOT/31-03-2022-b
reboot
detached the USB nomadbsd disk
tried to boot main disk ada0 / zfs
same error.
reattached nomad disk
restarted the PC with nomad.
 
All data necesarry to correctly boot should be in dataset "nomadbsd-zroot/ROOT/default".
Do you still see the boot error "eval zfs not found" ? Which is strange.
If this is an nomadbsd-installation you should ask their forum.

Do you have /sbin/zfs ?

yes. Now I'm running nomadbsd and I haven't mounted the zroot pool. Should I do something like this ?

Code:
cp /etc/zfs/zpool.cache /boot/zfs/zpool.cache

and after having issued the command,what should I do ?
 
What's in /boot/loader.conf of the filesystem (zroot/ROOT/31-03-2022-b) you're trying to boot from? /etc/fstab ? gpart show /dev/device_with_zroot_pool ?
 
What's in /boot/loader.conf of the filesystem (zroot/ROOT/31-03-2022-b) you're trying to boot from? /etc/fstab ? gpart show /dev/device_with_zroot_pool ?

Code:
# zpool import -f -R /mnt/zroot zroot/ROOT/31-03-2022-b
cannot import 'zroot/ROOT/31-03-2022-b': no such pool available

root@NomadBSD:/mnt/zroot # zfs list
NAME                                                    USED  AVAIL     REFER  MOUNTPOINT
nomadbsd-zroot                                         67.9G   221G       96K  /nomadbsd-zroot
nomadbsd-zroot/ROOT                                    33.0G   221G       96K  none
nomadbsd-zroot/ROOT/13.1-RELEASE-p5_2022-12-10_231812     8K   221G     31.9G  /
nomadbsd-zroot/ROOT/13.1-RELEASE-p5_2022-12-11_012125     8K   221G     32.1G  /
nomadbsd-zroot/ROOT/default                            33.0G   221G     32.6G  /
nomadbsd-zroot/home                                    31.0G   221G     31.0G  /home
nomadbsd-zroot/usr                                     3.90G   221G       96K  /usr
nomadbsd-zroot/usr/obj                                   96K   221G       96K  /usr/obj
nomadbsd-zroot/usr/ports                                769M   221G      769M  /usr/ports
nomadbsd-zroot/usr/ports/distfiles                       96K   221G       96K  /usr/ports/distfiles
nomadbsd-zroot/usr/ports/packages                        96K   221G       96K  /usr/ports/packages
nomadbsd-zroot/usr/src                                 3.15G   221G     3.15G  /usr/src
nomadbsd-zroot/var                                      424K   221G       96K  /var
nomadbsd-zroot/var/audit                                104K   221G      104K  /var/audit
nomadbsd-zroot/var/crash                                 96K   221G       96K  /var/crash
nomadbsd-zroot/var/mail                                 128K   221G      128K  /var/mail
zroot                                                   412G  33.9G       96K  /mnt/zroot/zroot
zroot/ROOT                                              399G  33.9G       96K  none
zroot/ROOT/13.1-RELEASE-p2_2022-11-11_174736              8K  33.9G      321G  /mnt/zroot
zroot/ROOT/13.1-RELEASE-p3_2022-11-17_193042              8K  33.9G      343G  /mnt/zroot
zroot/ROOT/13.1-RELEASE_2022-09-01_041825                 8K  33.9G      308G  /mnt/zroot
zroot/ROOT/31-03-2022-a                                 512K  33.9G     43.4G  /mnt/zroot
zroot/ROOT/31-03-2022-b                                 399G  33.9G      318G  /mnt/zroot
zroot/tmp                                              15.0M  33.9G     15.0M  /mnt/zroot/tmp
zroot/usr                                              11.2G  33.9G       96K  /mnt/zroot/usr
zroot/usr/home                                          192K  33.9G      192K  /mnt/zroot/usr/home
zroot/usr/ports                                        11.2G  33.9G     11.2G  /mnt/zroot/usr/ports
zroot/usr/src-                                           96K  33.9G       96K  /mnt/zroot/usr/src-
zroot/var                                              1.26G  33.9G       96K  /mnt/zroot/var
zroot/var/audit                                          96K  33.9G       96K  /mnt/zroot/var/audit
zroot/var/crash                                        1.11G  33.9G     1.11G  /mnt/zroot/var/crash
zroot/var/log                                          3.91M  33.9G     3.91M  /mnt/zroot/var/log
zroot/var/mail                                          130M  33.9G      130M  /mnt/zroot/var/mail
zroot/var/tmp                                          18.1M  33.9G     18.1M  /mnt/zroot/var/tmp
 
Back
Top