Recover deleted file on ubifs?

I accidentally overwrote a file using 'cp':

cp /tmp/cake-autorate/ /root/cake-autorate/

Is there a way to recover? I just downloaded the entire UBI mtdblock using LuCi.

I don't think so (I'm sorry to bring you only bad news) ...

the problem is that you have not currently deleted the file (and from an online search I can't find any command and/or software package that can restore files from a ubifs)

you went and wrote on it (and I assume you hadn't done any previous backups)

I had some fun with python-based ubi tools, and even saw some volumes and files from the overlay, but the copies of the files were too old. Maybe further recovery would be possible, but looks like the challenge wouldn’t be worth the benefit. Thankfully I can remember the requisite changes to the script.

1 Like