How to add an additional HDD to /home

Hello all first post here. I searched for my question without finding an answer. I was also not sure of the proper category to post this in. I am trying to increase the size of my /home by adding another internal 2TB HDD. I am running out of space on my existing one. When I mount the HDD it shows as an ejectable disk in my file manager. Also plex does no recognize it. Is there a way to add it to the existing /home size seamlessly? I have a folder I put my Plex movies in, but its becoming full and I was trying this as a quick fix. Thank you. Ubuntu 18.10 dual booted with Windows 10. i7 4790k. 16GB Ram. Nvidia 970.

1 Like

Quickest thing might be add the new disk and mount it to ~/plex_2 or whatever makes sense for your directory structure.

To expand the directory might be trickier. You may be able to do it with lvm but I’m not sure.

I am trying to increase the size of my /home by adding another internal 2TB HDD.

In order to dynamically expand storage like that on Linux, you need one of two things.

Either a filesystem like ZFS or BTRFS that supports spanning multiple drives natively or LVM, which is a logical volume manager that allows you to dynamically allocate storage.

If you didn’t set either of those up in the beginning, you still don’t have to reinstall, but it will require you to copy your /home directory.

  • Install new HDD
  • Format it as an LVM physical volume
  • Create new volume group
  • Create new logical volume
  • Create new filesystem on new logical volume
  • Copy /home data to new filesystem
  • Verify copy integrity
  • Edit /etc/fstab and set your new logical volume as /home
  • Reboot
  • Reformat old storage as LVM physical volume
  • Add newly formated physical volume to volume group
  • Expand filesystem (if needed)

We might be able to help a bit more if you post the layouts of your existing storage. If you’re already using LVM or a supported filesystem, the whole process might be easier.

The output of pvdisplay, vgdisplay, lvdisplay, lsblk, and blkid will help out a bunch.

7 Likes

If its easier I can just have a whole new folder in that new HDD and add the folder to Plex, but plex doesnt see the drive for some reason.

Can you just put a symlink in that points it to the new drive from the old directory? I haven’t messed with Plex much so I don’t know if it would have an issue with a symlink.

1 Like

I think you should understand how block devices and file systems work in Linux.

Your harddrive is the block device. (for example /dev/sdb). On top of this sits the file system (ext4, xfs, whatever). This is then mounted to a folder.

To expand the file system, you need a bigger block device or a FUSE-based solution to merge two seperate file systems on two block devices into one. Something like mergerFS could do this.

THe more robust solution would be to do a software raid in mdadm. THis would combine two block devices (like /dev/sda and /dev/sdb) to create a new block device (like /dev/md0) that you would then format this and copy all your data onto it.

I suggest you go read. The Arch Wiki is a good reference.

Have fun!

@imhigh.today described it well, but for a quick and dirty GUI way: open up gnome disk utility and setup the expansion drive to mount in your /home directory.

Won’t be spanned storage but maybe you can live with it.

2 Likes

If OP initialised and formatted it in gparted, setting the mountpoint to /home/username/newfolderforplex would it get added to the fstab, or would it be a temporary thing?
Would it also default to owned by root?

Can’t actually say*, I haven’t used gparted all that much so I don’t know how it edits the fstab.

Personally for me gparted has always been a bit clonky, so I’m customed to manually manipulate the partitions and mounts via cli, or for smaller stuff I tend to favor gnome-disk-tool for its simplicity.

*someone surely has a comment on that.

2 Likes

Gnome-disks does seem to give much easier access to simple things like mounting, creating and deleting partitions, but I really like gparted being able to copy and paste partitions, and resizing

And stuff like looking up serial numbers and smart on Gnome discs

What if I want to keep it simple and create a new folder on this new internal HDD. How can I mount it to where it doesn’t show up as an eject-able disk?

3 Likes