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?
- 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.
- 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.
- You can share swap partitions without any issue since swap is usually wiped/overwritten on boot.
- 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.
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?
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.
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?
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.
I would recommend you using a separate drive for each OS. If you want to test several distros, better to use virtual machines.
Ideally, swap should go on the fastest storage you have. Also ideally, you want to have enough memory that you never need to swap anyway. If you have enough ram, you don’t really need swap at all.
You can definitely share swap partitions between dual booted OSes. You can even share home directories if you wanted.
No obvious additional risks that I can think of.
If you have enough ram, you don’t really need swap at all.
This isn’t really true. Swap is important for things other than acting as a memory reserve. Even if it was only used that way, it can still improve performance by paging out unused memory (such as from application startup that then isn’t used).
There are other benefits too. This link goes into details.
I’ve seen and read that before, and while I don’t have any hard data, anecdotally, my machine with 64GB ram does not have a swap file or partition and runs just fine. I have had similar results on a 32GB laptop.
The link doesn’t really go into any specific real world use cases where swap is critical, and mostly discusses the memory contention issues. Still, worth a read for anything thinking about turning swap on or off.
I don’t think the point is that swap is critical. Whether that is true will depend on your workload and hardware. But the point is it makes memory management better and more efficient. Whether you notice a difference in performance or not is again dependent on your workload & hardware. I personally see no reason to not dedicate a couple gigs to swap even with lots of memory on a personal system.
Yeah, that’s fair. I have always had fairly limited storage, due to dual booting, so wasting space on swap always felt pointless. I guess it’s a bit arbitrary :D
womp womp :)
I second all the SSD recommendations but I’d also like to point out that if you’re using one of the more heavy desktops like GNOME, they’ll probably still freeze if you go over your 16GB. Swap is still very useful, but don’t make the same mistake that I made with going for an SSD with only 4GB of RAM. Linux is usually very lightweight so you’re likely not going past 16GB unless you’re doing some severe data processing though.
Are there any additional security/privacy risks of installing more than one distro on the same SSD card?
I wouldn’t say that there are more risks, just that now you have all the risks of all installations in a single machine at the same time. If any OS becomes compromised it’ll have access to every other partition unless they’re properly encrypted (and even then encryption is not bulletproof, since they can either brute-force or just install a keylogger and wait). That also extends to having installations on a different device that is connected, so installing one on the HDD and one on the SSD would not solve it unless you physically disconnect them.
But unless you’re executing unknown binaries or forgetting security updates I don’t think it would be much more problematic. I think it’s basically as risky as just having two different machines on a single network, which is very little compared to running Windows ever.
This is helpful, thanks.
Out of interest, do you know if it’s possible to run two or more storage drives on a single machine that are controlled by a manual switch? So that neither drive can read the other(s) because the manual switch only ever allows one drive to connect to the mother board at any one time? One option would be to physically swap the connected drive but those slots aren’t built for frequent changes; surely someone’s thought of an easier way? This is pure curiosity unless it’s possible and cheap/easy.
You definitely can’t do it with a NVME/PCI Express SSD because it gets slotted within the board, but technically I think something is possible with a SATA HDD. I have never seen anything like this and I bet it would have some risks of damaging the HDDs if misused. You’d still be having to open the PC and fumble with cables and I don’t think it’d that much better, since SATA cables are very cheap. If you do get 2 or more SATA HDDs, I think you could just disconnect the power only from the HDD and just switch them that way.
Though what I actually recommend you do in case you want to do something like that is to get a couple of cheap USB drives (possibly even the “portable hdd/ssd” types that go up to 500GB but depends on your intent) and install your other OS’s in those. They are on par in speed with a modern HDD and will be less of a hassle if you want to keep some of them having separate physical access to the rest. They also have the extra benefit of being easy to use in different machines if needed. Just remember to encrypt their root partition in case they have sensitive data since they’re also easier to steal.
P.S. I just remembered I had a lot of trouble when trying to figure out which SSDs are compatible with my board because store sites are not very consistent, and it wouldn’t hurt to warn. Be sure to check the device interface before you buy.
Here is an alternative Piped link(s): https://piped.video/watch?v=s-2VrxgI49Q
Piped is a privacy-respecting open-source alternative frontend to YouTube.
I’m open-source, check me out at GitHub.
If you have a reasonable amount of RAM, you don’t even need swap, but it depends on what you need. If you do need it, it should be on your fastest drive, but it doesn’t need to be large, even something like 2 GB can be enough. You can share swap between OSes that shouldn’t be an issue, you will just to manually configure it with each one.
Also, as someone already said it might be a good idea, if you want to try multiple distros to share your home folder between OSes it should make things easier for you and save some space as well. Overall, 256 GB if you want to install multiple distros is pretty small, but it depends on what you install/what distro it is. Remember to partition your drive well, it is annoying to have to resize your disk partitions with data on it.
Thanks for the advice!
Absolutely go with SSD. As others have said, the price premium between a tiny 128 gig ssd and even a 1 tb ssd is comparatively tiny these days so I’d recommend going with at least 500 gigs. A m.2 PCIe ssd (i.e. small and flat) is also much faster than a 2.5’ SATA (large and boxy) ssd and the price premium is negligible these days, but make sure your motherboard has an m.2 slot - most recent cpu platforms should have one.
If you live in a country where websites such as Amazon deliver, I would recommend going to PCPartpickers and sorting through the options by price/gig (here is an example of my parameters – https://pcpartpicker.com/products/internal-hard-drive/#t=0&sort=ppgb&page=1).
At time of writing the best priced SSD seems to be the M450 1 tb for 25 USD, which is a ridiculous sale that I would personally jump on. (it is an m.2 so see above note).
Hard drives are only really good for cheap mass storage (e.g. if you have literal mountains of photoshop projects) and servers these days (e.g. those 6 or 14 tb disks from seagate), or if you’re building a computer out of literal trash with scavenged hard drives in which case i would refrain from saving anything important on them.
Handy website! $65 for 2tb m.2 SSD – prices have got a lot cheaper since the last time I built a PC. Are there any brands that you would advise to avoid?
As for the m.2 slot, would you advise that I start with the best motherboard within my budget and build up from there?
I don’t have mountains of data. Mostly I work with texts. I’ve made do with 128GB (plus a USB as a backup) for about five years now. It’s been a pain at times but I think 150GB would do me. Considering the price nowadays, I’ll likely go for a TB, maybe split on separate drives, using one as an internal data back up. Any reason why that’s a terrible idea? I’ve heard that HDD might last longer, so might be a better option than an SSD for an internal backup. Would you agree?
Even though there are lots of vendors, most SSD components are sourced from just a few companies: the NAND is from SK Hynix/Micron etc., and the controller is from Silicon Motion/Phison etc. Some of the larger vendors (Intel, Samsung, Crucial, Hynix, WD) produce their components in-house and are also more reputable, but the actual differences most of the time are minuscule. I would recommend purchasing from one of those vendors, but at lower price points (e.g. Intel’s 670p or Crucial’s P3) they often use cheaper QLC NAND which throttle the sustained write speeds when copying lots of files, and also have lower endurance. Laptop users generally don’t have a problem with these if all they need is snappy-enough everyday use, but professional users (e.g. copying tons of photos) might lose time or reliability depending on their use case. If I’m penny-clinching, I would recommend picking out the cheapest drives with the characteristics you desire (e.g. pcie generation and capacity), then doing your research as to componentry. If I wasn’t trying to save every last penny right now, I would probably get the Crucial P5 Plus 1TB because it’s from a reputable brand and a noticeable improvement over cheaper drives ($49). At higher capacities, I’d be more inclined to simply get the best of the best considering how cheap the (gen 4) prices are right now, or at least close to it such as with the samsung 980 pro 2TB.
For motherboards, having an m.2 slot is probably not an issue if you’re buying new. my advice would be to pick a chipset that supports the cpu you want (e.g. z790/b760 for intel’s latest, x670/b650 for am5), then sort by price while looking for the other qualities you might want first (e.g. overclocking, xmp, onboard wifi, networking, decent onboard audio). speaking of motherboards, what cpu do you think you’ll get?
I’m not qualified to speak on redundancy or backups.