2

I have a 512 GB SSD and a 1 TB HDD on my laptop. I already have Windows 10 installed on this machine and I am about to install Ubuntu 18.04 along with it. I have 214 GB of unallocated space in the SSD and 488 GB of unallocated space in the HDD, which I can use for Ubuntu.

I am planning to dedicate 100 GB from the SSD for /. Now, I am a bit confused about /home. I want to use rest of the unallocated space in SSD and all the unallocated space in HDD for /home. I have two options:

1) Mount SSD space as /home and create a mount point inside /home, called sub_home to mount the HDD space.

2) Mount HDD space as /home and create a mount point inside /home, called sub_home to mount the SSD space.

But I want to make sure that I am able leverage the speed of the SSD and I am not sure if I will be able to do that if I go with the second option. At the same time, if I pick the first option, Ubuntu folders such as Documents, Downloads, Pictures etc. will be created in the SSD which I prefer to avoid. Please provide guidance. Note that the top priority is speed of SSD.

Also, is there a possibility of assigning one of them as /home and mounting the other outside of / and /home? Will such an approach create any issues? I have never used any mount points other than / and /home, except for external drives and SD cards.

Edit1: I believe I need to clarify the question based on the comments. I am not planning to use SSD for usual Ubuntu /home folders such as Documents, Downloads, Pictures etc. I am planning to use it to keep machine/ deep learning datasets, gazebo simulation models, ROS files etc. I thought these files might benefit from the speed advantage.

skr
  • 201

2 Answers2

2

The beauty of a Linux file system is that you can mount any device, any place you please. For instance if you have large data sets, too large to be cached effectively by available ram you can choose a folder named whatever you want, wherever you want on the tree.

Some folders already in existence on the system are well suited for specific tasks. I often mount big data drives on /srv for instance. To be compliant distributions include this folder but I have not seen it used much in the past decade other than for my own purposes.

As an example: Say your SSD drive is /dev/sda and you partition it such that you have ~100 GB primary partition /dev/sda1 on the SSD for / and you decide that the remaining ~400GB on the drive which you've partitioned as /dev/sda2 will be used for data storage and mounted at /srv your /etc/fstab file would look something like this:

# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=06a31723-1f61-4bae-ae5d-403cd35d0adc /               ext4    errors=remount-ro 0       1
# /home was on /dev/sdb1 during installation
UUID=a2a0bb88-9faf-4e83-91cc-f687e1b4525a /home           ext4    defaults        0       2
UUID=7a6cc92c-4c0d-42e2-baac-373287cf5b80 /srv      ext4    defaults    0   2       
# swap was on /dev/sdc2 during installation
UUID=f0f7785c-25b5-4770-b2b3-fd618ebf58c7   swap    swap    defaults    0   0

The installer is very good at allowing you to specify specific partitions for default mount points, but you can also create your own, anywhere and mount them via /etc/fstab. It's entirely possible to have a different drives/partitions mounted at / , /SSD , /HDD , /bin , /opt , /home , /home/Documents , /srv/ /srv/data etc, etc, etc.

The only limiting factor on the number of drives is the space available to place them and the power available to run them. IF you had 50 bays and table space for 10 external drives you could mount them all, anywhere on the tree you would like. There are also methods that allow for making numerous drives appear as 1, but I won't go into that as it appears that you want more control over which device is being read from and written to than is allowed by such approaches.

EDIT: There's a decent write up on the `Nix directory structure here.

If anything about this answer is unclear, please drop me a comment and I'll do my best to elaborate.

Elder Geek
  • 36,752
1

I have used mhddfs to make multiple physical disks appear as one, this might fit what you are looking to do. There are other tools as well, mergerfs, unionfs, and aufs

So you could mount one disk as /media/ssdhome and another as /media/hddhome, combine them as /home. Then inside each you could make a symlink to the other disk called sub_home, or just utilize the /media/ paths when creating new files.

rtaft
  • 1,920