How to Move Home Directory to New Partition or Disk in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

8 Responses

  1. Manu says:

    Hi Mate,

    That we can use LVM concept at here that make easy to manage filesystems ?plz advice.

  2. Alexey says:

    Thank you for your article, a very detailed explanation.

    But I have one question about the content of the /home folder after remounting on /dev/sdb1.

    As far as I understand, in the beginning you created /srv/home folder and then copy the content from /home folder to the /srv/home. After that you checked the difference between them by using diff tool.

    Then you removed everything inside of the /home and unmounted /srv/home.

    Everything is clear at this stage.

    And next, you remounted again /home to a new HDD /dev/sdb1.

    But in my opinion, in that case the new /home folder is empty since you removed the content of this folder earlier and didn’t copy the content from /srv/home to this /home before this mounting.

    What did I miss here?

    Thank you!

    • Aaron Kili says:

      @Alexey

      Yes, the new /home folder is empty since its content was removed earlier on. Remember we copied it into the /srv/home directory which was mounted to /dev/sdb1. Meaning the content was stored in the space on /dev/sdb1; here /srv/home only acted as the mount point.

      A mount point like /srv/home or /home is simply a directory from which we can access a filesystem space such as /dev/sdb1.

      Then we unmounted /srv/home but still the content is present on /dev/sdb1, finally we mounted /dev/sdb1 to /home which is the new mount point.

      I know it’s a little confusing but reading through the mount command manual page will help you understand better.

  3. Flavio says:

    Thanks for your great article! I’m a newbie so I have a question: why you partitioned the second hard drive in two partitions and why you have chosen to format the second one in xfs?

    Flavio

    • Aaron Kili says:

      @Flavio

      We have created two partitions with different filesystem types for demonstration purposes. You can choose to create one partition on the new disk depending on your needs.

      Thanks.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *