0

Generally, when we install a Linux distro (I'll use Ubuntu-like distro as an example, but can be any distro), we define partitions and mount points that will be applied to a disk, after we click on "Apply" or "Continue". Usually, we create partitions and set mount points to them, and after a fresh install, a hypothetical /etc/fstab with two drives could look like the following:

UUID=UUID_OF_SSD_DRIVE_PARTITION /             ext4    errors=remount-ro 0       1
UUID=UUID_OF_HDD_DRIVE_PARTITION /home         ext4    defaults          0       2

However, I would like to achieve the following: Define a main, whole drive partition on the spinning HDD drive, create a directory there and define write-intensive mount points inside of this folder (like /tmp, /var and /home), without setting "discrete partitions", so I could use the whole drive for everything.

First thought I had, was to use bind mounts for these things at installation time, so my /etc/fstab would look like this right after the installation:

UUID=UUID_OF_WHOLE_SSD_DRIVE_PARTITION /       ext4    errors=remount-ro 0       1
UUID=UUID_OF_WHOLE_HDD_DRIVE_PARTITION /spin   ext4    defaults          0       2
/spin/var                   /var               none    defaults,bind     0       0
/spin/home                  /home              none    defaults,bind     0       0
/spin/temp                  /temp              none    defaults,bind     0       0

The questions I have are:

  1. How to accomplish this at installation time, since we don't have the destination filesystem in place to do something like that, and probably the installer runs things in a "chroot-ed" way?
  2. Will this kind of setup only write stuff to my spinning drive, or it will only "mirror" contents from the "default" locations to these new bind points?
  3. Will this have the same result as creating symlinks or hard links (e.g. things will be persisted only on the HDD drive and will be linked to their original directories)?

What I'm asking is related to this other question from Unix/Linux Stack Exchange, however, I would like to know if this is possible at installation time.

  • I'd do it the other way roubd and use lvmcache (you will be upgrading hardware long before your SSD hits it's write count) – user1133275 Jun 9 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.