0

Sometimes but not often, but many times, after formatting an SD card with Gparted, the SD card becomes unaccessible to normal user, so I go as root and change the permissions, happens especially when changing the file system from say Fat32 to Ext4. Reformatting doesn't help. Does Gparted changes the permissions on disk? If yes why? If no then why it happens to me? I used other tools, only gparted seems to do that.

  • 1
    A newly mkfs'd Linux filesystem is owned by root:root by default. – frostschutz Jul 27 '15 at 17:44
  • @frostschutz but doesnt happen always, anyway thanks i guess thats the explination – Lynob Jul 27 '15 at 17:55
2

If you are using mkfs.ext4, you have to pass -E root_owner=your_uid:your_gid, this is usually passed in an 'extra options' textbox in gui partition tools. If you dont do this (< mkfs 1.42) then the person running the gui tool will get the permissions. Nowdays, for security, it assigns them to root:root (0:0). If you ever go back to fat32 or ntfs, you should be aware that their mkfs tools work differently*

  • fat32 partitions need the option uid=your_uid,gid=your_gid (usually 1000) when mounted if you want to access them. You can use permissions with NTFS, but it requires you to specify 'permissions' as a mount option (the -o switch).
| improve this answer | |
  • And if you can't pass options to mkfs.ext4 because you're using Gparted, run chmod 1777 [MOUNTPOINT] to make it available for all users. The 1 is supposed to prevent other users from deleting your files. – basic6 Oct 27 '17 at 9:39

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.