OpenStreetMap postgresql postGIS database on RAID

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.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <q> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h1> <h2> <h3> <h4> <pre> <sup> <sub> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options