# Boot to mountroot, anyway to rescue it ?



## freeink (Dec 3, 2019)

I installed the FreeBSD with partition option by  "Auto (ZFS ) Guided Root-on-ZFS"
works well for several days on my T420s.
but after add a line "kern.vty=vt"   to   /boot/loader.conf  bad things happen, it always boot to mountroot.
is my root on ada0p4  ? should I type: "zfs:zroot/ROOT/ada0p4"?  I end up in "mountroot" with the unknown file system error. 

ad0 on second picture is a bootable 16G USB flash disk, I use it boot into bsdinstall to check my ada0 status.


----------



## malaizhichun (Dec 4, 2019)

this is look like a bug, there are similar error in my laptop,you need to a lot of times reboot


----------



## freeink (Dec 4, 2019)

"Auto (ZFS ) Guided Root-on-ZFS"  is a experimental function in earlier version.

How to manually create ZFS partitions to install FreeBSD?


----------



## VladiBG (Dec 5, 2019)

Boot using your "Live CD" then import the zpool(8) and fix your loader.conf

example:
1. Boot under LiveCD from bootable usb drive or CD
2. Login using root without password
3. Create an altroot mount point under _/tmp/root_
`mkdir /tmp/root`
4. Import the zroot pool under the _/tmp/root_
`zpool import -fR /tmp/root zroot`
(notice there's no trailing forward slash after /tmp/root)
5. Mount the _zroot/ROOT/default_ which contain the _/boot_
`zfs mount zroot/ROOT/default`
6. Edit your loader.conf which now is mounted under _/tmp/root/boot_
`ee /tmp/root/boot/loader.conf`
remove the last modification from it
if you have
`"kern.vty=yes"` #this is wrong
it should be removed or modified to
`kern.vty="yes"` # it's not necessary to be in loader.conf as it's  default. value
then press "ESC" -> leave editor -> save changes
7. Export the zpool
`cd /`
`zpool export zroot`
8. Shutdown and remove the usb bootable drive or cd then boot normally
`shutdown -p now`

loader.conf (FreeBSD 12.1 zfs)
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
opensolaris_load="YES"
zfs_load="YES"


----------



## SirDice (Dec 5, 2019)

freeink said:


> but after add a line "kern.vty=vt" to /boot/loader.conf bad things happen, it always boot to mountroot.


The vt(4) console is the default, there's no need to set it explicitly. But even if you did it would have zero effect on boot settings. So I suspect you've made a typo and that's causing the boot failure.


----------



## gladiola (Dec 12, 2019)

VladiBG said:


> Boot using your "Live CD" then import the zpool(8) and fix your loader.conf
> 
> example:
> 1. Boot under LiveCD from bootable usb drive or CD
> ...


These directions gave me hope when I had another problem with boot loader.conf.  Thanks again, many times.


----------



## simonpie (Oct 29, 2020)

Hello,

I wonder if you ever solved this problem.  I just got it this morning.  I did a rollback from 12.2 to 12.1 and Bam, cannot boot.  I have a the mountroot prompt.  I have tried to follow vladiBG but my [FONT=courier new]loader.conf[/FONT] is much simple and there are no such options :


```
cat loader.conf                 
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
vfs.zfs.min_auto_ashift=12
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
vfs.zfs.min_auto_ashift=12
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
vfs.zfs.min_auto_ashift=12
zfs_load="YES"
```

Event the instruction to mount the [FONT=courier new]zroot/ROOT/default[/FONT] volume were not completely effective, I had to change the mountpoint of that volume for it to mount and be able to see the volume's content. 

Any way, I am stuck, any help would be appreciated.


----------



## VladiBG (Oct 29, 2020)

Open another thread for your problem. Your issue is not with vt like in this topic.

According your screenshot your are missing or fail to load  opensolaris.ko and/or zfs.ko

You can try to load them manually from the loader prompt

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


----------

