3

Why do I need to run "df -h" whith sudo to show my lvm partition mounted that I just added?

When I run the command with sudo I get this result :

/dev/mapper/centos00-root 4,9G 1,4G 3,6G 28% / devtmpfs 1,9G 0 1,9G 0% /dev tmpfs 1,9G 4,0K 1,9G 1% /dev/shm tmpfs 1,9G 8,6M 1,9G 1% /run tmpfs 1,9G 0 1,9G 0% /sys/fs/cgroup /dev/sda1 969M 119M 784M 14% /boot /dev/mapper/centos00-opt 15G 41M 14G 1% /opt /dev/mapper/centos00-var 20G 129M 18G 1% /var /dev/mapper/centos00-home 4,7G 20M 4,5G 1% /home /dev/mapper/postgres-database 118G 36G 77G 32% /var/lib/pgsql/9.6 tmpfs 380M 0 380M 0% /run/user/16777220 

And when I run the commande as a normal user I get the same result, but without the line :

/dev/mapper/postgres-database 118G 36G 77G 32% /var/lib/pgsql/9.6 

I have other servers and I do not have this problem. I use CentOS Linux release 7.4.1708

UPDATE #1

Here's the output for the commands asked in the comments:

$ findmnt -o TARGET,PROPAGATION /dev/mapper/postgres-database TARGET PROPAGATION /var/lib/pgsql/9.6 shared 

I tried with another target and I have the same answer:

$ findmnt -o TARGET,PROPAGATION /dev/mapper/centos00-var TARGET PROPAGATION /var shared 
1
  • 1
    What does findmnt -o TARGET,PROPAGATION /dev/mapper/postgres-database tell you ? Just a wild guess,but does the propagation column result in private ? Commented May 22, 2018 at 6:08

1 Answer 1

1

df retrieves filesystem information (used/free/total space) using statfs(). The input parameter for statfs() is a path - a file or directory name. The output of statfs() is the information for the filesystem which the file belongs to.

If you do not have permission to open a path on a specific filesystem, then you cannot get the filesystem information.

The postgres data directory is only readable by specific users and groups. Otherwise, any user could bypass the read access controls which were configured inside the database.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.