The /bin folder of my linux system was accidentally deleted as a superuser. Now the system is corrupted, and restarting it will collapse the system. There are some stackoverflow posts which list what can be done in such case to restore the bin folder. I have tried them and it does not seem to work for my case. Therefore, I would like to backup all my data and softwares, and clean install the OS. My question is how do I create a backup of my data and softwares, and how is the backup restored once the clean install is successful? Using external softwares to back up is not an option now because my system denies permission if I try to do that.
There are are a few ways to solve this problem. If you don't have a lot of data and still have an Internet connection and another host with ssh, the easiest way might be to scp the data to the new site (scp is in /usr/bin, not /usr/local/bin).
A more general way would be to remove the disk from your computer, install a new disk and rebuild the OS. Once you have done this, connect up the old disk - which should hopefully find the partitions and auto-mount them, and you can then drag-and-drop the data. This does assume that the drive is not encrypted. (If the drive is encrypted, and you know the key, it can still be done, but might be harder depending on the distro)