Should I use Symlinks, XDG_user_directories or Bind Mount to "outsource" /Pictures, /Documents etc. to a different SSD?

So in this post I learned that it’s not a good practice anymore to have a complete separate /home on a different disk.


My goal is to “move” some folder out of /home to a different SSD e.g.: /Pictures, /Music and /Videos.

Currently I am planing my next installation and while researching this topic I learned that there are three(?) ways to achieve this:

  1. Using Symlinks e.g.:
mv ~/Documents /data/Documents
ln -s /data/Documents ~/Documents
  1. Using XDG user directories e.g.:
~/.config/user-dirs.dirs
XDG_VIDEOS_DIR="/mnt/Storage/Videos"
  1. Using Bind Mount in /etc/fstab/ e.g.:
# <device>                  <dir>                         <type> <options>     <dump> <fsck>
UUID=94649E22649E06E0       /media/user/OS/               ext4    noatime,noauto,x-systemd.automount  0  0
/media/user/OS/Music/       /home/user/Music/             none    defaults,bind 0   0

Now my question is: What method is the preferred way? What is the least easy to break?
E.G.: when using XDG user directories what happens if a program does not adhere the “xdg specifications”?

Thank you for your help!

I personally mount my second ssd. I think it’s the preferred way for most people doing it that way.

Edit: Should also be the safest way of doing things. If an application doesn’t consider XDG user directories, option 2 doesn’t work. Would be bad if a program does that, but you never know. Not sure about symlinks… For example, if the ssd isn’t mounted that could lead to problems.

Mounting with an fstab entry will simply fail at boot time if there is something wrong. Otherwise it should always work.

So you mean just a second SSD for you data and not the second SSD mounted to /home like I currently do:

# <file system> <mount point> <type> <options> <dump> <pass>

UUID=1C08-9A3A                                  /efi        vfat	   umask=0077	0	0
UUID=82ddd00a-9b5a-4043-953c-ae91a7d8f83e       /           ext4	   noatime	0	1
UUID=3997c5df-badf-49ff-b4ae-213c83401c0a       /home       ext4	   noatime,noauto,x-systemd.automount	0	2

I mount it to home, but what you want to do is pretty much the same, just with separate folders for Videos, Music, etc. I would always do the fstab mount option.

Thank you!
For my next installation I’d like for only Videos, Music, Pictures etc. to be on a different SSD and e.g.: not my Dotfiles so that I could move my data to a different installation without having to deal with my old config.

If you recommend sticking to /etc/fstab I guess that the Bind Mounts are my best options of the three :slight_smile:.

I’m using symlinks. It works 99.9% of the time, sometimes you find an edge case where some application doesn’t like it and you have to provide the actual path to the mount point. But overall it’s OK.

Imho it’s the most lazy and non-breakable way. No config files and if the target isn’t available you can’t accidentily write to the wrong place.

But the other options sound find too.

1 Like

WRONG Also I’m using the defaults option. I don’t think anything else is needed. But I’m no expert on that.

UUID=XYZ       /home/user/Music       ext4	   defaults    0	2

Edit: Nevermind. If you are using folders, like in your first post, you need “bind” as an option.

Did you ask why it isn’t a good idea to just have a separate /home partition?

I did not but I’d be interested in an answer! I just read in the other thread that

A separate /home made sense (perhaps) in earlier days, but it’s entirely unnecessary now.
Much better to add an available script for setting up a separate data partition, with links to all the standard data directories (Downloads, Music, Pictures etc).

I read it too, it’s just a statement, without explanation. I think he is using multiple distros and of course he had problems with a single user dir for every distro, that’s why it’s a better solution for him to link in the data. Symlinks work with every desktop environment or just in the tty, not sure about xdg.

I use symlinks for some data. I moved my user dir to an ssd but wanted to keep my steam stuff on the nvme drive. I moved the steam data to an /nvme-data/steam directory then linked it in my ~/.local/share/ where it was before.

It may have been a statement, but the explanation is simplicity itself - there is no definite problem separating it, but I can’t see an upside anymore! Sorry if that message didn’t come through as intended - but that often happens in forums :grin: