0

I have an ssd drive with failed controller and which was a part of a mirrored zfs vdev. Now it boots into initramfs and says that it can't import pool "rpool". when i issue

zpool import -f rpool 

it says that there's no such pool or dataset. However, in "zpool import" can see that rpool has status UNAVAIL because of insufficient replicas. i would like to replace the dead drive with a new one. I have tried:

1) zpool replace
2) zpool offline
3) zpool detach

and everytime i get that there's no such pool or dataset. The only way i got it working was by importing as read only by using:

echo "1" | sudo tee /sys/module/zfs/parameters/zfs_max_missing_tvds
zpool import -o readonly=on rpool

output of zpool import as a screenshot: https://prnt.sc/91X8xc3vG1SA I have it mounted as read-only and the zpool status output is: https://prnt.sc/vKzNL0nUFALc

Mounting as read-only boots into the OS. However since it's mounted as readonly i can't actually make any changes to the pool like replacing the damaged drive. Any suggestions?

Meni
  • 91
  • 1
  • 8
  • Have you try to backup the information, destroy the pool and recreate it? – Romeo Ninov Oct 18 '22 at 09:04
  • @RomeoNinov Unfortunately i don't have backups of the pool :( – Meni Oct 18 '22 at 09:13
  • As I read you can import it as r/o which is enough to make backup – Romeo Ninov Oct 18 '22 at 09:27
  • @RomeoNinov i actually haven't thought about it until now. I guess you're right, i could restore from it. Isn't there a much easier option like just replacing the faulty drive? What is the meaning of having a mirrored pool if i can't just replace the drive? it should be an easy process, like using mdadm. – Meni Oct 18 '22 at 10:03
  • `mdadm` is not about ZFS. And this is root filesystem so it's not so sample (especially on PC hardware) – Romeo Ninov Oct 18 '22 at 10:12
  • Any other suggestions? – Meni Oct 18 '22 at 11:22
  • Try to use original Solaris (live CD) and not install but try to manage the pool. – Romeo Ninov Oct 18 '22 at 11:27
  • Where's the second device from a mirror ? Unless there's no second device (means you now have non-redundant pool) all you can do is to accept the loss of data. – drookie Oct 18 '22 at 12:14
  • @drookie the pool consists of 2 mirrored devices. there shouldnt be any data loss. – Meni Oct 18 '22 at 12:15
  • I don't see any `zpool status` output, only some vague stories. Doubt there's even a pool. – drookie Oct 18 '22 at 12:18
  • @drookie i have added a screenshot in the original question. – Meni Oct 18 '22 at 12:51

1 Answers1

1

Your rpool is merely a span. I don't see a mirror configuration at all (by the way it should be marked as UNAVAIL, I don't understand why it's DEGRADED, but you are probably running some old zfs version). Accept the loss of data, apreciate the experience. Two other pools are unaffected.

drookie
  • 8,625
  • 1
  • 19
  • 29
  • Thank you forinvesting your time in this, i really appreciate it. if i mount it as read-only it boots the OS and all files are intact. please checkout screenshot: https://prnt.sc/vKzNL0nUFALc – Meni Oct 18 '22 at 13:33
  • I guess i didn't want to accept the inevitable. Thank you for clarifying. i appreciate it. – Meni Oct 21 '22 at 18:08