1

I need to transparently merge the contents of the two partitions into the /home/user directory, the root on the SSD containing the dotted files and directories, and other files and directories from the partition on the HDD. Dotted files and directories must be written to the root SSD, and all the rest to the HDD.

SSD                 HDD               -> /home/user

.config             Downloads            .config
.cache              Desktop              .cache
.local              Documents            .local
.dotted_files_dirs  Undotted_files_dirs  .dotted_files_dirs
                                         Downloads
                                         Desktop
                                         Documents
                                         Undotted_files_dirs
1
  • Currently, I'm testing mergerfs for same requirement. I tried overlayfs before, but overlayfs (or other union filesystem with copy-on-write feature) does not work as what I wanted: It has only one writable directory (the upperdir), and the copy-on-write feature will make your files duplicated in the upperdir (from lowerdir) if you change/modify them. Commented Sep 7, 2020 at 9:30

2 Answers 2

1

Unfortunately, you cannot have 2 partitions mounted on the same directory.

However, you can mount the second partition in an other directory and use symlinks.

Ex :

mount your HDD into /home/username/

mount your SSD into /mnt/ssd/

Create symlinks in /home/username/ to your /mnt/ssd/ dotted files

Note : You can also use bind mounts instead of symlinks

0

This is not possible with a "real" (block device) filesystem.

But this can be done with virtual (FUSE) filesystems which combine the content of other filesystems:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .