How ?
When trying to create a chrooted environment for some users, I end up using
mount --rebind <path> <newPath>
In order to allow chrooted users to access some useful command (a bad practice, yeah)
After some discussions with a colleague, I've change my mind and decide to use groups to blacklist some folder to chrooted users. After doing some
umount <path>
I end up doing a little rm -rf . to clean the last folder
The worst idea I've ever have
Sadly I have forget to umount the /usr/share folder and rm start to delete file in this directory. Hopefully I've done a quick
Ctrl + C
After i've noticed my mistakes. I was like "Cool there isn't too much damage"
I was really wrong.
All my services (mysql ; postregsql ; java) can't run anymore because they needed dependencies in /etc/alternatives Running a
update-alternatives --force --all
Help me a little bit but doesnt help starting mysql. I've totally lost faith in fixing this so i'd like to made a backup of every configurations file and perform a clean install of my vps. But like you think
I have no database backup
I know this is really really wrong, please forgive me.
My question
Now let's move on my question, is there a way to restore PostreSQL and MySQL connection in order to backup the database and save it to perform a clean install on my VPS ? Or I'm i totally lost ?
So far I've tried :
- recreate database socket (doesn't really work)
- regenerate mysql data files and move my blocks files into the folder (It help running back mysql, I can see the database and the table using SHOW DATABASES; and SHOW TABLES; but i can't access them)
Notes
In the futur I'll make backup, I promise
Update :
According to PostreSQL : https://www.postgresql.org/docs/9.1/static/backup-file.html there is a way to backup database using fs. I'll try that
Thank's for take the time to read me, hope you'll have and idea.