2

I would like to install a Linux distribution (probably Devuan) on my dual SSD system, in the most convenient way:

  1. 250GB, NVMe.
  2. 500GB, SATA3.

The criteria are both performance and SSD lifespan (giving the priority to the NVMe one).

  • Which directories of Linux require the best performance, and which ones are not critical?
  • Which directories are (mostly) accessed in read mode, and which ones in read/write mode?
  • Considering I have 24GB of RAM, where had the /tmp directory better be located? NVMe, SATA3 or RAM-disk? Had anything else better stay on the RAM-disk?
  • Should directories which are entirely loaded in memory (e.g. the kernel) not have any performance impact after boot?

The system is a laptop used mainly for development.

Could this be a good distribution?

  • Fast & small drive: /, /etc, /bin, /sbin, /lib, /lib64, /usr, /boot, /root, /sys, /home?, /opt?
  • Large & slow drive: /media, /mnt, /lost+found, /var, /home?, /srv
  • RAM disk: /tmp, /run, /var/run, /var/cache?, /var/spool?
  • Kernel provided: /dev, /proc
1

On my laptop, I have the root, boot and home filesystems on a 250gb nvme, partitioned. Some loaded locations inside /home are mounted on a btrfs (subvolumes) that spans a 250gb SSD. Such as Pictures, Music, Documents. Downloads and some not very critical backups go on a 750gb HDD installed in de cd-rom bay.

My use case:

  • Gentoo linux
  • Personal use
  • Development in VS code, Docker.
  • Some virtual machines, images live in /var on nvme
  • Some games

Reasoning: a lot of desktop apps use a lot of small data files, sqlite or equivalent embedded database files (hidden in /home). Their performance is greatly boosted on nvme, as it allows for parallel access.

I like the Vm's I'm running from time to time to boot fast and I have the space. So why not?

Running this setup for 2+ years without issues.

/var/tmp, /run and /tmp are tmpfs.


Note on lifespan. Nowadays most NVMe and SSD drives use the same NAND technology. So the lifespan is more or less the same (measured in read / write). Chances are that the NVMe has a better lifespan, as it is in a higher price class. But this really depends on what you've bought.

It basically comes down to a financial decision in the end.


Note on the locations mentioned in the question:

/media is usually not really used. I believe there was a time that some automounting happened there. But this all moved to /var/run/user. Likewise /mnt just a standard directory without content. Maybe some empty subdirectories as mount points. No data ever goes there. /lost+found should NEVER be moved. It lives on the root of every ext{2-4} filesytem for storage of corrupted files after fsck.

/var/{spool, cache} don't put them in ram. They are meant to persist over reboots. And unless you are running a high traffic server, these directories stay relatively small.

2

There are many good resources available regarding the Linux file system. I would read up on the uses of the higher level directories:

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

In general you might find that having most things on the faster SSD and making specific exceptions will be the easiest way to separate. The way you chose to use your system will change things a bit but a good starting point would be something along the lines of:

Program and config tend to be fairly static unless you make a LOT of system changes regularly. So the following are more performance critical, less updated, lower volume / /etc /bin /sbin /lib /lib64 /usr /boot /root. This accounts for the majority of your operating system. /root is root user's home directory but generally better kept with your OS in case of emergencies.

I would put program variable data and user data on the other drive: /var /home. These can be on a slower drive where you expect more rewrites.

That just leaves the file systems not typically stored on disk:

/tmp and /run is generally a ram disk. (/var/run can be a symlink to /run). /dev /proc /sys are all provided by the kernel.

  • I updated my question, adding details from you answer and from your link. There are some question marks for the details I am more in doubt with. – Pietro Mar 25 at 17:46
1

If you think about it, the OS will benefit from a faster drive, programs will load faster, so you put your root on your NVMe. You have more than enough space on your root drive.

Use your 500GB drive for your /home directory.

I would always put tmp in RAM.

All this depends on what you do with your Linux system, I assume a desktop system. If you intend to use it as a server, please tell us what you want to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.