0

I'm new to Linux environment, I've installed Ubuntu 20.04 on ssd and placed /home dir on another partition on hdd. It's ok with data like documents, films, photos and so on. But I want to keep my work files (code) and things like yarn or npm caches on ssd for obvious reasons (read/write speeds).

The question is: where can I store this files outside the /home dir and have comfortable access to this files, I mean in order to not write each time in terminal something like /usr/local/projects?

  • "But I want to keep my work files (code) and things like yarn or npm caches on ssd for obvious reasons (read/write speeds)." you are likely not to notice any difference an idea would be to create a personal partition on the ssd and mount it. Just like you did with /home but this time mount is as /leonid or /work. – Rinzwind Mar 26 '21 at 14:54
  • @Rinzwind Thanks! Maybe stupid question, but in this case, is here a difference between creating new directory /work or a partition mounted as /work. And why do you think I won't notice any difference? When I worked in windows it seemed that operations like installing or removing packages are faster on ssd, but I'm not really sure about this, just my observation – Leonid Baryshnikov Mar 26 '21 at 15:11
  • It is basically the same but you can un-mount a partition and hide it from others. At my workplace we have strict rules on work related files so I tend to automatically adopt it into my comments. You are not likely to notice it: when it is in memory it will stay there as long as possible and wring to the ssd will be done when resources are available. – Rinzwind Mar 26 '21 at 16:05

1 Answers1

0

I assume your / partition is on SSD and /home partition is on HDD? Then just create some new directory under /, for example /workdata and change ownership of that directory to your user account. Then you can keep anything you want in /workdata. For convenience, you may create a symbolic link to this directory within your /home directory.

raj
  • 10,353
  • "I assume your / partition is on SSD and /home partition is on HDD?" - Yes that's right. Thank you! – Leonid Baryshnikov Mar 26 '21 at 15:29
  • These show moving all the typical folders in /home to a data partition. But you just need to do the same for just your /workdata. Basically create mount point, mount using fstab & link into /home. Then on reboot it will always be available. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting & https://askubuntu.com/questions/1058756/installing-all-applications-on-a-ssd-disk-and-putting-all-files-on-hdd-disk – oldfred Mar 26 '21 at 15:37