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

Hi, 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


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.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Accepted Answer

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.