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. |
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.
|
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/ |
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! ).
|
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 . |
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. |
Quote:
Quote:
|
Code:
But i skipped it to shell mode Code:
chroot /mnt/sysimage |
Quote:
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' 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 |
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 |
Quote:
|
Quote:
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. |
Quote:
|
backup somewhere
Code:
I'll 2nd this option. I would find a way to save the important data on another system and then reinstall. 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 |
Quote:
|
All times are GMT -5. The time now is 03:54 AM. |