8

I'm attempting to edit the files on a SD card containing Raspbian on a Dell XPS 13 machine running Ubuntu. It doesn't have an internal SD card reader, so I use an external one.

When I plug in the SD card both partitions show up, but I'm not able to modify the files or add/delete from the drive without first logging in as a super user (gksu nautilus).

Why is this? Is there some user group that I need to be part of?

2 Answers 2

7

Permissions on an ext3/ext4 drive are based on the numeric userid of the user they belong to - this means that files owned by root on your Raspberry Pi will still be owned by root when plugged into a Linux machine.

If you mount from the command line, you can pass -o uid=1000,gid=1000 to force ownership of the drive to your user - though I'm not sure it'll take effect as I've only used it on vfat-formatted drives.

2
  • -o uid= gid= only works on VFAT and other filesystems that don't track file ownership.
    – Mark
    Jun 29, 2015 at 19:12
  • Can you detail how to do this? Oct 21, 2015 at 17:34
2

Part of the metadata stored in the directory entry for a file includes its name, owner, group, creation data etc. The owner and group are numeric numbers.

If your numeric owner id matches that of the file you inherit the owner permission over that file.

If one of your numeric group ids matches that of the file you inherit the group permission over that file.

Being root allows you to override the existing group and owner permissions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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