How To Fix Server Ownership When Files Have Been Altered By Mistake

Published Date Author: , Posted March 16th, 2022 at 12:19:54pm

Situation: Newbie mistake, used copy-and-paste to create a script that used variables with the incorrect variable name, then ran chown -R / OUCH

Resolution: Since I had aa clone host nearby, I decided to export the remote root fs via NFS, mount it on the fouled nnode, and use find magic to repair.

Here are the steps:

Bad host is nodeB, and good host is nodeG ;-}

Step 1. On nodeG, prepare NFS:

Step 2. On nodeB, mount the resource from nodeG and use it to set the ownership locally on nodeB via find -exec chown:

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.