Contents
How do I mount a house on a different partition?
Overview
- Set-up your new partition.
- Find the uuid (=address) of the new partition.
- Backup and edit your fstab to mount the new partition as /media/home (just for the time being) and reboot.
- Use rsync to migrate all data from /home into /media/home.
- Check copying worked!
- Move /home to /old_home to avoid confusion later!
What is mount — bind?
Bind mounts in Linux® enable you to mount an already-mounted file system to another location within the file system. Generally, bind mounts are used when restricting the access of specified users to designated parts of a website by replicating the website’s directory into a jailed user’s home directory.
How to create a mount point for a partition?
We need to move the contents of the old home directory out of the way and create an empty “place-holder” directory to act as a “mount point” for our new partition. Type the following string of commands in to do all this at once:
How to move home directory to new partition?
We will start by creating a new directory /srv/home where we can mount /dev/sdb1 for the time being. Then move the content of /home into /srv/home (so they will be practically stored in /dev/sdb1) using rsync command or cp command.
How can I partition / home into / old _ home?
By default, when you open a terminal window it places you within your home directory. Typing cd / takes us to the root directory and out of home so we can then use the sudo mv command to essentially rename /home into /old_home, and finally create a new, empty /home placeholder.
Why do I have / home on a different partition?
Also, fresh installs for linux typically like to wipe whatever partition they are being installed to so either the data & settings need to be backed-up elsewhere or else avoid the fuss each time by having /home on a different partition. This is beyond the scope of this page.