How can we move /home in ubuntu to a block storage?

Posted September 13, 2017 3.9k views
Ubuntu 16.04Block Storage

I wanted to ask if we can add a block storage and then move /home there.
That’s an easy process when installing ubuntu to a laptop with say 2 partitions but is this possible in these mounted volumes?

Thanks in advance

1 comment
  • Suppose inside user’s home at the droplet I add a link to a dir in block storage with this user’s permissions; is this possible? Php can fopen() with path like link/block-storage-users-folder/some-file? Can we use different filesystems between droplet and block storage? Which filesystem is best for many user’s files? Php runs with users permissions NOT www-data or the like.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Yeah you can, it’s quite simple to do

  • mount your new block storage at let’s say /mnt
  • rsync /home over to /mnt
  • delete everything from /home (this is optional to create more space for root partition, MAKE SURE EVERYTHING IS THERE BEFORE DELETING)
  • unmount /mnt
  • mount the new storage with fstab to /home to have it mount on bootup

Well, this seems not to work anymore. Now they have some stupid thing called /dev/disk/by-id/scsi-0DO and I can’t change my location of the home with the above instructions. When I delete the home and mount it as above the home is gone when I reboot my system. Happy that I made a snapshot before I took this action.