ZFS failure: How do I attach the disk with FreeBSD when booting from a pendrive?

A perfectly functioning 13.1, while there was not as much as a keyboard interrupt, suddenly rebooted, and the boot process was stuck with "Mounting from ZFS:zroot/ROOT/default failed with error 2". I tried booting from multiboot, tried single user mode, tried kernel.old, the same error.

Found this solution in the forum from vermaden :


You need to 'regenerate' the /boot/zfs/zpool.cache file.

To do that, boot from FreeBSD live CD, then after attaching the GELI devices do:
Code:
# zpool import -f -o cachefile=/tmp/zpool.cache -o altroot=/mnt YourPoolName
# cp /tmp/zpool.cache /mnt/boot/zfs/zpool.cache
# zpool export YourPoolName
# zpool import YourPoolName
[/QUOTE]

I downloaded 13.1 memstick.img, DDd that to a USB drive, ready to boot from the USB image. But how do I attach the GELI device? I don't have an encrypted disk, "?" from mountroot prompt shows:

List of GEOM managed disk devices:
gpt/zfs0 gpt/swap0 gpt/gptboot0 gpt/efiboot0 nvd0p4 nvd0p3 nvd0p2 nvd0

When I boot from the USB, how do I attach any of these devices? Which one? By what command syntax? Will it give me root prompt as below? Please help.

Thank you.
 
IMG_20221027_162401_2 (1).jpg
Alain De Vos Did that. Attaching a photo. Not sure what to do, given the error zroot FAULTED, and "no ppols available" Run zpool imprt with a -f flag?

Update: I ran the zpool command with the same syntax given by vermaden but may be I got the pool name wrong or the command parameters wrong. Attaching another screenshot

16668694101481622812353645814924.jpg





Thanks
 
Without backup or mirror this looks very bad.
You could try
Code:
zpool import -f -o altroot=/mnt/zroot
zpool clear zroot
If that does not work you could try,
Code:
zpool clear nvd0p4
Have a look at the output of
Code:
zpool status -v
 
Without backup or mirror this looks very bad.
You could try
Code:
zpool import -f -o altroot=/mnt/zroot
zpool clear zroot
If that does not work you could try,
Code:
zpool clear nvd0p4
Have a look at the output of
Code:
zpool status -v
 
Before "clear" or "status" it might be needed to "import" the pool with "force"
Code:
zpool import -f -o altroot=/mnt/zroot
If the import fails I don't know [ probably a broken disk leading to a broken filesystem]
 
16668708093755204721564101483523 (1).jpg


Alain De Vos Thank you. I did that. "FAULTED. corrupted data. no such pool. no pools available. May be, just may be, this has something to do with the nvme not detected or mounted by the live cd?

Alain De Vos

mount shows:

/dev/ifs/FreeBSD_Install on / (ufs, local, noatime, read-only)

devfs on /dev (devfs)
tempfs on /tmp (tempfs, local)
temps on /var (temps, local)
#

geom disk list

Image attached
16668740719702511458865383023771.jpg
 
Thank you Alain De Vos When I try to boot from harddisk I get mountroot prompt.

From LIVECD root, kldload nvme
returns "can't load nvme, module already loaded" but kldstat doesn't show nvme.

kldstat from LIVECD root.jpg


Also wondering if something is amiss here. How would I find out if the hard disk boot process (not the LIVECD) loads kld nvme? I can only get to mountroot or boot prompt. Root commands wouldn't work.

LIVECD is read-only, don't know how to try and mount nvme, nor do I know how to access and copy files.
 
Back
Top