1

Upon installation, I have created an extra partition and mounted it as /data. The partition is visible, but I get a Permission denied error when trying to create a file or directory in it. Doing it with sudo does work.

I am using ext4 filesystem.

I have tried deleting the partition, then creating it again and setting up fstab to use a new partition. That changed nothing.

How do I make the extra partition behave normally, e.g. be writable by users?

3
  • Do you want to behave like /tmp? Otherwise set proper owner/group rights.
    – ott--
    Commented Nov 28, 2015 at 22:28
  • I would like it to be writable by more than one user. I figured if I do chown -R $USER:$USER /data than it solves my problem... but for just one user? Commented Nov 28, 2015 at 22:31
  • @NickolaiLeschov: Use a group that other users are part of when chowning your directory/partition.
    – code_dredd
    Commented Nov 29, 2015 at 0:17

1 Answer 1

1

this should fix your problem:

sudo chown -R $USER:adm /data
chmod 0775 /data

This will give you and all users in the adm group read and write access. all other users not in the adm group have only read access. Ihe group adm is one of the default groups for all users in Ubuntu. For another distro, you could check which groups are assigned to new users by default and use one of those. Alternatively, you could create a new group (i.e. data) and add the users that should get access to data to that group.

If you want all users to have access to data, irrespective of the group they are in, then the chmod line should look like this:

chmod 0777 /data

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .