Matching PostgreSQL Storage Location to Mounted File System(s)

PostgreSQL

Audience
Public
Technology Integrations
Postgre SQL
Source Type
Documentation

Once the directory locations are known they can be inspected to identify the FlashArray volume(s) which each corresponds to.

For Linux/Unix systems the "df " command is useful to get an overview of what file systems are mounted and the volumes they correspond to.

For Microsoft Windows systems the diskpart and wmic utilities will be used to identify file system(s) and corresponding volume(s).

Linux/Unix

When using the "df -h" command all mounted file systems and the corresponding volumes are listed. One the volumes for PostgreSQL have been identified take note of the /dev/mapper/<volume> path as this will be used to identify the volume serial number.

Using the default layout with a FlashArray volume there should be a volume mounted to "/var/lib/pgsql" or "/var/lib/pgsql/<version>/data".


Filesystem                                       Size  Used Avail Use% Mounted on
devtmpfs                                         252G     0  252G   0% /dev
tmpfs                                            252G  1.2M  252G   1% /dev/shm
tmpfs                                            252G   11M  252G   1% /run
tmpfs                                            252G     0  252G   0% /sys/fs/cgroup
/dev/mapper/rhel-root                            630G  7.6G  623G   2% /
/dev/mapper/rhel-home                             73G  549M   72G   1% /home
/dev/dm-3                                       1014M  245M  770M  25% /boot
/dev/mapper/3624a93708488b6dac70f42a200021650p1  599M  6.9M  592M   2% /boot/efi
tmpfs                                             51G     0   51G   0% /run/user/0
/dev/mapper/3624a9370668f1ab9b15f4bc400014275    1.0T   47G  977G   5% /var/lib/pgsql

If separating database storage locations using tablespaces then the directory locations returned from the pg_tablespace view should be shown as well in the "df -h" output:


Filesystem                                       Size  Used Avail Use% Mounted on
devtmpfs                                         252G     0  252G   0% /dev
tmpfs                                            252G  1.2M  252G   1% /dev/shm
tmpfs                                            252G   11M  252G   1% /run
tmpfs                                            252G     0  252G   0% /sys/fs/cgroup
/dev/mapper/rhel-root                            630G  7.6G  623G   2% /
/dev/mapper/rhel-home                             73G  549M   72G   1% /home
/dev/dm-3                                       1014M  245M  770M  25% /boot
/dev/mapper/3624a93708488b6dac70f42a200021650p1  599M  6.9M  592M   2% /boot/efi
tmpfs                                             51G     0   51G   0% /run/user/0
/dev/mapper/3624a9370668f1ab9b15f4bc400014275    1.0T   47G  977G   5% /var/lib/pgsql
/dev/mapper/3624a9370668f1ab9b15f4bc400014273    2.0T   15G  2.0T   1% /postgres/database01
/dev/mapper/3624a9370668f1ab9b15f4bc400014274    2.0T   15G  2.0T   1% /postgres/database02
/dev/mapper/3624a9370668f1ab9b15f4bc400014271    2.0T   15G  2.0T   1% /postgres/database03
/dev/mapper/3624a9370668f1ab9b15f4bc400014272    2.0T   15G  2.0T   1% /postgres/database04

Microsoft Windows

Open a PowerShell or Command Prompt and enter the diskpart utility:


diskpart 

Once in the diskpart utility use the following to list the volumes:


list volume


  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B  No Media
  Volume 1     C                NTFS   Partition    255 GB  Healthy    Boot
  Volume 2         Recovery     NTFS   Partition    499 MB  Healthy    Hidden
  Volume 3                      FAT32  Partition     99 MB  Healthy    System
  Volume 4         PG_Base      NTFS   Partition   1023 GB  Healthy

Take note of the Volume ### and Ltr. Using this information the volumes can then be matched to a serial number using wmic.