LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   / access problem (https://www.linuxquestions.org/questions/linux-general-1/access-problem-505303/)

Dauron 11-27-2006 02:14 PM

/ access problem
 
Hello!

I have been writing a small script today and I've made a small mistake, that resulted in calling following command:
chmod 644 /
and now I have a big problem... I cannot run anything on my hdd...
I have rebooted from the liveCD and wanted to do chroot, to investigate what had happened, but the following error appears:
chroot: cannot execute /bin/sh: Permission denied

Is there any way to change access rights to the main node of a disk, when it is not mounted as /? or will I have to do format+reinstall? :/

Regards,
Dauron

uselpa 11-27-2006 02:40 PM

Try booting with a Live CD, create a mount point (mkdir /omg), mount your partition there (mount /dev/hdx /omg) and then correct the permissions (chmod 755 /omg).
Substitute /dev/hdx with your root partition.

Then try the chroot thing. If it works, try booting as usual.

Dauron 11-27-2006 02:57 PM

/ access problem / access problem
 
I've already tried it, it doesn't work :(
When I mount the partition, all the rights look ok... maybe it is sth. other than the rights of /... but what else can give these 'no permissions' :scratch:

burninGpi 11-27-2006 08:49 PM

do what uselpa said, only do chmod 755 /omg/bin/*

Dauron 11-28-2006 02:22 AM

As I said, all the rights in the directories, subdirectories and files are ok (at least when the partition is mounted as the subdirectory of /). The problem appears when it is being mounted as /

Dauron 11-28-2006 02:55 AM

Solved! :D
chmod 755 /omg/lib/*
I'm so happy, that I don't have to reinstall the system :D

matthewg42 11-28-2006 08:03 AM

Without wishing to sound like a smartarse, this is one of those things which justify the advice "don't use root unless you absolutely have to!" Of course, it may have been unavoidable in this case.


All times are GMT -5. The time now is 10:35 PM.