Koozali.org: home of the SME Server

Trashed /home directory on a remote SME 9.2 running AFFA.

Offline idp_qbn

  • ****
  • 346
  • +0/-0
Trashed /home directory on a remote SME 9.2 running AFFA.
« on: May 26, 2017, 04:26:20 AM »
Hi, I have trashed the /home dir on a remote SME 9.2 server which runs AFFA. The system was fully updated.
Can I recover somehow with out travelling the 300km to do a site visit and doing a fresh installation?

I was trying to remove AFFA to re-purpose the server and halfway through typing "rm -rf /home/e-smith/db/affa" when I discovered that a double-tap on a touch screen was interpreted by the Terminal App as a RETURN. That happened just after I typed "rm -rf /home/" and by the time I noticed....ah, well, such is life.

There were no userfiles or users on the system, apart from the AFFA backups.

Is there any possible remote recovery?

Cheers

Ian
___________________
Sydney, NSW, Australia

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Trashed /home directory on a remote SME 9.2 running AFFA.
« Reply #1 on: May 26, 2017, 05:25:10 AM »
Ian there could be multiple ways.

-Best way would indeed to drive there and reinstall.
-Use a backup and restore
-What i would do if no backup, i would install a clean sme in a vm and then rsync the /home dir to your remote server
- might be able to achieve it too by reinstalling all the rpm owning a file or dir in the home, might be complicated to find them all.


By the way a trick with rm as root:

Code: [Select]
rm /home/e-smith/db/affa -rf
Works, and avoid issues if enter hit before puting the full path as the options will miss you will just get an error.

Offline idp_qbn

  • ****
  • 346
  • +0/-0
Re: Trashed /home directory on a remote SME 9.2 running AFFA.
« Reply #2 on: May 26, 2017, 07:14:47 AM »
Thank you for those suggestions. :-)

I will try the VM and rsync  method (steep learning curve but hey, that's what life is for, isn't it?).
I have used VMs on Windows, but never done anything directly with rsync.

I have a sneaking suspicion I may be on the train south next week with an SME disk in my hand.

That's a really good suggestion about putting the -rf at the end. I was just blindly following the howto, using a borrowed iPad: never again!

Whatever happens, I will post the outcome here.

Ian
___________________
Sydney, NSW, Australia

Offline idp_qbn

  • ****
  • 346
  • +0/-0
SOLVED : Trashed /home directory on a remote SME 9.2 running AFFA.
« Reply #3 on: June 19, 2017, 06:40:45 AM »
Just a bump to let anyone interested know what happened.

I ended up taking the easy option - a weekend in Canberra (300 km away) seeing old friends and re-installing the backup server (HP ML-350, SME and AFFA).

There were too many obstacles to solving the problem remotely - compounded by having no local staff willing to work on a Linux machine following my phone intructions.

Since I broke the system, it was up to me to fix it.
That was easily done and everything works well now.

It is a testament to the usefullnes of AFFA.

The server I broke was the production server. I had run an AFFA backup before I started work, so the AFFA server was "up-to-date".
When I deleted the home directory (Idiots can be so powerful, can't we?), I managed to halt the production server. I performed a "RISE" on the AFFA server to be the new production server, which took about 20 minutes with 200 Gb data. The users were off the air for about half-an-hour, but at 22:00 at night, no-one was at work.

So, by 22:30 or so, the system was running, all the data was there and the next day everyone could do their work.
I could not remotely restart the old production server, which would have been a silly thing to do, anyway, since that would have caused an IP clash (two systems with the same IP). This is where I would have needed local hands on the keyboard and that was not going to happen.

Anyway, it was good to see old friends and Canberra is a lovely place to visit.

Thank you, Jean-Phillippe for your help. I am sure what you suggested would work but the difficulties meant a re-install was simpler.

Cheers  :-)
Ian
___________________
Sydney, NSW, Australia

guest22

Re: Trashed /home directory on a remote SME 9.2 running AFFA.
« Reply #4 on: June 19, 2017, 06:44:39 AM »
Congrats, good for you!

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: SOLVED : Trashed /home directory on a remote SME 9.2 running AFFA.
« Reply #5 on: June 19, 2017, 08:15:39 AM »
Anyway, it was good to see old friends and Canberra is a lovely place to visit.

Cheers  :-)
Ian

Don't often hear Canberra described that way   :-)
--
qui scribit bis legit

guest22

Re: Trashed /home directory on a remote SME 9.2 running AFFA.
« Reply #6 on: June 19, 2017, 08:17:27 AM »
Get me a ticket and a place to stay and I'll judge on that... ;-)