The answer you are looking for is Logical Volume Management. That is the tools of LVM2.
Overview: Partitions are managed in Physical Volume Groups.
With these PV-Groups you are able to create Volume Groups (VG).
Within them (VG) you can create Logical Volumes, which represent your usual partitions / filesystems.
There are many things you can gain from this, e.g. extending storage/partitions over the actual size of the physical HDD, Mirroring (RAID-Layouts) or even creating partitions in programs when necessary.
Anyways, there is plenty to learn about but I suggest you just start with three partitions, check the first table (example) of the above wiki.
In your specific case:
One fixed boot partition, outside the scope of LVM2.
One partition on your SSD, suggesting to hold binaries and
one partition for heavy-written data (run, var, userdata, like home) on your HDD.
You can always resize the partitions, after unmounting them.
I suggest you read in advance about the fstab-file and mkfs.utilities to manifest a bit of understanding.
It is really straightforward. Have fun :- )
// edit: I updated links, text and layout of the post.
To answer your following question if you need to do this before installing Linux: You do not. If you have available partitions to transfer data temporarily to, you can easily change all your partitions into using LVM2. For this one can make use of rsync.
Note on rsync: Do not copy files (that is dirs like
/proc) written at boottime from the linux kernel to the new partition. Use its exclude pattern.
edit the fstab file before rebooting or update grub via chroot.
But nowadays every major Linux distro (not aware about BSD) will enable you to partition your hard discs using LVM when installing.
Check this additional link for a hands-on outline setting up LVM: https://www.tecmint.com/manage-and-create-lvm-parition-using-vgcreate-lvcreate-and-lvextend/
- choose and create a partition schema (e.g. GPT, for example using
- the Debian wiki suggests one partition outside LVM for boot,
I suggest another one if you want to use Windoof alongside.
fdisk /dev/sdX you create three new partitions.
- write out the table to the disk.
mkfs.ext4 or mkfx.vfat for making a filesystem on the two partitions outside of LVM scope.
(4b. label them if wished, e.g. using
- proceed with LVM instructions, where you now can use
/dev/sdX3 and your other hard disks.
The provided wiki is extensive and very easy to understand.
All these steps can be supported by any major distro install-utility. You just need to be aware of the 1. partition schema 2. your LVM schema (that is, you can start with an 50G LVM install and adapt your setup from within the CLI. The
fstab file declares where devices should be mounted when booting.
You can refer within the fstab file devices by their path
LABEL=EX_LABEL. Make use of the LVM commands
(pvdisplay) (vgdisplay) -> lvdisplay
NOTE THAT YOU NEED TO USE
lvm mount option in your fstab to mount LVM at boot. Name it at the beginning of the mount options. Refer to man pages to build up your kownledge.