Apart from using it for swap space, I'm going to be using the temporary storage available in my Azure VM (Ubuntu 14.04 OS) for storing Postgresql temporary files as well.
To enable that, I've to create a symlink at /$PGDATA/base/pgsql_tmp
that points to /mnt/pgsql_tmp
. So that should be ln -s /mnt/pgsql_tmp $PGDATA/base/pgsql_tmp
.
This reasonably ensures all temp files are stored and read from the SSD-based temporary storage. However, one hitch: the user postgres
does NOT have permissions to write to /mnt
:
drwxr-xr-x 4 root root 4.0K Mar 18 12:40 mnt
How do I ensure postgres
also has write permission on /mnt
? Should I just do sudo chmod -R 777 /mnt
and be done with it?
I know this is elementary, but since it's a production server and I've already got swap set up in /mnt
I don't want to misconfigure it and run into problems tomorrow.
p.s. this is how the temporary storage currently looks like:
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 221G 9.9G 200G 5% /mnt
Best Answer
The effect:
The
chmod o+x
means to give [o]thers the +e[x]ecute bit, which gives them a permission to traverse across/mnt
into any subdirectory. Other permissions are not necessary for/mnt
only for/mnt/pgsql_tmp