- Make sure you allow root to ssh in: Edit your
/etc/ssh/sshd_config
, add your public key to root's authorised keys, and so on. - Move home, e.g.
mv /home /home.bak
. - Comment out the line that mounts
home
in/etc/fstab
. - Reboot.
- Rename
home.bak
back tohome
. - Stop PostgreSQL.
mv /var/lib/postgresql /var/lib/postgresql.bak
.- Edit
/etc/fstab
, remove comment and replace/home
with/var/lib/postgresql
. - Create
/var/lib/postgresql
withchown
it topostgres:postgres
. - Mount it.
- Move contents of
postgresql.bak
topostgresql
. - Start PostgreSQL.
- Clean up after yourself: Revert your ssh config, remove the key you've added to root, etc.
Created
May 10, 2013 07:06
-
-
Save hakanensari/5552869 to your computer and use it in GitHub Desktop.
You are on OVH, have gone with the default layout on a box, and now realise you'd rather mount differently.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I lied in #2. I actually copied
cp -Rp /home /home.bak
and was trying to simplify in the writeup. @ezkl pointed out mv doesn't work.