Add a zfs disk to a pool without loosing data

rilvi

Cadet
Joined
May 24, 2020
Messages
2
Hello,

First of all, I'm a noobie, and unfortunately enough knowledge of freenas to think I know a lot until I do a mistake and I realise I actually know nothing.
I am using freenas as a plex server, no mirror, no backup.
I had two drives, 1Tb + 500Gb - the 500Gb started having some issues - increasing unreadable sectors. I got another 1Tb drive and my plan was to extend my pool with this one and remove the 500Gb all together.

I first added the 1Tb to the pool as an external drive connected through USB, and then after just removed the 500Gb drive.

This happened two days ago, and since then I try to find a solution - unfortunately UI tried so many things that I don't remember all the steps to put them here.

Because the pool was unrecognisable because I removed one of the drives, I added the 500Gb back. But the pool was still offline.


I tried zpool import f, zpool import -c, but the error was the same

the configuration database and will be reset on reboot.

root@freenas[~]# zpool import
pool: zNAS
id: 16741139929772745747
state: UNAVAIL
status: One or more devices are missing from the system.
action: The pool cannot be imported. Attach the missing
devices and try again.
see: http://illumos.org/msg/ZFS-8000-3C
config:
zNAS UNAVAIL insufficient replica

disk 1 Online
disk 2 Online
Disk 3 UNAVAIL cannot open

I then created a new pool and added the new 1Tb drive to it. Now, if I try to extend the pool with the other drives (that now have the status as online, unused) I will lose the data on them.

Is there any way I can add the disks to the new pool without losing the data?

I tried to import disk, but I can't import without selecting the Filesystem type. And the disks are zsf, but the options are UFS, NTFS, MSDOSFS and EXT2FS.
I tried them all - just in case - but none worked.

I am not sure what to do next without doing any damage to the data on the hard disk. Any advice would be really appreciated.

Thank you
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
first added the 1Tb to the pool as an external drive connected through USB
Your pool previously consisted of two disks striped--a failure of either disk would result in complete loss of all data on the pool. Now you've striped a third disk into that pool, meaning that all three disks need to be available for the pool to be accessible.
then after just removed the 500Gb drive.
...which resulted in your pool being unavailable due to the above.
I then created a new pool and added the new 1Tb drive to it.
...and in doing this, you've destroyed any chance of recovering your data. The first pool will not be accessible without the new disk being part of it. However, you've overwritten that disk and made it part of a new pool. As a result, the first pool is now irretrievably lost.

For future reference, the correct way to have done what you were trying to do would have been to replace the 500 GB disk through the GUI. The manual has step-by-step instructions on this.
 

rilvi

Cadet
Joined
May 24, 2020
Messages
2
Thank you so much @danb35 for your reply.

Well, this is really bad news, since I have personal photos and videos on that disk. I will try and get some professional help in trying to recover the data.
And this is a lesson learned. With two 1Tb drives, instead of extending one pool, I'd better use 1 drive for a backup pool on my next setup.

Once again, thank you for all your time and support!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
With two 1Tb drives, instead of extending one pool, I'd better use 1 drive for a backup pool on my next setup.
Better yet would be to set them up in a mirror.
 
Top