1

I cannot open any files on my Manjaro Linux laptop. I really can't remember why it happened but I restarted my computer and now I dont have read/write access to any folder or file even though I've logged in.

  • 2
    Can you post the error which you are getting while trying to read/write a file. – pradeepchhetri Mar 17 '13 at 14:42
  • I'm getting a permission denied when trying to cd to Downloads for example – ahtmatrix Mar 17 '13 at 14:51
  • Can you post the output of this command: $ ls -la /home/ – pradeepchhetri Mar 17 '13 at 15:05
  • drwxr-xr-x 4 root root 4096 23.02.2013 21:50 ./ drwxr-xr-x 20 root root 4096 17.03.2013 10:43 ../ drwx------ 38 max users 4096 15.03.2013 05:44 max/ drwx------ 2 root root 16384 23.02.2013 19:18 lost+found/ – ahtmatrix Mar 17 '13 at 15:14
  • sorry i dont know how to format it line by line – ahtmatrix Mar 17 '13 at 15:16
0

Check the mode at which the partition is mounted i.e whether it is mounted in read-only or read-write mode.

You can use mount command to check that. If this is the issue, then you can edit the /etc/fstab file.

  • what should i see if my drive is r/w? – ahtmatrix Mar 17 '13 at 14:50
  • The safe way to check that is cat /proc/mounts. mount shows just the content of /etc/mtab - not necessarily the kernel's view on reality. Those lines contain "rw" or "ro". – Hauke Laging Mar 18 '13 at 19:07
0

Somehow you got all your files owned by root... try, as root:

chown -R user:group /home/user

where user is the user you log in as, group is the group you belong to (probably also called user, grep user /etc/passwd will give you something like:

user:x:1000:1000:Joe User:/home/user:/bin/bash

the second number is the group number).

Be extremely careful with what you do as root (or using sudo, it's the same thing), root is all-powerful and can easily destroy your system.

  • If you want to chown to the primary group then you can simply use chown -R user: ... instead. And playing the smart ass: root can easily destroy most systems but since the invention of LSMs and file caps it's not all-powerful any more... ;-) – Hauke Laging Mar 18 '13 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.