SAMBA and file permissions


3 posts
by honda4life » Sun Nov 04, 2012 8:38 am
Hello everyone,

I'm trying to build a backup storage.
I've succesfully mounted the drive at boot by fstab.
Sharing is working, but I'm not shure about file permissions.

Very simple question but answer not found.
Suppose a folder/file is owned by pi:pi what if I remove the drive and plug it in a computer.
Let's say mylaptop:mylaptop now i'm not the user or in the group.
Can I access my files or is backup worthless then?

Thanks!
Posts: 70
Joined: Thu Mar 15, 2012 7:27 pm
by jojopi » Sun Nov 04, 2012 10:02 am
How is the removable drive formatted? If it is FAT then there is no ownership actually stored on the disk; the permissions are just faked when the drive is mounted. With the right mount options it will be readable anywhere.

If it is ext4 then the stored ownership is the numeric uid/gid. These will normally be the same for a reinstall of the same operating system, but may differ between distros. You can always read the files as root. You can add extra permissions with "sudo setfacl" or permanently change the ownership with "sudo chown".

(If it is NTFS then Linux normally fakes the ownership at mount time. On Windows the permissions are not compatible between hosts unless they use the same active directory. But a local administrator can always take ownership.)

Data is never inaccessible unless you encrypt it and lose the key.
User avatar
Posts: 1962
Joined: Tue Oct 11, 2011 8:38 pm
by honda4life » Sun Nov 04, 2012 10:44 am
jojopi wrote:Data is never inaccessible unless you encrypt it and lose the key.


That's the most important

jojopi wrote:How is the removable drive formatted? If it is FAT then there is no ownership actually stored on the disk; the permissions are just faked when the drive is mounted. With the right mount options it will be readable anywhere.

NTFS is preferred, but too slow so I took ext4

Not so clear to me, but it's time to google the rest ;)
Posts: 70
Joined: Thu Mar 15, 2012 7:27 pm