Search

2.3.2. Database Partitioning

download PDF
A mounted database partition provides various benefits such as scaling storage to accomodate a growing database, easy backup and transfer through replication, and encryption for added security.
To set up a database partition mount point, follow this procedure prior to installation.

Procedure 2.1. Creating and Mounting a Database Partition

  1. Log in to the database server as root. For Embedded Databases, this is the same server as the Red Hat Satellite.
  2. Create the postgres user.
    # useradd -d /var/lib/pgsql -M -r -s /bin/bash -U postgres
    
  3. Add the mount point in /etc/fstab. For example:
    UUID="xxxxxxxx-xxxx-xxxx" /opt/rh/postgresql92/root/var/lib/pgsql  ext4  defaults  0 0
    

    Important

    Red Hat does not support storing the database on a network filesystem.
  4. Mount the partition to /opt/rh/postgresql92/root/var/lib/pgsql and change ownership to postgres:postgres:
    # mkdir -p /opt/rh/postgresql92/root/var/lib/pgsql
    # mount /opt/rh/postgresql92/root/var/lib/pgsql
    # chown postgres:postgres /opt/rh/postgresql92/root/var/lib/pgsql
    # chmod 700 /opt/rh/postgresql92/root/var/lib/pgsql
    # restorecon -Rv /opt/rh/postgresql92/root/var/lib/pgsql
    
The Red Hat Satellite Installation Script will install the database to the partition mounted at /opt/rh/postgresql92/root/var/lib/pgsql.

Important

Due to an updated version of the PostgreSQL Embedded Database, the database location has changed from /var/lib/pgsql in Red Hat Satellite 5.6 to /opt/rh/postgresql92/root/var/lib/pgsql in Red Hat Satellite 5.7. Make sure to allocate enough hard disk space to this location.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.