Help i messed up i need

Please help i messed up i ran the command rm -R * / folder in truenas scale lastest relase i am afraid i deleted would it have rm my zfs mount point it was mounted /mnt/data/
i know it wiped the root so i shut it down

is there a away to recover just the zfs with out snapshots i know some snapshots were made of some zfs pools

i have not done any starting of system after i shut it down

Ok so I am not an experienced expert on TrueNAS but I did try to switch between core and scale and each switch always recognizes the drives and the zfs pool from the prior installation and asked me if i wanted to use it. I answered yes and got my drives no problem. You can recover it if you have the keys to the pool - you did save them when TrueNAS prompted you, right?

I would suggest to wait for the more experienced users for their reply. Good luck!

I don’t know what rm -R does to mounted folders but if your ZFS data is on a separate drive you can usually just plug the ZFS drives into another TrueNAS machine and import them easily. This is what I do with my external USB drive and have to re-import it each time I plug it in

1 Like

The first step is to not attempt mounting of the disks - something like TrueNAS may try to auto import the pool. I’d do some research on how to turn off auto importing, and how to do a read-only import. Once you’ve mounted it read only you can verify if there are any missing files, and if there is any data corruption.

The good news is that as a copy on write filesystem, most of your data is probably still there. IIRC you can use the zdb command to “rollback” ZFS to an earlier transaction. Let me stress though, the exact procedure you follow is going to be the important part here.

@wendell Since you’ve done this recently, do you have any good resources on ZFS data recovery?

Update I have Recovered what I believe to be the Entire zfs disks. honestly I was a complete mess when I wrote my Cry for help. dont know if it is a blessing in disguise or not. when I created my Truenas install the boot disk was installed on ZFS file system I just rolled back to 1 hr old backup of the boot disk. I had just did a system update for 22.02.03 > 22.02.4 and downloaded a back up DB.

I did not do any other Changes other than during the boot process I selected setup in the boot loader screen like what @cowphrase stated that the file system is a copy on Write filesystem the data was there. just the headers or transactions might have changed. I how ever got vary lucky in that when it started to wipe my boot disk that holds all of the programs to finish the wipe of the drive it stopped working unless it was loaded into memory it was freaking fast like less than a few ms fast.

and for those who dont know what rm -R * is what ever folder your in like your home dir or / it will delete all files and folder below the starting point so if your sitting in / every thing below that will get deleted. it was a dumb command to run on the / folder I got my self in this trouble because I used the ls command instead of cd I have bad habits and this is one of them. what I was trying to do was remove an applications config pool and I was in the wrong spot. the reason this had such great weight on my soul was it is over 15TB of Data, of personal data Photos and unrecoverable data. to that end I am glad I have the opportunity to get back my info. and as a PS. double check your working folder before you run that command it carry’s
a heavy toll. I would have through if this is an appliance that the makers would prevent this sorta Command from being run on / it is going to make me suggest that to the IXsystem’s team.