Wiki Table of Contents

Format ext4 filesystem to be owned by regular user

Formating a new partition with ext4 requires root permissions. By default, mkfs requires root permissions to create the new filesystem. Also by defualt, mkfs creates root directory ownership on the new filesystem with the same permissions as the user that issued the command. Practically speaking for desktop-linux, this means that the new filesystem will always be owned by the root account. This can lead to unexpected or undesired result of the regular user not being able to write any files to the partition.

This command will allow you to format a partition with the user-level permissions. The command will create a filesystem with ownership to whatever user starts the sudo command. Note that this command is run as the regular user.

sudo mkfs.ext4 -E root_owner=$UID:$GID /dev/sdXY

where /dev/sdXY should be replaced with /dev/designation_of_partition.


edited a bit

Submitted by Jerry3904 on Wed, 12/23/2015

Thanks for this entry, and the work behind it! Now have a cross reference to it and the internal partition one in the Manual under Permissions.

Leave a Comment

Do NOT follow this link or you will be banned from the site!