I would like to move individual subfolders (e.g. “Videos”) of my /home directory to another partition (but not the complete home directory!). I thought that the best way to do this would be to format the new partition with btrfs and then mount the individual folders (“Videos”, “Documents”, …) as subvolumes, which I then mount in the corresponding “original” folders (“/home/Videos”, …). As I have no experience with the functionality and mounting of subvolumes, I would like to know how this should look like in “fstab”!
For example, to mount the “Videos” folder of the new partition as a subvolume, I would use the following line (based on existing entries in fstab, but maybe not correct for my purpose?):
(“13141c0b-6ccc-425c-adf5-1303cb118021” is the UUID of the extra partition with the “Videos”, “Documents”, … folders)
What should the line look like with which I can then mount this subvolume under “/home/Videos”?
Does not wok, because the extra partition was only mounted temporarily in “/run/media/micha/home/” and no fstab-entry for a static mount was created. I could now create a static mount for the extra partition (to /mnt) manually, and then use the redirection of Plasma, but I also need to use the folders of the extra partition in Ubuntu (installed on a separate ssd), so a fstab-solution would be best!
Thanks, so I missunderstood how subvolumes are created, not via mount in fstab!
Although the steps for creating subvolumes are easy to understand, I have to memorize/notate them. For example, if I delete the “Videos” folder (from the extra partition) and then create it again, everything looks the same as before, but I have to remember that I have to make this folder a subvolume again so that mounting this subvolume using fstab works.
I have now done a bit of googling and came across bind-mounts. I could then format the partition with ext4 again and mount it to /mnt/home and bind-mount /mnt/home/Videos to /home/Videos (both via fstab). This would document all the necessary steps in fstab! Are there any objections to this method?
You are making it to complicated. You only need another partition. E.g. on /dev/sdb1. This partition needs to be mounted via fstab (details like filesystem doesn’t matter here). Create the wanted directorys (Videos, Documents,…): e.g. (/dev/sdb1)/datapartition/Videos/ on this partition.
Now you only need to set the file path (as shown in my first comment in systemsettings) to these directorys on the new partition. After that you can delete the “original” directorys which you have under your (/dev/sda1)/home. Done! A job of 2 minutes.
P.S.: sdb1 and sda1 are only device examples to show you the concept. Adapt to your need.
Thanks for the help, but I want to keep the original folder structure, otherwise I could simply mount the external partition in a subdirectory of home! I did it now like this (example for the “Videos”-folder), which works as expected: