Ask Your Question

Move /home to a new partition

asked 2015-09-24 08:06:09 -0500

shrimpandwalrus gravatar image

Fairly new linux user here running Fedora22.

When I installed, I left my /home directory in the same partition as the rest of the OS. Does anyone have a good guide to moving my /home to a new partition? I plan on trying out dualbooting fedora22 and mint, and I'd like to share my home directory.

Is it easier to move /home, or just back everything up and reinstall?

edit retag flag offensive close merge delete


You can move your home with no issue as long as you set the proper target on fstab. How ever normally to share home you install one system and when installing the other you let it know that you will be using the home partition for your home. Hope it helps

aeperezt gravatar imageaeperezt ( 2015-09-24 09:53:47 -0500 )edit

My problem is that my /home directory is in the same partition as everything else. What steps do I take to move it to a separate partition? Or is that even possible?

shrimpandwalrus gravatar imageshrimpandwalrus ( 2015-09-24 10:15:09 -0500 )edit

On that case create a new partition format it, mount some place

mkdir /mnt/newhome
mount /dev/sdaX /mnt/newhome
aeperezt gravatar imageaeperezt ( 2015-09-24 10:17:33 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2015-09-24 10:33:03 -0500

masteroman gravatar image

Depends on how you define easy ;-) Joke aside, if you want to migrate your /home to dedicated partition you'll need to do something like this:

  • Prepare your new partition
  • Mount it somewhere like:
    • sudo mount /dev/sda{newpartitionnumber} /mnt
  • Copy contents of your current /home there:
    • cp -ar /home/* /mnt
  • Edit your /etc/fstab:
    • sudo vi /etc/fstab
    • or sudo gedit /etc/fstab depending on what's your editor of choice.
  • Define your newly created partition as /home mountpoint:

    /dev/sda{newpartitionnumber} /home ext4 defaults 1 2

(filesystem column depends on the filesystem you decide to use)

  • Rename old /home
    • sudo mv /home /home.old
  • Reboot
    • systemctl reboot -i
  • Hope I didn't forget something.
edit flag offensive delete link more



That looks very doable, if a little scary XD I've never touched my fstab file and don't know anything about it, will it be obvious what I need to change, or do you perhaps know of a good guide?

"/dev/sda{newpartitionnumber} /home ext4 defaults 1 2" is completely alien to me, could you possibly explain what is going on here?

Everything else looks great, thanks for your help!

shrimpandwalrus gravatar imageshrimpandwalrus ( 2015-09-24 10:40:53 -0500 )edit

/etc/fstab contains information about the filesystems, basically tells your system where and how to mount partitions automatically when system boots. /dev/sda{newpartitionnumber} - path to your partition /home - mountpoint of this new partition , it will basically mount partition in that directory. ext4 - type of the filesystem you want to use defaults - use default parameters for this partition man 5 fstab for an in-depth explanation ;-) My example: /dev/sda2 /home ext4 defaults 1 2

masteroman gravatar imagemasteroman ( 2015-09-24 10:59:55 -0500 )edit

man fstab will tell you everything you need to know except one thing: if your new line is at the bottom of the file, be sure to hit Enter at the end or mount will complain.

sideburns gravatar imagesideburns ( 2015-09-24 11:21:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-09-24 08:06:09 -0500

Seen: 2,872 times

Last updated: Sep 24 '15