While attempting to fix the last of my damaged zpools, there's one that
consists of 4 drives + one 60G file.  The file happened by accident - I
attempted to add a partition off an SSD drive but missed the cache
keyword.  Of course, once this is done, there's no way to remove the new
unwanted member.  I fixed this by creating a file with mkfile, and
adding the file as a mirror of the SSD partition, then removed the SSD
partition from the zpool and kept the file around.

Over time something went wrong with this zpool and it hung the OS from
booting, so I removed it from the machine, but held on to it so I could
attempt to recover.

I'm trying to recover it now, but when I try to import it without cache
and read only, it tells me a member is missing (the file of course). 
But, how do I pass the file name as a member of the zpool to the import

Since it's only 60g, I suppose I could dd the file over to an external
USB drive.  Would that work?  Do I have to write it to slice 0, or a
whole volume (slice 2)? I'm guessing this might be the path of least

Or is there some hidden option to zpool import where you can pass it
file/device names that I'm no aware of?  (Attempting to use zpool online
poolname /path/to/file doesn't work since the zpool isn't imported yet. 
Catch 22 there.) :)

Otherwise, I do have a backup of the /etc/zfs/zpool.cache that contains
references to this zpool, but it seems that this is corrupted and
prevents all zpool operations.  I've tried to replace the zpool members,
but it won't let me.  I've even used a hex editor to replace the device
names in the zpool.cache file with the new device names, but it's still
locked.  So I can't use the zpool cache file as a way to point to the
file member.  Is there some way to clear the "corrupted" flag in the
zpool.cache from allowing zpool commands to work?

I'm on oi151a5, but this zpool was created around oi134/135 or so.

zfs-discuss mailing list

Reply via email to