I use Azure infrastructure to host a Django/Postgresql application. The app and the db are on separate VM. Each VM has Ubuntu 14.04, and it's the classic flavor.
I've been using the OS disk for my db's storage (capacity: 30GB). This was fine in the early days when the size of my DB was small. But now, going out of disk space has become a real danger.
Via what steps can I procure more storage space for my DB VM. Moreover, what steps would I need to execute to move the postgresql DB to this newly procured storage space?
I want to avoid downtime or data loss, and being an accidental DBA of sorts, would love fool-proof steps explained in terms understandable for beginners. Thanks in advance!
Update:
After mounting the disk, the steps entail:
Editing the data_directory
in /etc/postgresql/9.3/main/postgresql.conf
to point to the new location (e.g. /home/data/postgresql/9.3/main
)
Transferring contents of PG's data directory to /home/data
via sudo rsync -av /var/lib/postgresql /home/data
Restarting posgtesql via sudo /etc/init.d/postgresql restart
Note: change steps accordingly if the additional storage is mounted somewhere other than /home/data