Thread: Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

I'm running postgres on a virtual server

I was wondering if there were any known issues with moving the data directory to another mounted partition /
filesystem.  



On Thu, 13 Nov 2014 14:44:22 -0500
Jonathan Vanasco <postgres@2xlp.com> wrote:

> I'm running postgres on a virtual server
>
> I was wondering if there were any known issues with moving the data directory to another mounted partition /
filesystem.  

At my previous job the company standard was that databases went under
/var/db, so all our PostgreSQL servers used /var/db/postgres
/var/db was also usually a dedicated mount point connected to a fast
RAID-10 drive array.

Never had any trouble with it.

--
Bill Moran
I need your help to succeed:
http://gamesbybill.com


On 11/13/2014 11:44 AM, Jonathan Vanasco wrote:
> I'm running postgres on a virtual server
>
> I was wondering if there were any known issues with moving the data directory to another mounted partition /
filesystem.

I do that all the time.    I avoid using nfs/smb type shares for data
directories, but any SAN or direct attach file system is fine.   I'll
either mount the dedicated data partition as /var/lib/pgsql/9.3/data,
or I'll update the startup configuration to force the data dir to be in
another path, like /u01/pgsql/9.3/data

--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



Jonathan Vanasco-7 wrote
> I'm running postgres on a virtual server
>
> I was wondering if there were any known issues with moving the data
> directory to another mounted partition / filesystem.

Define "moving"

Also, it is recommended to separate system logs, WAL, and data onto separate
drives where possible.  Are you wanting to just move data or all of these
things?

David J.




--
View this message in context:
http://postgresql.nabble.com/Are-there-any-downsides-to-using-postgres-data-directory-on-a-dedicated-drive-partition-filesystem-tp5826870p5826878.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


On 11/13/2014 1:08 PM, David G Johnston wrote:
> Also, it is recommended to separate system logs, WAL, and data onto separate
> drives where possible.  Are you wanting to just move data or all of these
> things?

I find putting all the disks in one big happy raid10 and leaving
everything on the same file system works just fine, achieves evenly
balanced IO

--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



Jonathan Vanasco <postgres@2xlp.com> writes:
> I'm running postgres on a virtual server
> I was wondering if there were any known issues with moving the data directory to another mounted partition /
filesystem.  

You can put the database directory anywhere you want.

Obviously, it has to be trustworthy storage, and in that respect I'd
caution against soft-mounted storage.  There's a disaster story in the
PG list archives somewhere (quite some time back, maybe 10 years ago)
about somebody who had their database on NFS storage.  One day the
NFS server was a bit slow to mount after a reboot and didn't come up
until after the postgres server start script had launched.  This was
one of those "helpful" vendor-supplied start scripts that would
automatically run initdb if the data directory wasn't there.  So it
started up, looked at $PGDATA and didn't find anything, and launched
initdb.  initdb faithfully checked that $PGDATA was empty (still true)
and set about creating files.  Right after that, the NFS server finally
comes online ... and now initdb is scribbling over the system catalogs
of the live database.  Needless to say, that did not end well.

Disconnecting storage from under an already-running postmaster will
possibly spoil your day too, although it should be reasonably survivable
as long as it wasn't the WAL logs you dismounted.

So, while you can do what you like, it behooves you to think about
possible failure modes anytime you choose to put the database directory
(or a tablespace directory) on any dismountable storage.

            regards, tom lane


Thanks, everyone!

For now this will be provisioning physical drive for a box -- and "everything" will be there for now.  So OS on one
drive,and DB on another.   

I've run into programs before (mostly on Mac/Win) that are exceedingly not happy if they're run on a drive other than
theOS.   

Since many people partition data and services under pg, I figured it would be okay -- but I couldn't find anything in
thedocs and wanted to check.