I tried to change the ownership of two folders with the following commands:

chown -v lfs $LFS/tools
chown -v lfs $LFS/sources

At the time the commands succeeded as I saw a message saying the change had been done. Sometime later I checked to see if lfs was indeed the owner, with this command:

sudo ls -ld /mnt/LFS/sources

and got the following answer:

drwxr-xr-x 2 root root 4096 fev 24 17:39 /mnt/LFS/sources

Thinking that I might have to repeat the chown command, i did:

sudo chown -v lfs $LFS/tools
ownership of '/tools' retained as lfs

Now, as far as I understand it, have chown telling me that the owner is lfs and ls -ls saying that the owner is root.

The folders are in a external drive disk with a ext4 file system.

  • 2
    Check the value of your $LFS variable. At one point you say chown ... $LFS/tools and the error message reports /tools in turn, suggesting that $LFS is empty there. – egmont Feb 24 '18 at 20:36
  • You were right it was empty. I did, again, export LFS=/mnt/lfs and checked if it "stuck". I tried again, sudo chown -v lfs $LFS/tools, and now I get this message: chown: cannot access '/mnt/lfs/tools': No such file or directory failed to change ownership of '/mnt/lfs/tools' to lfs I did this while located in the /tools folder, so I have no idea why this happening. – user3710626 Feb 24 '18 at 20:53

Solved. I just wrote the full path instead of $LFS. Still don't know why I keep loosing the export value, but that is another queation.

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.