There are two things at play here:
- Directory permissions.
- Mount options.
The directory permissions are independent of the fact that the mount was read-only. Hence, ls
will still list the permissions assigned to the folder, without regards for how it was mounted.
In the same way, if I mount a folder with noexec
, ls
will show that the executable files in there are still executable. Mounting the folder with noexec
(or ro
in your case) does not change the permissions on files and directories.
The file manager appears to be smarter though, and knows that the directory is mounted read-only. It obviously queries more than just the permission bits to find this out.
From comments: "In my use case I want to read the mount permission with a shell command".
The command mount
, without any options, will output all the currently mounted partitions and their mount options:
$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=32841600k,nr_inodes=8210400,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=6572324k,mode=755)
(etc.)
The mount options are listed in parenthesis.
You may also investigate /etc/mtab
for the currently mounted filesystems. This file has the same format as /etc/fstab
, so you could do
awk '{ print $2, $4 }' /etc/mtab
to only get the mount points and the mount options, for example.