-1

there is a 1TB disc drive and a 128GB SSD on a system I am setting up. I'd like to mount parts of it over the $home of the log in user so that the smaller SSD doesn't get used up with files.

Presently I'm stuck at an entry on /etc/fstab like:

/dev/disk/by-uuid/999blahblahblah /home/rod/Storage auto nosuid,nodev,nofail,x-gvfs-show 0 0

this puts the contents of the entire disk mounted in the directory $home/Storage (when logged in as user "rod")

However I'd like a more granular approach and have directories such as Documents, Music, Pictures and Videos on the platter drive and mount these to $home versions (which are presently empty)

Even more ideally I'd like to have this per user.

I'm keen to hear suggestions on this as I'm a little out of my area here.

Oh, the machine will only have two users.

Thanks

pellicle
  • 9
  • 3
  • 1
    One approach is to move the `/home/` to its own partition in the 1TB HDD. This process is well documented. Another approach is to create soft links to folders in the 1TB disk without moving the `/home/`. – user68186 Dec 24 '22 at 06:25
  • See [Move home folder to second drive](https://askubuntu.com/questions/21321/move-home-folder-to-second-drive) for the first approach. See the [original answer part of the accepted answer to this question](https://askubuntu.com/questions/282831/do-i-need-intel-smart-response-when-installing-ubuntu) for how to create soft links to Documents etc. folders. – user68186 Dec 24 '22 at 06:28
  • Another approach is to merge the two using e.g. aufs or overlayfs … please see https://askubuntu.com/q/1222052 for examples. – Raffa Dec 24 '22 at 07:21
  • What about editing `~/.config/user-dirs.dirs`? – mook765 Dec 24 '22 at 13:34
  • Thanks @user68186, that's really helpful stuff. – pellicle Dec 25 '22 at 22:28
  • @mook765, thanks I'll look into that ... also, is this the right way to reply to you? – pellicle Dec 25 '22 at 22:55

1 Answers1

0

However I'd like a more granular approach and have directories such as Documents, Music, Pictures and Videos on the platter drive and mount these to $home versions (which are presently empty)

This is where you can use mount --bind. This way, directories of a mounted file system can be mounted elsewhere in the file system.

However, using symbolic links instead is by far an easier solution, that does even not require you to be root. Move your "Music", "Pictures", etc anywhere on a mounted drive where you like. Then link them back into your home directory using symbolic links. For practical purposes for the regular user, such symbolic links acts and feel like a real directory.

vanadium
  • 82,909
  • 6
  • 116
  • 186
  • thanks, I'm presently having trouble with all of the details of this as things are telling me they aren't present ... probably the nub of the problem is that the drive is mounted strangely – pellicle Dec 25 '22 at 23:02
  • If this answered your specific question, i.e., how to make subdirectories on other volumes available under home, then please consider accepting the question: click the checkmark next to the answer. – vanadium Dec 26 '22 at 09:52