Ubuntu – Does Ext4 stores owner and group names? Or only IDs

bsdext4groupspermissionsusers

I am wondering if Ext4 file system stores names or IDs for file ownership information? Most probably the IDs… but that makes another question.

Does all Ubuntu versions have standardized IDs for common usernames? For example:

  • mail:8
  • www-data:33
  • syslog:104
  • postfix:107

What about other Linux distributions? BSDs?

Edited to clarify: What happens when I mount Ext4 HDD on different Linux where user IDs are different? Are permissions/ownership broken? Or Ext4 stores usernames and groupnames? What happens if particular group or user is deleted?

Best Answer

Ubuntu has a set of standardized usernames, UIDs, groups and GIDs. These are provided by the base-passwd package. See my answer on Unix & Linux (or /usr/share/doc/base-passwd/users-and-groups.txt.gz) for more information on those.

As for the filesystem, it stores UIDs and GIDs. The mapping between names and IDs are done by Name Service Switch (NSS) using the passwd and group databases. Unless you have the same mappings, the same UID might show up as different usernames on different systems.

If user a has UID 1000 on one system and creates files belong to it, and the filesystem is mounted on another system with b having UID 1000, then the second system will show b as the owner.