Configure a database for OpenStreetMap on another disk
Perhaps you need more space for your OpenStreetMap database and decide to move it to your shiny new big disk or RAID array? Sound good? Here we go. We need to create a tablespace for the database, then use it.
Create a directory for the database
sudo mkdir /raid/newgis
sudo chown postgres:postgres /raid/newgis
As the postgres user
sudo -u postgres -i
Create a user for this database. Perhaps replace
username with your username? Sure.
createuser username # answer yes for superuser
Create a tablespace for the new database. This is where the database tables will be stored.
echo "create tablespace newgist location '/raid/newgis';" | psql
Create the database with the -D tablespace option.
createdb -D newgist -E UTF8 -O username newgis
Continue configuring the database as usual. When imported, the database will be stored in /raid/newgis, rather than the default location.
This article was originally published on Fri, 03/26/2010 - 21:26.