Hello Comrades,

Thanks for all your advice about setting up Linux. It was a success. The problem is that I’m now I’m intrigued and I’d like to play around a bit more.

I’m thinking of building a cheap-ish computer but I have a few questions. I’ll split them into separate posts to make things easier. Note: I won’t be installing anything that I can’t get to work on Linux.

Question about storage and swap memory.

I plan to install an SSD of maybe 128–256GB for the system files and a larger HDD for storage. I would partition the SSD so that I could install a few different distros without losing any installation. This way I can commit to some longer experiments before deciding which distro to use.

The question is: should I have the swap partition on the SSD (with the OS partition) or (separately) on the HDD?

And if I install multiple distros, do I need a different swap partition for each one? For example, if I install 16GB RAM, do I need a 16GB partition for, say, Mint, Debian, and Ubuntu? Or can I let them ‘share’ the swap partition?

Are there any additional security/privacy risks of installing more than one distro on the same SSD card?

  • Comrade Birb
    link
    310 months ago
    1. Where I live SSD storage has become very cheap and the price premium for going from 200 GB class SSDs to 500 GB class is insignificant. So I’d suggest going with an entry-level 500 GB SATA SSD like the WD Blue in the first place.
    2. Following from that my opinion is that SSDs are big and durable enough to put swap on them without an issue, assumed that you won’t be swapping constantly. This heavily depends on the amount of RAM in the system. My old-ish laptop only has 8 GB of RAM so I run it with an additional 8 GB of swap file on the internal SSD. My main PC has 32 GB of RAM and I run it without any swap. In any case you’d want to put swap on the fastest storage possible so that your system stays somewhat responsive during swap usage.
    3. You can share swap partitions without any issue since swap is usually wiped/overwritten on boot.
    4. Every OS on your system can read any data from any disk/partition. If you want to have secure separation you need to encrypt the data.
    • @redteaOP
      link
      110 months ago

      I didn’t realise how much the price has come down for SSDs, so I see your point.

      Do SSDs get worn down quite quickly, then, like USB drives?

      If this is the case, is it worth getting a second, small SSD just for swap memory or would that be overkill?

      • Comrade Birb
        link
        210 months ago

        On the contrary it’s better to get a bigger SSD since the writes for swap usage get distributed more evenly across the larger memory pool. Modern SSDs can take a lot of writes before degrading since their controllers are very smart. USB drives get worn out a lot faster since they lack redundancy in storage and good memory controllers.

        • @redteaOP
          link
          110 months ago

          That’s helpful, thanks.

          If you don’t mind, could I ask another question, seeing as you seem to know about this topic. If I save, say, 5gb worth of pdfs, does that 5gb worth of space get worn down by virtue of storing the data? Or do drives wear down when data is deleted, added, deleted, added, moved, etc? I think it’s the latter but don’t want to assume. If it’s the former, it might be safe to save a backup onto a drive once and to store this for a long time—would it wear down the drive to e.g. read that data and/or copy it to another drive?

          • Comrade Birb
            link
            29 months ago

            Ah, sorry for the slow replies, I didn’t notice my inbox.

            Generally the second one, but it’s kinda both. Modern flash memory works by storing an electric charge in a memory cell and the number of writes per cell is limited. To make memory more dense (and thus cheaper), modern designs store multiple bits in one single cell (called MLC flash, usually TLC flash currently with three bits per cell). This means that changing a single bit usually leads to the whole cell being read and written again. All of this is abstracted away by the memory controllers on modern SSDs. In general the controller will handle stuff like defragmentation and wear leveling on the fly and none of this is transparent to the user. So in theory even a once written file could be moved to a different part of the memory chips when the controller sees fit. In general the controller tries to keep cell writes to a minimum and tries to spread them out evenly over the whole drive and when cells start failing there are usually spares that are not directly visible to the user (over-provisioning).

            The only thing you can really influence is the amount of “locked in” cells, aka how much of the SSD is filled up with data. As long as there is plenty of room to spread out writes, SSDs will last ages. But if you have a 120 GB filled with 119 GB of data and you write a couple of hundred MB a day… the controller will struggle to keep the overall drive healthy.

            So I’d say if it’s not some very heavy usage (like 24/7 writing server logs to disk on a production server) don’t worry about it. I’ve never had an SSD fail, I usually replace them with larger/newer ones before that point. I have an 128 GB SSD from 2011 that got used in my daily system for like 7 years in suboptimal conditions (drive was pretty full most of the time) that’s still perfectly healthy. Just buy a 1TB drive and forget about it.

            On the topic of backups: It’s always good to keep backups but SSDs are not the best medium for that. Traditional HDDs in some reduntant/resilient configuration like a RAID array are way better for that.