LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-06-2013, 05:57 AM   #1
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Rep: Reputation: 28
accidently changed chown to entire slack14 filesystem


hello!
working with various web installations, i do
chown apache:apache -R gallery/
in wrong directory. theoretically, that command in that case must do nothing, but i see a big disc activity, and my current console be freeze. i login to another console, and via top see a "chown" process consumes big processor power. i stopped it with "kill", but now, i see, a part of all my filesystem have a user / group apache, even when it not must be - i e entire /home , and so on - there is a way / script for restore all correct owner and groups for catalogs and files in system?
 
Old 04-06-2013, 06:35 AM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,378

Rep: Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824
You are not the first. See here for ideas and links. http://www.linuxquestions.org/questi...-reset-882891/
 
Old 04-06-2013, 06:36 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,175

Rep: Reputation: Disabled
Check out this script which I distilled ong ago from an online USENET discussion: http://www.slackware.com/~alien/tool...om_manifest.sh
The usage instructions are in the top of that script.

Eric
 
1 members found this post helpful.
Old 04-06-2013, 06:54 AM   #4
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 14.1 64 Multi-Lib
Posts: 420

Rep: Reputation: 123Reputation: 123
Ok - I'll be the big horrible nasty person to say it : working as root is dangerous and should only be done for the absolute minimum required work. I see far too many people become root (or worse, login as root) and do things that really should be done as an ordinary user under an ordinary account. I hope you come right - I see the greats (AlienBob,allend) have already made useful comments - but I hope further that you have learned from this experience. BTW - you never really become a Unix/Linux expert until you've really wasted a system :-)
 
Old 04-06-2013, 07:10 AM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,175

Rep: Reputation: Disabled
Well on second thought, the script I linked to does no more than fixing permissions... it does not handle ownership changes.
So my previous answer won't be all that useful unfortunately.

Eric
 
Old 04-06-2013, 07:18 AM   #6
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Original Poster
Rep: Reputation: 28
Thank you very much!
i used AlienBob script, and now it's work - hope all be fine when it's done
2Mark: i be an old idiot - almost as old, as Bilbo i start working with my first linux distro - 4.0 if i remember correctly - about 2000, and mostly i work with configuration and so as root. but not remember big catasthrophes on that. today accident is strange for me, because, theoretically if in directory, where i was, not gallery/ catalog, instruction must be do nothing, imho. saw a some strange things on my slack 14 x64 - some times i had not working, blocked terminal - i connect to my machine via ssh, and then, after connect, run mc and work in it, time from time i do ctrl+O to switch midnight commander panels on and off. after some time that, i two times get that remote console stop working - i type on keyboard, or "tab" to switch between mc panels - and nothing. open new terminal, ssh to my server again - new one works, old - locked up. strange, my previously server be a slack 11 or 11.2, and that situation is very rare, if ever happen...
 
Old 04-06-2013, 07:19 AM   #7
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by Alien Bob View Post
Well on second thought, the script I linked to does no more than fixing permissions... it does not handle ownership changes.
So my previous answer won't be all that useful unfortunately.

Eric
it do chgrp too:

chmod -R 0644 /usr/doc/kbd-1.15.3/iso8859-11.txt
chgrp root:root /usr/doc/kbd-1.15.3/iso8859-11.txt
chmod -R 0644 /usr/doc/kbd-1.15.3/COPYING
chgrp root:root /usr/doc/kbd-1.15.3/COPYING
chmod -R 0644 /usr/doc/kbd-1.15.3/A20/
chgrp root:root /usr/doc/kbd-1.15.3/A20/
chmod -R 0644 /usr/doc/kbd-1.15.3/A20/xfix-286mode2
chgrp root:root /usr/doc/kbd-1.15.3/A20/xfix-286mode2
chmod -R 0644 /usr/doc/kbd-1.15.3/

chgrp looks do job like a chown, not? syntahis like user:user is looks the same...
 
Old 04-06-2013, 07:21 AM   #8
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
The vast majority of the system is owned by root.root so if you start from there you'll at least have a system that can be shutdown and rebooted again.

You can of course ignore /dev, /proc & /sys as these are all system generated and will either ignore attempts to change permissions or will revert to the correct settings on a reboot.

/home is root.root but the directories and files underneath that are ${USERNAME}.users

Your actually lucky as a chown does far less damage then a chmod will in this situation.
 
Old 04-06-2013, 07:36 AM   #9
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,378

Rep: Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824
I just tried the smprms script from http://homepages.paradise.net.nz/~cameronk/progs.html on the MANIFEST file obtained by unzipping MANIFEST.bz2
Without wading through the entire 55MB generated by 'cat MANIFEST | ./smprms > output.txt' it looks as though it will work. You could always grep out all the 'chmod' lines to just leave the 'chown' lines.

Last edited by allend; 04-06-2013 at 07:38 AM.
 
Old 04-06-2013, 08:02 AM   #10
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Original Poster
Rep: Reputation: 28
yes, looks like AlienBob script not change owner \ group for files \ directories. bit of sadly. i go chown root:root -R to about all of my general catalogs, but i suppose, that not best things, because no all of this myust be root:root.
i also installed slack 14 64 bit onb another hdd - fresh install. can i use any simple script, who gets files permissions from that , newly installed filesystem and do apply bthat on my old system? i remeber some pieces of association like "--inherits"...?
 
Old 04-06-2013, 08:07 AM   #11
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Original Poster
Rep: Reputation: 28
chown --reference can be used, if i have a "right" filesystem for repair via that my "breaked" fs?
 
Old 04-06-2013, 08:08 AM   #12
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,380

Rep: Reputation: 840Reputation: 840Reputation: 840Reputation: 840Reputation: 840Reputation: 840Reputation: 840
not to discourage you from trying to fix it, but if that will happen to me I think I will try to evaluate the time that I will have to spend trying to fix it against the time to do a clean reinstall.

Last edited by ponce; 04-06-2013 at 12:51 PM. Reason: typo
 
1 members found this post helpful.
Old 04-06-2013, 08:19 AM   #13
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by ponce View Post
not to discourage you from trying to fix it, but I that will happen to me I think I will try to evaluate the time that I will have to spend trying to fix it against the time to do a clean reinstall.
that is my "new server", and i think, i spend about a week+ if i must be reinstall all it. as so, i think, fix it is much better variant now i try allend variant
 
Old 04-06-2013, 08:32 AM   #14
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 361

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by allend View Post
I just tried the smprms script from http://homepages.paradise.net.nz/~cameronk/progs.html on the MANIFEST file obtained by unzipping MANIFEST.bz2
Without wading through the entire 55MB generated by 'cat MANIFEST | ./smprms > output.txt' it looks as though it will work. You could always grep out all the 'chmod' lines to just leave the 'chown' lines.
strange, but that script produce many and many lines like a:


cown: cannot access ‘/usr/doc/hplip3.12.9/images/toolbox_actions.png’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/images/toolbox_status.png’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/images/toolbox_print_settings.png’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/images/xsane.png’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/images/favicon.ico’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/mainttask.html’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/troubleshooting.html’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/upgrading.html’: No such file or directory
chown: cannot access ‘/usr/doc/hplip3.12.9/hpscan.html’: No such file or directory
chown: cannot access ‘/etc/dbus1/’: No such file or directory
chown: cannot access ‘/etc/dbus1/system.d/’: No such file or directory
chown: cannot access ‘/etc/dbus1/system.d/com.hp.hplip.conf’: No such file or directory
chown: cannot access ‘/etc/xdg/autostart/hplipsystray.desktop’: No such file or directory
chown: cannot access ‘/install/’: No such file or directory
chown: cannot access ‘/install/slackdesc’: No such file or directory
chown: cannot access ‘/usr/doc/htop1.0.1/’: No such file or directory
chown: cannot access ‘/usr/doc/htop1.0.1/AUTHORS’: No such file or directory
chown: cannot access ‘/usr/doc/htop1.0.1/ChangeLog’: No such file or directory
chown: cannot access ‘/usr/doc/htop1.0.1/COPYING’: No such file or directory
chown: cannot access ‘/usr/doc/htop1.0.1/README’: No such file or directory
chown: cannot access ‘/usr/doc/htop1.0.1/NEWS’: No such file or directory
chown: cannot access ‘/usr/doc/ispell3.2.06/’: No such file or directory
chown: cannot access ‘/usr/doc/ispell3.2.06/Contributors’: No such file or directory
chown: cannot access ‘/usr/doc/ispell3.2.06/Magiclines’: No such file or directory
chown: cannot access ‘/usr/doc/ispell3.2.06/README’: No such file or directory
chown: cannot access ‘/usr/doc/ispell3.2.06/WISHES’: No such file or directory
chown: cannot access ‘/usr/bin/deformatsh’: No such file or directory
chown: cannot access ‘/usr/bin/deformatc’: No such file or directory
chown: cannot access ‘/install/’: No such file or directory
chown: cannot access ‘/install/doinst.sh’: No such file or directory
chown: cannot access ‘/install/slackdesc’: No such file or directory
chown: cannot access ‘/usr/share/jed/lib/isolat3.sl’: No such file or directory
chown: cannot access ‘/usr/share/jed/lib/ltxcomp.dat’: No such file or directory
chown: cannot access ‘/usr/share/jed/lib/isolatin.sl’: No such file or directory
chown: cannot access ‘/usr/share/jed/lib/ltxmath.sl’: No such file or directory
chown: cannot access ‘/usr/share/jed/lib/isolat2.sl’: No such file or directory
chown: cannot access ‘/usr/share/jed/doc/txt/linuxkeys.txt’: No such file or directory
chown: cannot access ‘/usr/share/jed/doc/txt/pckeys.txt’: No such file or directory
chown: cannot access ‘/usr/share/jed/doc/txt/idemode.txt’: No such file or directory
chown: cannot access ‘/install/’: No such file or directory
chown: cannot access ‘/install/doinst.sh’: No such file or directory
chown: cannot access ‘/install/slackdesc’: No such file or directory
chown: cannot access ‘/install/’: No such file or directory
chown: cannot access ‘/install/slackdesc’: No such file or directory
chown: cannot access ‘/install/doinst.sh’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/TODO’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/HACKING’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/README’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/HINTS’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/NEWS’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/COPYING’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/helpsystem.html’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/ChangeLog’: No such file or directory
chown: cannot access ‘/usr/doc/joe3.7/LIST’: No such file or directory
chown: cannot access ‘/install/’: No such file or directory
chown: cannot access ‘/install/slackdesc’: No such file or directory
chown: cannot access ‘/install/doinst.sh’: No such file or directory
chown: cannot access ‘/usr/lib64/jove/keychart.suncmd’: No such file or directory
chown: cannot access ‘/usr/lib64/jove/jove.rc.suncmd’: No such file or directory
chown: cannot access ‘/bin/ksh.new’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/OBSOLETE’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/COMPATIBILITY’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/README’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/PROMO.mm’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/RELEASE93’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/RELEASE88’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/LICENSE/’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/LICENSE/README’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/DESIGN’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/CPL’: No such file or directory
chown: cannot access ‘/usr/doc/ksh9320100621/RELEASE’: No such file or directory
chown: cannot access ‘/install/’: No such file or directory
chown: cannot access ‘/install/slackdesc’: No such file or directory
chown: cannot access ‘/install/doinst.sh’: No such file or directory
chown: cannot access ‘/usr/doc/libx861.1/’: No such file or directory


alhough i have a "full install"...:-O
not all lines from that is "no such", but very many...strange.
 
Old 04-06-2013, 09:19 AM   #15
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,378

Rep: Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824
From the smprms script.
Quote:
echo "#It will restore permissions to all files listed in the MANIFEST.gz,"
echo "#even files not there, so you might like to filter out 'not found'"
echo "#messages"
Are those files actually on your system?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chown, chgrp an entire directoy and contents gin1 Red Hat 8 09-06-2013 02:48 AM
[SOLVED] My PATH variable was changed accidently and now I cant find any commands on my termin anushya.k.kutty Linux - Newbie 12 04-15-2010 09:20 AM
How to chown entire folders and files and subs? natbrazil Linux - Newbie 7 04-13-2008 11:22 PM
accidently changed root privileges GhostCow Ubuntu 12 09-05-2007 05:49 AM
Rsync Entire Filesystem? sutley Linux - Newbie 4 10-04-2006 06:29 PM


All times are GMT -5. The time now is 06:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration