Formatting an XFS filesystem
The next and last part of our stack is the filesystem layer. This is where the PostgreSQL data will reside, so we need to ensure it's allocated properly. Unlike the underlying LVM layers, the filesystem is not so easily modified.
In this recipe, we will discuss some common formatting options and why we recommend them in addition to necessary commands.
Getting ready
Since this is the last layer in our complete stack, we strongly suggest following all the recipes up to Incorporating the second LVM layer before starting here.
How to do it...
Assuming pg1
is our current primary node, follow these steps there as the root
user:
- Activate the second LVM volume with this command:
lvchange -a y VG_POSTGRES/LV_DATA
- Count the number of CPUs on the primary node.
- Multiply the CPU count by four.
- If the total in the previous step is less than 256, use 256.
- Use this command to find the Linux kernel version:
uname -r
- For kernel versions
3.0
and above, format the XFS filesystem with...