LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-17-2008, 12:07 PM   #1
Ankit Sharma
LQ Newbie
 
Registered: May 2007
Posts: 10

Rep: Reputation: 0
I changed the permission of root recursively all 777..... how to recover now??


Hello Sir

I am a naive to linux.
I have fedora 7 installed with windows Xp on same machine.

While i was installing one software i got the prompt of Operation not permitted even when i was in root. So i changed the permission of root
recursively to 777.(chmod / -Rf 777 , like that)

So when i restarted the next time many errors came up while starting various services. Then the console of my laptop went very black popping up lots of error dialogue boxes. Then i used the shell mode to change root recursively 742. Now when i restarted it is unable to boot.

Sorry i have just very less idea of Linux .
Can any body help me . How can i recover back. Or atleast how can i
recover my few important files i had made in linux and may be then i reinstall. Due to some important data i dont want to install newly also.

Please someone help me out.
Thanks in advance.
 
Old 03-17-2008, 12:15 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Having a mature package management system this ain't no problem. Boot your installation CD in rescue mode, then try 'rpm --root /mnt/rescue -qa |xargs -iX rpm --root /mnt/rescue --setperms 'X''. And FCOL don't fsck with chmod *twice* if you fscked it up the first time. In your case I'd suggest you read first, then think, then decide to read again.

Last edited by unSpawn; 03-17-2008 at 12:20 PM.
 
Old 03-17-2008, 12:20 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
I think that one of the packages created the basic filesystem, and if so, it should have a name similar to filesystem. Let's find out the package that created /usr/bin/.

rpm -qf /usr/bin/
jschiwal@hpamd64:~/work/cwork> rpm -qf /usr/bin/
filesystem-10.3-50

Here I'll bork the permissions on one of the system directories:
sudo chmod o+w /usr/bin/

Let's verify the filesystem package:
rpm -qV filesystem
.M...... /usr/bin
.....UG. /usr/share
.....UG. /usr/share/doc

Let's see what the permissions should be:
rpm -qlv filesystem | grep '/usr/bin'
drwxr-xr-x 2 root root 0 Sep 21 14:18 /usr/bin

Now let's fix it based on this info:
sudo chmod 755 /usr/bin/
 
Old 03-17-2008, 12:26 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
unSpawn: You beat me to the punch and had a better answer. I had to look up what FCOL meant. I don't believe I didn't know that acronym. My Grandpa would yell that all the time. ( not always at me! ).
 
Old 03-18-2008, 06:30 AM   #5
Ankit Sharma
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Hello jschiwal sir

Hello sir

when i tried to boot with installation cd in rescue disk it asks me
to make an image of existing file system in /mnt/sysimage. But i skipped
it to shell mode. Then as u said i did rpm -qf /usr/bin , but it says
file /usr/bin is not owned by any package . Moreover it is unable to su
also , saying root does not exist.

Also when i booted normally without CD then i got the following thing:

warning: can't aces (null)
exec of init ((null)) failed !! : Bad Address
Kernel panc - not syncing : Attempted to kill init !


Moreover sir as i got windows XP on he same machine which i have been using
by mounting it in /mnt/windows , so can't i just copy my few important files in windows .
 
Old 03-18-2008, 06:37 AM   #6
Ankit Sharma
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Sir unSpawn

I tried ur command in rescue mode using CD:

sh-3.2# rpm ......

and then i got to:

>

Now what to do ??
What do u mean by FCOL and fsck ???

Also when i booted normally without CD then i got the following thing:

warning: can't aces (null)
exec of init ((null)) failed !! : Bad Address
Kernel panc - not syncing : Attempted to kill init !

Moreover sir as i got windows XP on he same machine which i have been using by mounting it in /mnt/windows , so can't i just copy my few important files in windows . If so how to do.

Sir i jut new to linux.
Please help me.
 
Old 03-18-2008, 06:58 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by jschiwal View Post
You beat me to the punch and had a better answer.
I don't consider LQ a race of sorts and my answer certainly not as "better". It may be concise but your explanation is much better for new users to understand.


Quote:
Originally Posted by jschiwal View Post
I had to look up what FCOL meant. I don't believe I didn't know that acronym. My Grandpa would yell that all the time. ( not always at me! ).
Heh. Well at least you've got vivid memories of him :-]
 
Old 03-18-2008, 07:24 AM   #8
livetoday
Member
 
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106

Rep: Reputation: 15
Code:
But i skipped it to shell mode
You need to press '[continue]', if you skip then filesystem won't be mounted by rescue operation. After that when you got shell type

Code:
chroot /mnt/sysimage
after that you can continue with the steps explained earlier...
 
Old 03-18-2008, 07:25 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by Ankit Sharma View Post
I tried ur command in rescue mode using CD:

sh-3.2# rpm ......

and then i got to:

>

Now what to do ??
I think it means you copied in the outer quotes, which you should not, since they are only used to denote the command.
Note that you can not execute that until you have mounted your installation. Just to be sure, before you execute anything check if the directory /mnt/sysimage/var/lib/rpm exists. Now use (I've added the dbpath just in case):
Code:
rpm --root /mnt/sysimage --dbpath /mnt/sysimage/var/lib/rpm -qa | xargs -iX rpm --root /mnt/sysimage --dbpath /mnt/sysimage/var/lib/rpm --setperms 'X'
* If for some reason it does not work try:
Code:
cd /mnt/sysimage && rpm --dbpath /mnt/sysimage/var/lib/rpm -qa --dump | awk '{print "chmod", $5, $1}' | sed -e "s|04||g" -e "s|012||g" | /bin/sh
 
Old 03-18-2008, 08:26 AM   #10
simplicissimus
Registered User
 
Registered: Mar 2008
Posts: 104

Rep: Reputation: 15
re-install

Based on the original question it appears to me that the system has not been in use for long.

I would rather backup the /home directory somewhere and re-install everything (a clean install).

Another option would be to re-install without reformatting - that will overwrite the base system, but leave the home directories and log files in /var intact - in this scenario files are overwritten, but never deleted. Some minor problems could happen with configuration files in the user's home directory, but the /var logfiles will be deleted sooner or later anyway by the system or overwrtitten.

Other mentioned possibilities are probably too difficult for a new user.

As a new user one should rather avoid doing regular things as root, keep important data in one place and do regular backups. And be prepared to re-install a few times before you get used to the system.

Hope this helps,
Regards,
SIMP

Debian User

Last edited by simplicissimus; 04-02-2008 at 05:42 AM.
 
Old 03-18-2008, 10:01 AM   #11
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 542

Rep: Reputation: 33
Quote:
Originally Posted by simplicissimus View Post
Based on the original question it appears to me that the system has not been in use for long.

I would rather backup the /home directory somewhere and re-install everything (a clean install).

Another option would be to re-install without reformatting - that will overwrite the base system, but leave the home directories and log files in /var intact - in this scenario files are overwritten, but never deleted. Some minor problems could happen with configuration files in the user's home directory, but the /var logfiles will be deleted sooner or later anyway by the system or overwrtitten.
I'll 2nd this option. I would find a way to save the important data on another system and then reinstall. Might be a good excuse to pick you up a 16gig thumb drive to save your data to before you do the reinstall. (always a silver lining if you look hard enough. )
 
Old 03-18-2008, 09:14 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Quote:
Originally Posted by unSpawn View Post
I don't consider LQ a race of sorts and my answer certainly not as "better". It may be concise but your explanation is much better for new users to understand.



Heh. Well at least you've got vivid memories of him :-]
You posted your message as I was typing mine.

Using "rpm -V" on individual packages and manually fixing permissions would have been a lot more work, but perhaps it would have a deterrent effect. A lot like writing "I will not use chmod / -Rf" a thousand times on a blackboard!

Which reminds me of a three year old who watched her Daddy install linux on his desktop. The next day at kindergarten, she had reparitioned all of the day care center's computers! She is banned from even touching the computers now.

Last edited by jschiwal; 03-18-2008 at 09:18 PM.
 
Old 03-19-2008, 07:15 AM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by jschiwal View Post
Which reminds me of a three year old who watched her Daddy install linux on his desktop. The next day at kindergarten, she had reparitioned all of the day care center's computers! She is banned from even touching the computers now.
I'm sorry to see your offspring being stigmatised. Must be hard for a budding hacker to start her carreer like that. Maybe it builds character :-]
 
Old 03-19-2008, 07:21 AM   #14
simplicissimus
Registered User
 
Registered: Mar 2008
Posts: 104

Rep: Reputation: 15
backup somewhere

Code:
I'll 2nd this option. I would find a way to save the important data on another system and then reinstall.
I am somewhat puzzled by that comment. What would be a sane reason to do any backup and then leaving the backup file on the same system that will be re-installed and propably also re-formatted?

Backing up 'somewhere' is not very specific, I admit, but 'somewhere' can be anything from a flash drive to an external drive, some storage place on the Internet or a simple floppy if your data fits on it, or your favorite 16gig thumb drive or whatever makes sense to you and is available.

Regards,
SIMP
 
Old 03-21-2008, 12:12 AM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Quote:
Originally Posted by unSpawn View Post
I'm sorry to see your offspring being stigmatised. Must be hard for a budding hacker to start her carreer like that. Maybe it builds character :-]
This wasn't my kid. It's from a caller to "The Tech Guy" program.
 
  


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
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 05:50 AM
Delete files for a particular changed date recursively? qwertyme Linux - Newbie 5 01-23-2009 11:41 AM
want to avoid 777 permission, but want to write on folder suruchiparimu Linux - Newbie 10 02-09-2006 04:25 AM
BIND 9 Permission denied when chmod is 777 o_O KasperLotus Linux - Networking 10 09-07-2005 01:20 AM
TROUBLE: MISTAKENLY CHANGED PERMISSION OF OS . how to recover mallinath Linux - Newbie 4 06-29-2005 04:21 PM


All times are GMT -5. The time now is 03:18 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration