Linux - GeneralThis 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
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.
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? :/
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.
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'
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 /
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.