I have a small ssd on which my system (including home) is installed but would rather have some directories like /var, /tmp, ~/.var use up the space on a partition on my hdd (/dev/sdbX). The first thing I tried was something simple like this:
mount /dev/sdbX /tmp
mount /dev/sdbX /var
mount /dev/sdbX ~/.var
but I noticed that if I create a file in one directory (e.g. touch /var/newfile), then that file appears in the other directory (will that create problems?). The second thing I tried was something like this:
mkdir ~/mount
mount /dev/sdbX ~/mount
mount -o bind ~/mount /var
mount -o bind ~/mount /tmp
mount -o bind ~/mount ~/.var
but I ran into the same ‘problem’ as above. Of course, I could just split /dev/sdbX into multiple partitions but I don’t want to do that because I don’t know exactly how much space these directories will need.
I feel dumb for not thinking of making subdirectories under ~/mount. Silly me. Anyway I didn’t want to use symlinks since some programmes don’t work well with those.
Anyway, could btrfs subvolumes have helped here?