DEV Community

Discussion on: PostgreSQL 16 Installation on Ubuntu 22.04

Collapse
 
ramos96 profile image
Evaristo Ramos

hi sorry for the n00b question, but how do i change the default data directory? as i am looking to install a 1TB db that will exceed my boot/os drive

Collapse
 
johndotowl profile image
JohnDotOwl • Edited

Sorry for the late reply
Edit the postgresql.conf file: Find the data_directory parameter and set it to the new path you want to use. For example:
data_directory = '/new/data/path'

To add on, you can run commands like
df -h Show mounted filesystems along with disk usage
lsblk List all block devices along with information like mountpoints, size, type

Collapse
 
ramos96 profile image
Evaristo Ramos

yah that didnt quite work for me. I did end up figuring it out though, from virgin install to new custom directory took 27 steps :/

Thread Thread
 
johndotowl profile image
JohnDotOwl

Haha , that is one of the reason why i started blogging because i realise i'm going through the same process multiple times these years. Glad you got it figured out!