How to have multiple directories point to the same partition/disk?

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 use btrfs, if that helps.

Link, example:

sudo  ln -s /data/Downloads ~/Downloads

But first move the directory to the harddisk :wink:

Try this:

mkdir ~/mount
mount /dev/sdbX ~/mount
mkdir ~/mount/var
mkdir ~/mount/tmp
mkdir ~/mount/localvar
mount -o bind ~/mount/var /var
mount -o bind ~/mount/tmp /tmp
mount -o bind ~/mount/localvar ~/.var

Before bind mounting over /var make sure you use rsync to copy all the data over. Mounting over /var will break pacman.

Alternatively, you can replace the bind mounts with symbolic links as suggested by @xircon. The effect will mostly be the same either way.

That being said, their will most likely be a performance hit by moving /tmp to your HDD. I would consider not doing that if I were you.

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?

Yes. You could create multiple subvolumes and then just mount them as normal.