LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-04-2005, 04:41 PM   #1
bbbb
LQ Newbie
 
Registered: Nov 2005
Location: Amsterdam, Netherlands
Distribution: Mandriva cooker
Posts: 22

Rep: Reputation: 15
how to restore the default file permissions (whole system) ?


Hi LQ,

First off: bash me if you want to, I know, it is true, I am ashamed: I am one of those awful register-->newthread-->stupidquestion users... on top of that my question isn't even that vital so here's one topic not to waste your time on :P

that said, here is my story. it all began when I suddenly had an extra whole re-virgined 200 GB drive at my disposition, ready to be mounted. I wanted to do something useful with it (for a change) so instead of mounting it under /mnt/lenewdrive I decided to try and mount it under /usr . since I am probably the linux users that knows the least commands in the world, I couldn't even stand thinking of doing it by hand and quickly brought up the configuratiopanel (drakconfig) to do my thing in the nice graphical disk manager (harddrake?) . the formatting went fine, and I created a few partitions (one of which was /usr) on the new drive and thought that while I was at it I might as well switch the swap partition to that drive instead of having it on the same disk as where / was mounted. the "warning: parition table is going to be written to be written to disk" was of course ignored with a smile and my confidence even rose at a moment when he asked me if I wanted to copy all the data that was currently located in /usr to the new drive. that surely could only mean it was going the right way...?

appearantly; it didn't. that's where everything started to go downhill (really fast). he wrote the changes to fstab and remounted everything. I was sitting with a Konsole window on top, waiting, and playing around with echo (it's true, I did). suddenly; no more echo. no more ls. no more dc, no more su, nothing. everything got an error message (that I forgot but of which I am sure it wasn't permission denied) and I was struck with terrible fear ( "I KNEW I shouldve backed up that data.." ). I pressed the reboot button, hoping only the remounting had gone wrong and everything would be fine once again, but it got worse. he refused to boot; lilo did fine (I could still boot into other operating systems located on other drives) and even the first few steps of the boot process were fine. at the point of "mounting the filesystem" I was dropped into some panick terminal, pressing ctrl+d would only kick me out, reboot and drop me in it once again and entering the root password didnt help much either; no ls, only fsck and ed2fsck and stuff like that seemed to react though not even start because of a lot of errors on the drive in question). I ran Partition Disk Doctor and it fixed a whole lot of "header sectors" (?) which were located at twohundredsomething instead of 1, which actually worked. I could now boot in knoppix and access the drives and the data (something I couldnt do before I had ran PDD) and I restored the /etc/fstab file to a minimum (/ , swap and the cdroms and a samba share). I copied all the files from the new harddisk back into /usr on the old drive and rebooted. this worked: the booting was successful. until the starting of x; an error message flashed by, to fast to be read, and I was dropped in a text-login. logging in normally wouldnt work, only the root could. I logged in as root, and the first thing I tried: "su bubblboy" . it didnt work; "/bin/bash: permission denied" . the disk itself seemed pretty ok; I could vi all the text files I wanted and I could start emacs and lynx and access my /usr directory. another try (as root): "startx". I got an error message complaining about some file not existing (I didnt write it down, Im not even sure that was the error.. sorry :S ), though I checked the file in question and it was pretty much there with pretty much the good permissions. so I tried resolving the problem in my own way (here it comes): "chmod -R 664 /usr" (I know, but I was desperate!). I thought maybe some file permissions were changed during the transfer so I tried to make them ALL readable. no luck. and that was where I gave up and decided to look for help.

though, that is not the end (unfortunatly for the reader of this post). just a few moments ago I got tired of waiting and thought "whatthehack, Ill just reinstall the mf'er." so, time for backup. samba worked just fine, so I set up a samba share. in my own primitive way. I shared / to be able to backup whatever I wanted using the other computer. but since the samba user was not root, I had to change the whole system permissions. "chmod 775 -R / ". I did it. I even added -v to make it look cool. I didnt care much anymore anyway; the system was going down for reinstall anyway. so I backed up a few files and rebooted, but left, forgetting to put in the installation disc. After a few minutes, I come back into the room, and what do I see: the KDE login screen, beautifully shining in all it's graphical glory. " O_O " . it felt like seeing water burn... I had forgotten all about the last chmod, so this was THE mystery. I logged in; everything worked fine! KDE started, my wallpaper showed up, everything. I thought.

This is where I am now. I can do everydaylife things, but looking more carefully I see a lot of problems. first off: my whole filesystem is now 775. bad thing. for sure. even I know that. second; some side-effects. probably related to the 775 thing...
Code:
[bubblboy@zeus ~]$ su
Password:
su: cannot set groups: Operation not permitted
for example. so; "how do reset the filepermissions across my WHOLE system?" I am sorry to have make it come this far, I am stupid and I know it.. then again; I wasnt counting on the system suddenly going back up again. I thought everything was lost anyway. Is there still a fix to this...?

to all of you who bothered reading this: thank you.
to all of you who actually reached down here; thank you even more!

yours,
- b^4


Mandriva 2006.0 official here btw...

edit>> sorry, I thought it was 775 but appearantly it was 755... ._.

edit>> I suddenly thought of something that I forgot to mention. I have a spare computer here, so if needed I could install mandriva on that one and then for example copy all the file permissions...? I do not know how that should be done though, and then of course there is still the problem dealing with the custom files. this is no ultra-secure server problem though; it is just my home computer and I think I wouldnt even mind everyone being able to look in the configurations of some messenging program or my jre. as long as the basic things like /etc/shadow and /etc/samba/sambapasswd are restricted Im happy enough..

(was that of any help?)

Last edited by bbbb; 11-04-2005 at 05:16 PM.
 
Old 11-04-2005, 05:31 PM   #2
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Short answer: reinstall

Long answer:
You probably have far too many issues to fix on an individual basis.
I doubt you will EVER be able to fix all the errors, but at least a
(partly) bootable system should allow you to prepare for a resinstall
without losing data.
I suggest you create a spare partition, mount it somewhere
(/mnt/spare ?) and copy anything of importance onto it.
(eg. cp -a /etc /mnt/spare && cp -a /home /mnt/spare)
Reinstall with all your new partitions as you want them.
Plan your partitioning in advance (ie. WRITE IT DOWN! ),
taking into account which drive(s) may need to be (re)moved
at some point, which are faster, and which partitions are
likely to have more load.

Good luck.
 
Old 11-05-2005, 04:10 AM   #3
bbbb
LQ Newbie
 
Registered: Nov 2005
Location: Amsterdam, Netherlands
Distribution: Mandriva cooker
Posts: 22

Original Poster
Rep: Reputation: 15
haha ok I was afraid someone would say that... I can boot perfectly now though; I am even visiting lq.org through firefox on this very computer. backing up will be no problem.

next time Ill just follow some tutorials (pretty sure they exist..) and do the mounting a little more careful..

ok, thanks!

-b^4
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore all default file permissions pauliehaha Linux - General 4 05-25-2011 11:56 PM
Is it possible to create default file permissions? Thermodynamic Linux - Software 3 04-09-2004 05:28 PM
Restore default permissions scotcro Linux - Newbie 1 01-21-2003 09:13 PM
how to restore the default permissions safrout Linux - General 4 10-21-2002 08:53 AM
How to restore a default smb.conf file glock19 Linux - General 7 12-22-2001 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:49 AM.

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
Open Source Consulting | Domain Registration