1

My embedded Linux system is using an admin user account to make some restricted administration tasks. The home directory for that user is /mnt/foo. That directory is the mount point for a partition mounted by /etc/fstab on boot:

/dev/mmcblk1p6  /mnt/foo      ext4    defaults           0       0

The problem is with permissions for that /mnt/foo directory:

$ ls -ld /mnt/foo/
drwxr-xr-x   16 root     root          4096 Mar 23 07:54 /mnt/foo/

This permissions don't allow the admin user to create/write any file:

$ pwd
/mnt/foo
$ touch hello
touch: hello: Permission denied

This problem can be easily fixed setting 777 permissions to /mnt/foo in rcS startup script:

$ chmod 777 /mnt/foo

But I don't like this solution. I have tried setting different options in the fstab (gid=admin,uid=admin,umask=000), but it seems these mount options are not supported by ext4 filesystems.

Is the rcS startup script the only feasible way to fix this issue? Thanks!

aicastell
  • 2,182
  • 2
  • 21
  • 33

1 Answers1

0

you can change the default value in the /etc/fstab entry line:

/dev/mmcblk1p6  /mnt/foo      ext4    defaults           0       0

to become

/dev/mmcblk1p6  /mnt/foo      ext4    file_mode=0755,dir_mode=0755 0       0

or whatever the permissions you want to give

Fou4d
  • 1
  • 1