RM -R'ed myself


PeterDB

Recommended Posts

So I need to know - rather confirm - how badly I messed up, and what I think I need to do, is what I really need to do. Background: I was messing with CA User Scripts to backup a Emby's library.db and delete backup's older than five days using the command find . -type f -mtime +10 -exec rm {} ; .... but as you can see, I forgot to put the path appdata path in. I had webterminal open, no commands worked, not even ls... Unraid webadmin didn't even load anymore.... my heart starting racing, did I just rm -r everything!!! I panicked and did a hard power off on the powersupply. Checked the USB... almost all the files are gone :((( there are a bunch of files in /config... I grabbed a cuppa... read the community posts and wiki and I know I messed up badly... I followed the recommendations to copy off everything, flash the USB again and copy back the /config folder... Unraid boots, but webinterface isn't loading.... and no I didn't make a backup of the USB / flash backup, since I was still in the process of getting my 100TB server set up....

 

so... how bad is this? bad bad bad... or baaad...

 

I'm thinking of just going to bed and crying... Right now I flashed the USB again and started booting up. I guess, I'm starting fresh... arg...

 

Or give me some hope ppl... Although, I crushed that myself...

 

 

Link to comment

What I tried:

> Copied the config folder to a backup location

> Flashed the USB again and copied the config folder over

> Booted up. I get a prompt, but the webinterface does not load, nor does the array start (was set to autostart) and /mnt/ is empty except for /disks/ and /remotes/

> Flashed the USB again, didn't copy over the config folder, webinterface now loads

 

No I don't remember the disk assignments order. I have a partial screenshot of the drives, but none of the names are visible. Nor can I deduce from the screenshot which drive is what as the drives have been filled even more since then.

 

What happens if I start the array again, but with a different drive order?

 

EDIT: Is there a file in config that should have had the order? super.dat seems to have something, but it's not humanly readable.

Edited by PeterDB
Link to comment

Looks like only the plugins, shares and super.dat are intact.

 

Reading a lot more instructions, it looks like that you can read out the disk assignments order from super.dat using strings. However, you can also copy super.dat to your new USB config folder (reboot) and then it should load the assignments.

 

Gonna cry myself to sleep and wake up and try this....

Link to comment

If you have super.dat in the config folder then Unraid will know the disk assignments. The plugins folder contains your docker templates so those will probably work just as they are assuming they are all still there.

 

Sounds like maybe the go file was missing from config. That is how the webUI gets started.

Link to comment

Just to give an update here:

  • I'm back online! YaY
  • Flashed the USB drive again
  • Copied over super.dat and the drive assignments were found
  • Copied over the Shares folder and got my shares back. Still had to do some configuration, as the shares weren't set up to use cache.
  • Copied over the Plugins folder and got my dockers back. Some of them had broken templates as the xml file in flash\config\plugins\dockerMan\templates-user was lost. Turns out that if you uninstall a docker and leave the image and the reinstall and keep the same paths and ports, it fixes the missing template. I wish I had known this before I delete some of my dockers. Fortunately, the most critical ones were recovered
  • Had to reinstall lots of plugins
  • Had to set up all my settings again
  • I only a few files that where in the process of being copied when I did the hard shutdown, and of course spent my Saturday fixing my mistake

Lessons Learned:

  • Don't write scripts after a bottle of wine
  • Test and QA your scripts before using them
  • Backup
  • Backup
  • Backup
  • Unraid works a lot better than I expected!!

Thanks for the help here and on Discord!

Edited by PeterDB
Link to comment
32 minutes ago, PeterDB said:

Copied over the Shares folder and got my shares back.

Your shares would have been back anyway. The user shares are simply the aggregate of the top level folders on cache and array. Any folder at the top level is automatically a user share whether you have created it in the webUI or not. Any share you haven't configured will have default settings.

 

38 minutes ago, PeterDB said:

if you uninstall a docker and leave the image and the reinstall and keep the same paths and ports, it fixes the missing template

Not really any need to keep the images since reinstalling them downloads them again. You can always reinstall them exactly as they were using the Previous Apps feature on the Apps page, provided you still have the templates from flash. If you are missing the templates, the containers will still exist because they are in docker.img, but without the templates you can't manage them from the webUI.

 

37 minutes ago, PeterDB said:

Backup

You must always have a current backup of flash. You can download a zipped copy of flash at Main - Boot Device - Flash - Flash Backup.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.