SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello friends,
I just broke everything on my operating system. I was having ownership problems with some files and folders. So, accidently I changed the ownerships of all files/folders on / to root:root. Here's
what I did. I know it's really a dumb thing.
1) logged in as root
2) unmounted other linux partitions
Code:
umount -at ext2
3) unmounted /home
Code:
umount /home
4) Changed ownerships of all files on / to root
Code:
chown -cR root:root /
Now, I can't do much from my local user account. can't ping, can't even use su.
Is there any way around to fix the ownerships to their orignal form? Any suggestions?
Seeing how you've wiped out the ownership of EVERYTHING and that linux does not come with an UNDO button, you're quickest and best bet is to restore from a backup (you DO have a backup?) or to reinstall.
The problem is, yes you could fix your home directory for yourself but there are about 1000 seperate executables, no end of libraries etc. that all have differing permissions. You won't be able to guess those easily, or "blanket" permission them. Restore from backup.
Hello ledow,
Thanks for the reply. I do have a backup of all my data files but I don't keep any backup of the operating system as I usually change it every month.
It's my personal PC only and even if the operating system crashes, it's not gonna hurt. But, I didn't just do a reinstall as I thought I should learn to fix it.
At present, the situation is a bit better. Now I can login with my normal account in KDE.
I changed the ownership of / again so that I can backup some newly installed config files.
Code:
chown -cR root:users /
My normal username is mann, so
Code:
chown -cR mann:root /tmp/*mann*
Now I am going to reinstall it. Right now I am copying the basic configuration files to a backup folder like smb.conf, vsftpd.conf, inet1.conf etc..so that I wouldn't have to config them again after installation.
I have one more question before I proceed for a reinstall. Should I format the / partition or just do installation over the current one without formatting it? What would u suggest?
Last edited by manishsingh4u; 07-09-2006 at 10:28 AM.
Hello friends,
I just broke everything on my operating system. I was having ownership problems with some files and folders. So, accidently I changed the ownerships of all files/folders on / to root:root.
basically there are alot of files/scripts that need to be 'world readable' ......since root is the only one who can read them, much needed system scripts can't/won't start........to get everything back to normal you don't need to re-format!! just re-install everything over the the existing files and the ownership/permissions will get reset to what they
were/should be..........
Here's a script which will restore the perms for eevery file on yur system, using the MANIFEST to know what they are.
Actually, this is a script which *writes* a script to do it. The resulting script will prbably be around 30MB!
Something I found awhile back from an old slacker:
Thanks a lot friends. I have reinstalled my slackware. And now it's working really fine. Thanks again.
Hello 320mb,
I tried reinstalling over the previous installation but, at the end it gave me some error about less disc space. (I have 3.1 gb for / on reiserfs). And want the full installation so, formatted it and did a fresh install. As I had all the required configuration files and packages in hand, so it didn't take more than 30 min to install extra packages like mplayer, k3b, amsn etc etc. As opposed to this time, when I installed slackware first time, it took me 2 days to bring it to my desired configuration.
Hello gnashley,
You have given me something really amazing. I am gonna recreate this problem on my machine next saturday and will try this script. If it worked, I will name this script as Magic script.
Once again, thanks to all of u.
Last edited by manishsingh4u; 07-09-2006 at 05:57 PM.
I was just wondering if I could save my system's current ownership / permission settings to some text file or something incase I screw it up again. Is it possible?
The one time I made a mistake like manishsingh4u did, I inserted the Slackware CD 1 and did this (as root, of course):
Code:
mount /mnt/cdrom
upgradepkg --reinstall /mnt/cdrom/slackware/*/*.tgz
umount /mnt/cdrom
and then repeated for CD2. Now I would probably expand it to "ls /mnt/cdrom/slackware/*/*.tgz|grep -v '^aaa'|while read PACKAGE; do installpkg $PACKAGE; done", but it seemed to work well.
"save my system's current ownership / permission settings to some text file" can be done like this:
cd /
ls -lR > /path/to/file.list
But I don't think that the smprms script can use the format. You'd need to create a custom MANIFEST showing just the packages you have installed. I'd love it if someone would write a short BASH script that will parse the MANIFEST and print out entries. my PkgBuild program will build an individual MANIFEST entry, but that's for stuff compiled using PkgBuild.
I keep a copy around of another nice tool called slackdeptrack which will tell you what each package on your system provides and depends on.
You might also be interested in this script: http://distro.ibiblio.org/pub/linux/...bin/chksysdeps
Which will find every executable on your system and run 'ldd' on it, showing the results color-coded. Might surprise you...
Thanks gnashley. Now, I think I should code a program in C or C++ which I will use to restore the ownerships / permissions on files. I have once coded a program the changes the permission flags 07xx on files but never thought about the ownerships. I am not good at shell scripting so I don't know which approach would be better. But, yes both of them is gonna teach me a lot I guess.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.