ZFS NVME screwed, zpool dataset error: How to access and safely recover data in nvd0p4 to another device.

I have this nvd0 NVMe ssd, after a power failure, it's stuck in mountroot with error 6.

I can link the hwprobe link.

Anyone who can shine some light here?

I just want to access and transfer data in nvd0p4.

Use data recovery tool? live cd? shell?

Can't I just install a new system -like Windows and have a safe 'D drive' from 'System C' where OS is installed?

zpool is seriously sophisticated and way too complicated for my level.

Seriously, what is wrong with my root on ZFS? What am I doing wrong?
 
I don't understand what you are saying here.
thank you for your interest,
I meant the system specs,

story: freeBSD 13.1 release 9, haven't accessed since July 2023.
laptop battery gave up at some point, and since then:


Mounting from zfs:zroot/ROOT/default failed with error 6.
mountroot>

i realize zfs is not my cup of tea, have I meddled enough. Some similar issues hint towards NVME driver issue (forum), my laptop may share some guilt in terms hardware error which I might not know.

I want to get my hands on data on nvd0p4.

I'm from a third world country, I chewed more than I could swallow -made freeBSD my daily driver, and saved my files in it without backup.

I don't know what to do.
 
Agree. And if that doesn't work right away, try to debug using the USB stick installation: what do you see in dmesg? Is the NVME device visible in that output? Error 6 indicates ENXIO, which means some device is not actually present. If the device is present, try reading it a little bit (for example dd if=/dev/xxx bs=4096 | hexdump -C | more, or dd if=/dev/xxx of=dev/null bs=4096 count=1000). Use gpart to check that it still has a valid partition table. Look at what error message ZFS gives. And so on.
 
Mounting from zfs:zroot/ROOT/default failed with error 6.
mountroot>
if you reach there then somehow the freebsd partition is accessible (your kernel got loaded somehow)
if you stop the loader (escape to prompt) and type lsdev what does it show ?
 
Boot from a USB stick and try to mount the existing ZFS.
thank you,
I'm confused as to which one to mount?
I tried zfs:/dev/nvd0p1 it gives SOLARIS:some error
 

Attachments

  • 3 live cd.jpg
    3 live cd.jpg
    1 MB · Views: 41
  • 4 live cd.jpg
    4 live cd.jpg
    688.8 KB · Views: 38
Agree. And if that doesn't work right away, try to debug using the USB stick installation: what do you see in dmesg? Is the NVME device visible in that output? Error 6 indicates ENXIO, which means some device is not actually present. If the device is present, try reading it a little bit (for example dd if=/dev/xxx bs=4096 | hexdump -C | more, or dd if=/dev/xxx of=dev/null bs=4096 count=1000). Use gpart to check that it still has a valid partition table. Look at what error message ZFS gives. And so on.
I'm not sure whether to go with the second command,
but the first one gives something like this:
 

Attachments

  • 20241101_073309.jpg
    20241101_073309.jpg
    1.9 MB · Views: 34
  • 20241101_073323.jpg
    20241101_073323.jpg
    1.8 MB · Views: 36
Mounting from zfs:zroot/ROOT/default failed with error 6.
mountroot>
if you reach there then somehow the freebsd partition is accessible (your kernel got loaded somehow)
if you stop the loader (escape to prompt) and type lsdev what does it show ?
something like this:
 

Attachments

  • 20241101_074215.jpg
    20241101_074215.jpg
    1.4 MB · Views: 32
Agree. And if that doesn't work right away, try to debug using the USB stick installation: what do you see in dmesg? Is the NVME device visible in that output? Error 6 indicates ENXIO, which means some device is not actually present. If the device is present, try reading it a little bit (for example dd if=/dev/xxx bs=4096 | hexdump -C | more, or dd if=/dev/xxx of=dev/null bs=4096 count=1000). Use gpart to check that it still has a valid partition table. Look at what error message ZFS gives. And so on.
here's the second part
 

Attachments

  • 20241101_075917.jpg
    20241101_075917.jpg
    1.7 MB · Views: 29
  • 20241101_075940.jpg
    20241101_075940.jpg
    1.8 MB · Views: 31
Those outputs all look good; I don't see why it shouldn't be able to boot from the NVME disk.
well, thank you
perhaps it's not my cup of tea,
however I intend to learn, so thank you, means a great deal!
 

Attachments

  • 20241101_073132.jpg
    20241101_073132.jpg
    913.6 KB · Views: 31
  • 20241031_165631.jpg
    20241031_165631.jpg
    1.6 MB · Views: 34
  • 20241031_161225.jpg
    20241031_161225.jpg
    1.4 MB · Views: 36
  • 20241031_160158.jpg
    20241031_160158.jpg
    1.1 MB · Views: 30
  • 20241031_161023.jpg
    20241031_161023.jpg
    866.1 KB · Views: 33
The fourth and fifth picture (output from gpart) look normal. Can someone who has NVME disks check pictures 1 and 2?
here's output for # nvmecontrol identify nvme0
 

Attachments

  • 20241102_093148.jpg
    20241102_093148.jpg
    1.8 MB · Views: 29
  • 20241102_093201.jpg
    20241102_093201.jpg
    1.7 MB · Views: 26
  • 20241102_093209.jpg
    20241102_093209.jpg
    1.8 MB · Views: 27
  • 20241102_093307.jpg
    20241102_093307.jpg
    1 MB · Views: 30
You could try this method:

format a usb key as an efi filesystem (msdos fat32 should be enough)

Create the directory EFI , etc and boot.

On the EFI directory you put the loader.efi as EFI/BOOT/bootx64.efi
On the boot directory (at the root of the filesystem), copy from the installer for your version all the contents of boot.

Then edit boot/loader.conf
You should remove anything that says growfs, and add/change the line about vfs.root.mountfrom to
Code:
vfs.root.mountfrom="zfs:zroot/ROOT/default"

On the etc, you should create rc.conf, that will contain at least the hostname
Code:
hostname="yourhostname"

Once all this is done, boot from the usb key.
 
You could try this method:

format a usb key as an efi filesystem (msdos fat32 should be enough)

Create the directory EFI , etc and boot.

On the EFI directory you put the loader.efi as EFI/BOOT/bootx64.efi
On the boot directory (at the root of the filesystem), copy from the installer for your version all the contents of boot.

Then edit boot/loader.conf
You should remove anything that says growfs, and add/change the line about vfs.root.mountfrom to
Code:
vfs.root.mountfrom="zfs:zroot/ROOT/default"

On the etc, you should create rc.conf, that will contain at least the hostname
Code:
hostname="yourhostname"

Once all this is done, boot from the usb key.
sure, thank you,
I will definitely give it a try!
 
I might be barking up the wrong tree (especially because there's FAT involved) - but is it to do with case?
Code:
% ls /boot/lua
cli.lua            config.lua        drawer.lua        gfx-beastiebw.lua    gfx-orb.lua        hook.lua        menu.lua        screen.lua
color.lua        core.lua        gfx-beastie.lua        gfx-fbsdbw.lua        gfx-orbbw.lua        loader.lua        password.lua
So the message is that is can't find /boot/lua/loader.lua and that's because you've got /BOOT/LUA/LOADER.LUA?

But this might be a red herring/FAT system issue.
 
At this point, if there were any alternatives to access data in nvd0p1, and copy to external drive, that'd be great.
I asked around major cities in my country, and there is no such place that deals with ZFS data recovery.
 
You can boot into a FreeBSD live environment, then drop in a shell and do:
zpool import -fR /mnt zroot
If this works, you can then do
zfs mount zroot/default/DEFAULT

You should then be able to find all your files under /mnt.
 
Back
Top