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

Sorry,ok...

Code:
zfs mount zroot/ROOT/31-03-2022-b

nano /boot/loader.conf

loader_logo="daemon"
vmm_load="YES"
nmdm_load="YES"
if_tap_load="YES"
if_bridge_load="YES"
bridgestp_load="YES"
#fuse_enable="YES"
fusefs_load="YES"
tmpfs_load="YES"
verbose_loading="YES"
pptdevs="0/2/0 2/0/0 2/0/1 2/0/2 2/0/3"
#pptdevs="0/2/0"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
#snd_hda_load="YES"
#snd_load="YES"
zfs_load="YES"
kern.racct.enable=1
#nvidia_load="YES"
aio_load="YES"
vboxdrv_load="YES"
#virtio_load="YES"
#virtio\_pci\_load="YES"
#virtio\_blk\_load="YES"
#if\_vtnet\_load="YES"
#virtio\_balloon\_load="YES"
 
Code:
gedit /mnt/zroot/etc/fstab


# Device        Mountpoint        FStype        Options        Dump    Pass#

/dev/ada0p1        /boot/efi        msdosfs        rw        2    2
/dev/ada0p3        none            swap        sw        0    0
linprocfs        /compat/linux/proc    linprocfs    rw        0    0
linsysfs        /compat/linux/sys    linsysfs    rw        0    0
tmpfs            /compat/linux/dev/shm    tmpfs        rw,mode=1777    0    0
fdesc              /dev/fd             fdescfs         rw            0       0
proc                  /proc               procfs          rw                 0       0
 

# gpart show /dev/ada0


=>       40  976773095  ada0  GPT  (466G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528    4194304     3  freebsd-swap  (2.0G)
    4728832  972044288     4  freebsd-zfs  (464G)
  976773120         15        - free -  (7.5K)
 
That's not a pool, that's a dataset. The pool is zroot.

there is no need to make a thumb up here...it's a choice that sounds no good....Im trying to understand how zfs works,but its tricky and I'm still a lot ignorant...there is no need to remember that to me :p
 
Some of you would like to access to my system using ssh and try to repair the problem from within ? I really don't want to reinstall everything.
 
You have both an EFI and a freebsd-boot partition, which is not the norm. Do you know which you are using? May be a red herring, but just something I noticed.
 
I had once seriously broken my root dataset.
Here is how i fixed it:
- Boot with an usb stick
- Did an altroot import of the zpool of this dataset , "zpool import -f -R /mnt/altroot nomadbsd-zroot "
- Make mount directory "mkdir /mnt/test"
- Performed a legacy mount of / on it, ie "mount -t zfs nomadbsd-zroot/ROOT/default /mnt/test"
- Made a backup of etc , "cp -vfR /mnt/test/etc directory /mnt/test/etc_old"
- Performed a "chflags -R noschg /mnt/test"
-Grabbed base.txz , kernel.txz from:
-Untarred these files into the mounted /mnt/test, ie "cd /mnt/test ; tar xvfz base.txz ; tar xvfz kernel.txz
-After it my system rebooted normally.
-then i did "pkg update -f" to reinstall all packages

This method works even if you did by accident
Code:
rm -fR /usr/local
rm -fR /usr/bin
rm -fR /bin
I don't now if it's clear what i want to achieve & how.
 
Note , you can safely add to /boot/loader.conf:
Code:
opensolaris_load="YES"
### Selects the default device to loader the kernel from
currdev="zfs:nomadbsd-zroot/ROOT/default:"
### Specify the root partition to mount
vfs.root.mountfrom="zfs:nomadbsd-zroot/ROOT/default"
 
Maybe you mean :

Code:
currdev="zfs:zroot/ROOT/default"
vfs.root.mountfrom="zfs:zroot/ROOT/default"
 
That's a decision you must make or zroot or nomad-bsd.
I only looked at your output,
# 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"
 
nomad boots and works perfectly. Sure because I can't boot the zroot installation,so I switch to nomad.
 
ok. I've added these parameters to /boot/loader.conf :

Code:
currdev="zfs:zroot/ROOT/default"
vfs.root.mountfrom="zfs:zroot/ROOT/default"

and I tried to boot zroot and this is what happened :

index.jpg
 
Do you know if your boot loader (efi or freebsd-boot, again it's not clear which you are using, since you have both) has been updated recently? You shouldn't need the vfs.root.mountfrom with a recent boot loader and bootfs set on the zroot.

Either way, you would want zroot/ROOT/31-03-2022-b , as you don't have a zroot/ROOT/default. (But again, you shouldn't need to set that, and you would need to keep updating it to the boot environment you want, although beadm should adjust it for you.)
 
I'm using EFI. I found this thread,where the OP seems to have a problem similar to mine and I tried to issue the commands suggested :


According to the screenshot, the bootfs property on zroot is set to
zroot/ROOT/default. Does that dataset exist?

While at the loader prompt, what does these commands tell you?

lszfs zroot
lszfs zroot/ROOT

If you see some other potential dataset, try setting currdev using
this as a template before booting:

He says to do this :

set currdev="zfs:zroot/ROOT/some-other-dataset:"

Next, unload the old stuff, and try to load the new stuff:

unload
load /boot/kernel/kernel
load /boot/kernel/opensolaris.ko
load /boot/kernel/zfs.ko

Boot into single user mode:

boot -s

On the attached pics you can see what happened. It has accepted each/every command suggested. I've rebooted the system in single user mode and I saw the error again,I wrote "boot -s",but it didn't boot.
 

Attachments

  • 1.jpg
    1.jpg
    176.3 KB · Views: 40
  • 2.jpg
    2.jpg
    138.4 KB · Views: 40
  • 3.jpg
    3.jpg
    135 KB · Views: 37
  • 4.jpg
    4.jpg
    120.4 KB · Views: 41
I've added these parameters to /boot/loader.conf :

Code:
currdev="zfs:zroot/ROOT/31-03-2022-b"
vfs.root.mountfrom="zfs:zroot/ROOT/31-03-2022-b"

and I tried to boot it,but I've got the same error.
 
Code:
Mounting local filesystem
eval : zfs not found
eval: touch not found
/etc/rc : date not found
 
Note , you can safely add to /boot/loader.conf:
Code:
opensolaris_load="YES"
### Selects the default device to loader the kernel from
currdev="zfs:nomadbsd-zroot/ROOT/default:"
### Specify the root partition to mount
vfs.root.mountfrom="zfs:nomadbsd-zroot/ROOT/default"

why opensolaris_load="YES" ? what is this ?
 
I played a little bit with the canmount option and maybe I made some progress. At least,now it is able to overcome the point where yesterday it was frozen,but unfortunately it froze later,showing that a lot of "eval" values are missing. So,what I did has been to turn off the nomadbsd-zroot disk and I've booted the freebsd that I was previously installed on a UFS disk and I did :

Code:
# zpool import -f -R /mnt/zroot zroot
# zfs set canmount=noauto zroot/ROOT/13.1-RELEASE-p2_2022-11-11_174736
# zfs set canmount=noauto zroot/ROOT/13.1-RELEASE-p3_2022-11-17_193042
# zfs set canmount=noauto zroot/ROOT/13.1-RELEASE_2022-09-01_041825
# zfs set canmount=on zroot/ROOT/31-03-2022-a
# zfs set canmount=on zroot/ROOT/31-03-2022-b
# zfs set canmount=on zroot/usr
# zfs set canmount=on zroot/var

and when I rebooted,the messages on the screen changed,so maybe these changes can put someone on the right track to understand how to fix it.

index.jpg
 
This is the actual situation of the canmount option :

Code:
# zfs list -r -o name,canmount,mountpoint zroot                            NAME                                          CANMOUNT  MOUNTPOINT

zroot                                         on        /mnt/zroot/zroot
zroot/ROOT                                    on        none
zroot/ROOT/13.1-RELEASE-p2_2022-11-11_174736  noauto    /mnt/zroot
zroot/ROOT/13.1-RELEASE-p3_2022-11-17_193042  noauto    /mnt/zroot
zroot/ROOT/13.1-RELEASE_2022-09-01_041825     noauto    /mnt/zroot
zroot/ROOT/31-03-2022-a                       on        /mnt/zroot
zroot/ROOT/31-03-2022-b                       on        /mnt/zroot
zroot/tmp                                     on        /mnt/zroot/tmp
zroot/usr                                     on        /mnt/zroot/usr
zroot/usr/home                                on        /mnt/zroot/usr/home
zroot/usr/ports                               on        /mnt/zroot/usr/ports
zroot/usr/src-                                on        /mnt/zroot/usr/src-
zroot/var                                     on        /mnt/zroot/var
zroot/var/audit                               on        /mnt/zroot/var/audit
zroot/var/crash                               on        /mnt/zroot/var/crash
zroot/var/log                                 on        /mnt/zroot/var/log
zroot/var/mail                                on        /mnt/zroot/var/mail
zroot/var/tmp                                 on        /mnt/zroot/var/tmp
 
Useful command: zfs list -r -o name,canmount,mountpoint zroot

Double check your mountpoints too.

For reference, this is a fairly standard install:
Code:
dice@maelcum:~ % zfs list -r -o name,canmount,mountpoint zroot
NAME                                          CANMOUNT  MOUNTPOINT
zroot                                         on        /zroot
zroot/ROOT                                    on        none
zroot/ROOT/13.1-RELEASE-p3_2022-11-16_162652  noauto    /
zroot/ROOT/13.1-RELEASE-p4_2022-12-05_005351  noauto    /
zroot/ROOT/13.1-RELEASE_2022-11-06_211508     noauto    /
zroot/ROOT/default                            noauto    /
zroot/tmp                                     on        /tmp
zroot/usr                                     off       /usr
zroot/usr/home                                on        /usr/home
zroot/usr/ports                               on        /usr/ports
zroot/usr/src                                 on        /usr/src
zroot/var                                     off       /var
zroot/var/audit                               on        /var/audit
zroot/var/crash                               on        /var/crash
zroot/var/log                                 on        /var/log
zroot/var/mail                                on        /var/mail
zroot/var/tmp                                 on        /var/tmp

why zroot/usr and zroot/var are set to off ?
 
This is the actual situation of the canmount option :

Code:
# zfs list -r -o name,canmount,mountpoint zroot
NAME                                          CANMOUNT  MOUNTPOINT
[..]
zroot/ROOT/31-03-2022-a                       on        /mnt/zroot
zroot/ROOT/31-03-2022-b                       on        /mnt/zroot
[..]
zroot/usr                                     on        /mnt/zroot/usr
[..]
zroot/var                                     on        /mnt/zroot/var
You don't want multiple datasets mounted at the same point. This currently says to mount both ...2022-a and -b at / (shown as /mnt/zroot due to altroot=/mnt/zroot import)

zroot/usr and zroot/var are there to be containers for other filesystems/directories (rather than mounted filesystems themselves) that you don't want versioned with boot environments. (var/log, var/mail, for example.) They should be set to canmount=off; setting them to on will mount them over the /usr directory tree that is part of your mounted (/) boot environment. (Again, which you currently have two filesystems set to be mounted at /, which is not what you want.)

It's not clear to me at this point what is broken, unfortunately; you could try (with all BEs set to noauto, and setting the zpool bootfs property) the different boot environments.

I mentioned before making sure your bootloader has been updated. Has it been at any point? When was (what FreeBSD version) this system first installed?
 
So,ok. I need to restore the proper canmount values like before,because experimenting with the goal to fix the error I set them differently. At the moment they are like this :

Code:
# zfs list -r -o name,canmount,mountpoint zroot

NAME                                          CANMOUNT  MOUNTPOINT

zroot                                         on        /mnt/zroot/zroot
zroot/ROOT                                    on        none
zroot/ROOT/13.1-RELEASE-p2_2022-11-11_174736  noauto    /mnt/zroot
zroot/ROOT/13.1-RELEASE-p3_2022-11-17_193042  noauto    /mnt/zroot
zroot/ROOT/13.1-RELEASE_2022-09-01_041825     noauto    /mnt/zroot
zroot/ROOT/31-03-2022-a                       noauto    /mnt/zroot
zroot/ROOT/31-03-2022-b                       noauto    /mnt/zroot
zroot/tmp                                     on        /mnt/zroot/tmp
zroot/usr                                     on        /mnt/zroot/usr
zroot/usr/home                                on        /mnt/zroot/usr/home
zroot/usr/ports                               on        /mnt/zroot/usr/ports
zroot/usr/src-                                on        /mnt/zroot/usr/src-
zroot/var                                     off       /mnt/zroot/var
zroot/var/audit                               on        /mnt/zroot/var/audit
zroot/var/crash                               on        /mnt/zroot/var/crash
zroot/var/log                                 on        /mnt/zroot/var/log
zroot/var/mail                                on        /mnt/zroot/var/mail
zroot/var/tmp                                 on        /mnt/zroot/var/tmp

If I have understood well,I should set as off the value of canmount for zroot/usr and zroot/var,but unfortunately it won't do that for the directory usr :

Code:
# zfs set canmount=off zroot/usr
cannot unmount '/mnt/zroot/usr/home': pool or dataset is busy

how to fix it ?

FIXED,going out of the /mnt/zroot folder :

Code:
# cd /
# zfs set canmount=off zroot/usr
# zfs list -r -o name,canmount,mountpoint zroot

NAME                                          CANMOUNT  MOUNTPOINT

zroot                                         on        /mnt/zroot/zroot
zroot/ROOT                                    on        none
zroot/ROOT/13.1-RELEASE-p2_2022-11-11_174736  noauto    /mnt/zroot
zroot/ROOT/13.1-RELEASE-p3_2022-11-17_193042  noauto    /mnt/zroot
zroot/ROOT/13.1-RELEASE_2022-09-01_041825     noauto    /mnt/zroot
zroot/ROOT/31-03-2022-a                       noauto    /mnt/zroot
zroot/ROOT/31-03-2022-b                       noauto    /mnt/zroot
zroot/tmp                                     on        /mnt/zroot/tmp
zroot/usr                                     off       /mnt/zroot/usr
zroot/usr/home                                on        /mnt/zroot/usr/home
zroot/usr/ports                               on        /mnt/zroot/usr/ports
zroot/usr/src-                                on        /mnt/zroot/usr/src-
zroot/var                                     off       /mnt/zroot/var
zroot/var/audit                               on        /mnt/zroot/var/audit
zroot/var/crash                               on        /mnt/zroot/var/crash
zroot/var/log                                 on        /mnt/zroot/var/log
zroot/var/mail                                on        /mnt/zroot/var/mail
zroot/var/tmp                                 on        /mnt/zroot/var/tmp
 
Back
Top