Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Dec 31, 2011 8:00 am 
Offline
Newbie

Joined: Wed May 18, 2011 9:28 pm
Posts: 2
Hi all,

I believe i messed things up and would greatly appreciate some input...

I wanted to change group on a directory in public_html but instead ran the command at root level, recursively of course. I got a few "Operation not permitted" errors, but most files and directories now has the group www-data.

This is the command that was executed:
Code:
# chgrp -R www-data /srv/www/example.com/public_html/media *


Is this a FUBAR situation, ie start from scratch or can I rectify this somehow by setting the group to root recursively or something?

Thanks,


Top
   
 Post subject:
PostPosted: Sat Dec 31, 2011 8:12 am 
Offline
Sysop

Joined: Sat Nov 27, 2010 3:32 am
Posts: 180
Website: https://blog.timheckman.net/
Location: San Francisco, CA
Was this command ran as root?


Top
   
 Post subject:
PostPosted: Sat Dec 31, 2011 8:12 am 
Offline
Junior Member

Joined: Fri May 27, 2011 5:01 pm
Posts: 20
Assuming you ran this command as the root user, you're shit out of luck. Time for a backup and reimage of your Linode.


Top
   
 Post subject:
PostPosted: Sat Dec 31, 2011 9:33 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Create a Linode in the same datacenter, restore your latest good backup to it, boot up the rescue mode, then:

Code:
backup# find / -xdev -printf "chgrp %g %p\n" > /tmp/doh.sh


Copy /tmp/doh.sh over to your broken node and:

Code:
failboat# sh /tmp/doh.sh


It should get most everything. You'll want to check for the stragglers with:

Code:
failboat# find / -xdev -group www-data





If you don't have a backup, you're FUBAR.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Sat Dec 31, 2011 10:30 am 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
Wow, that's a nice trick, hoopycat... gotta remember this.
(Yes, I do backups.)

_________________
rsk, providing useless advice on the Internet since 2005.


Top
   
 Post subject:
PostPosted: Sat Dec 31, 2011 1:24 pm 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
hoopycat wrote:

Code:
backup# find / -xdev -printf "chgrp %g %p\n" > /tmp/doh.sh




That is an amazing trick, very cool, will have to remember that.


Top
   
 Post subject:
PostPosted: Sat Dec 31, 2011 6:57 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I suppose I might as well mention that I haven't actually tried this, so it may or may not work. But it looks like it does. (find is generally amazing.)


Top
   
 Post subject:
PostPosted: Sun Jan 01, 2012 3:51 am 
Offline
Newbie

Joined: Wed May 18, 2011 9:28 pm
Posts: 2
Thanks for the replies. The answers were pretty much what I expected, although I had hoped for something else. As it stands I just signed up with Linode and got things up an running, so backups are nonexisting. For the data it's no problem, it's just that I have to redo the setup all over again, but I guess that is a good learning experience.

That I used the root account was a correct assumption by the way.

Anyways, thanks again. I am sure I will have reasons to come back to the forums, which I have actually followed since I sign up. Despite the setback I am really happy with Linode and the service. Everything went really smooth up until yesterday.

Cheers


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group