Creating Data Drives
Create a data drive to store PostgreSQL data files.
- When testing the ultimate performance, you are advised to attach an NVMe SSD with better I/O performance to create the PostgreSQL test instance. This eliminates impact of drive I/O on the performance test result. This section uses an NVMe SSD as an example. For details, see 1 to 6.
- If no performance test is required, skip this section and go to Creating the Data Directory and Assigning Rights.
- Create a file system. XFS is used as an example. In the following command, replace /dev/nvme0n1 with the actual drive name.
1mkfs.xfs /dev/nvme0n1If a file system has been created for the drive, an error will be reported when you run this command. You can use the -f parameter to forcibly create a file system.
1mkfs.xfs -f /dev/nvme0n1
- Create a data directory.
1mkdir /data - Mount the drive.
1mount -o noatime,nobarrier /dev/nvme0n1 /data
- Go to the edit screen.
vim /etc/fstab
- Press i to enter the insert mode and add the line to the end of the file.

- Press Esc, type :wq!, and press Enter to save the file and exit.
Parent topic: Configuring the Installation Environment