My main FreeBSD 13.1 installation freezes at some point of the booting process showing these messages :
Mounting local filesystem
eval : zfs not found
eval: touch not found
/etc/rc : date not found
I know that the problem is caused by the incorrect dataset that was mounted by me as a mistake and for this reason now /bin and stuff are missing. I'm not able to figure out how to fix it.
This is the disk "broken" :
NAME USED AVAIL REFER MOUNTPOINT
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
I've found 50% of the solution. I've detached every external disks and I've found that this disk :
=> 40 1953525095 da4 GPT (932G)
40 532480 1 efi (260M)
532520 1024 2 freebsd-boot (512K)
533544 984 - free - (492K)
534528 4194304 3 freebsd-swap (2.0G)
4728832 1948794880 4 freebsd-zfs (929G)
1953523712 1423 - free - (712K)
interferes with the booting of the disk which contains the zroot pool :
=> 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)
It means that if I boot FreeBSD installed on the disk ada0 and the USB disk da4 is attached to the PC,I get those errors. It looks the installation files of a previous FreeBSD installation that I made on that disk OR I have connected the zroot pool to that disk. The two disks are connected in some way,but I don't know how. So,I want to break that connection. I've checked if there is some errors inside the fstab file,but it does not seem :
# 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
maybe the connection is inside the /boot folder of the disk ada0,but I'm not able to understand where it could be. If I boot FreeBSD without attaching the usb disk da4,I don't get those errors and FreeBSD installed on ada0 boot totally and correctly.
This is the content of the disk da4 :
# zpool import -f -R /mnt/zroot2 zroot2
ok
mario@marietto:/mnt/zroot2 # ls
boot dev tmp usr var zroot zroot2
mario@marietto:/mnt/zroot2 # cd zroot2
mario@marietto:/mnt/zroot2/zroot2 # ls
Data Informations backup
As you can see there have been placed the typical files of a zfs pool. Now should be easy for someone of you understanding what to do. Please help me I don't want to detach the disk da4 every time I want to use FreeBSD.
mountpoint
andcanmount
properties of datasets in zroot2 - e.g. withzfs get mountpoint,canmount -r -t filesystem zroot2
. Does one or more of the datasets have a mountpoint of/
or/bin
(or/usr
or/usr/bin
or something else that would mount that pool's datasets in place of the root pool's)? If so, change it/them. Or just change the top-levelzroot2
's properties and the children will inherit. Read up onmountpoint
andcanmount
("no" or "noauto" are probably what you need) inman zfsprops
, and the "Mount Points" section inman zfsconcepts
.