/, /home, boot, swap, ???, profit!
May 22, 2019 1:04 PM   Subscribe

Linux partitioning, distro selection, etc. Please help me beanplate my desktop computer.

Here's the hardware I've got:
  • Intel Core i5-6500
  • 32GB memory
  • 1TB M.2 NVMe SSD (this is new)
  • 500GB and 180GB SATA SSDs (these are old/currently in use)
I'm currently running Ubuntu 16.04, with separate partitions for boot, /, swap, and /home all on the 500GB SSD, and the 180GB SSD used for storing photos. I have about 60GB free on the larger drive and about 80GB free on the smaller drive.

I got the 1TB drive recently and I'm trying to figure out how best to arrange things. I definitely want separate partitions like I have now, but I also want to make space for system backups. (I currently back up everything important in /home to the cloud, so don't worry about that when answering the question.)

Relevant info: this is a production machine, I work from home as a software developer. I have to use linux of some sort. I prefer something Debian/Ubuntu-based because I'm familiar with it (specifically the package manager) and I need to get this up and running quickly, I can't have a lot of downtime while I figure stuff out.

Here are my specific questions:
  1. Partitioning: On the 1TB drive, I'm thinking 1-2GB for boot, 40GB for /, ?? for swap, and the rest for /home. I've heard to make your swap partition the same size as your RAM; I've also heard double. What are current recommendations for swap space?
  2. Distro/desktop environment: I like Ubuntu with Unity, but I strongly dislike GNOME, which is why I'm still on 16.04. I've played with Mint/Cinnamon and I like it pretty well; that's probably my default choice right now. Should I consider Ubuntu 18.04 (or 19.04) with a desktop environment other than GNOME? Some other Ubuntu derivative? Are there any downsides to Mint?
  3. Backups: what needs to be backed up, system-wise? (All data is backed up already, so not a concern.) I have all my config files version-controlled, so it's only a minor hassle to reinstall everything and get the system back up quickly if something goes really wrong. On the other hand, something like Apple's Time Machine to keep multiple backups would be handy in a pinch. (I used to have a cron job to back stuff up via rsync, but it was a bit too fussy to be useful.) What are the good backup tools these days?
  4. What to do with the two smaller SATA SSDs? I was planning to keep them around for extra storage/backups.
  5. Anything else that I should be considering?
posted by number9dream to Computers & Internet (16 answers total) 7 users marked this as a favorite
 
Hello! Welcome to 2019. A lot of advice on partitioning is from 1996, so it will take a bit of translation to modern hardware for much of it to make sense. So here's a quick rundown:
  1. In 1996, you partitioned your small drive even smaller to reduce the effects of damage to any one piece of your filesystem. You put up with the headaches of running out of space in /home while having plenty in /var by moving things around and telling yourself it was Importand and you Needed To Do It This Way. In actual fact, what most people were doing was re-creating a layout from an era when disks were even smaller: / on the systems BSD was developed for sometimes was on a higher-speed fixed-head disk: one track, 2MB, and just enough for the core OS with constant seek times. And the slower bigger data went on larger partitions mounted atop it. These days we use RAID and LVM and other tools to conjoin filesystems into one large happy set, and we encrypt them and do other nice things to them. The only exception to this is /boot, which often needs to be in an old-fashioned bare format so that all the pieces of the bootloader can find enough of your OS to boot properly.
  2. We also used to have precious little RAM. So little, in fact, that we reserved space on the slower disks to swap memory out when we weren't explicitly using it. These days, we do the opposite: we have gigabytes of RAM allocated to little more than caches of filesystem data blocks. So consider that perhaps you may not need swap at all. If you ever need it, you can make a swapfile of a size of your choosing, on your filesystem. "Won't that be slower?" I hear you ask? No, it's all just blocks on disk to a modern kernel. The fact that it's also reserved in your filesystem doesn't affect speed.
  3. Ubuntu 18.04 actually still supports unity, but you have to install it and switch to it from the login screen. It's not much different from the version in 16.04, and it's what I use daily right now.
  4. Mint may have improved lately, but for years they disabled actual security updates from Ubuntu upstream. I'd take care before stepping outside the Ubuntu/Kubuntu/Xubuntu/Lubuntu/etc flavours that are actively supported by the Ubuntu community. My 10yo runs GalliumOS on her chromebook, which is basically a Lubuntu hack, but it still gets upstream security support so it does all right.
  5. Your user data in /home is probably a vast archive compared to your OS, so why not just back the whole thing up? Also remember that backups are mis-named: they should be called restores. If you haven't tested restoring data, you do not have a backup!
  6. You could leave them in and add their extents to your LVM pool, or use them for whatever you want. But disks make poor backup storage media, so I'd be careful of thinking of them as backups.

posted by rum-soaked space hobo at 1:22 PM on May 22, 2019 [9 favorites]


honest question, my rum-soaked colleague, how do you test a restore?
posted by ivan ivanych samovar at 2:09 PM on May 22, 2019 [2 favorites]


I've been running ubuntu for about 5 years. I'm currently on Kubuntu 18.04 and Ubuntu MATE 19.04.

Swap on Linux is used for hibernation, a bit of safety for out-of-memory situations, and some marginal performance optimization. Most distributions these days have gone to a swap file rather than a separate swap partition, so you can add swap later if you need it. With 32G you probably don't need it for regular use, although some things like trying to parallel build Firefox or Webkit (I flirted with Gentoo) can be ram-hungry beasts.

I can't stand Gnome but have generally worked well with KDE Plasma and MATE as alternatives. I think Debian might be a good alternative if you want stability. MX Linux is a Frankendebian with a somewhat easier first-time install and a different init system, if you care about that sort of thing. Most stuff releases with Ubuntu LTS or Ubuntu current packages though.
posted by GenderNullPointerException at 2:15 PM on May 22, 2019


honest question, my rum-soaked colleague, how do you test a restore?

One really good way is to pretend that your main computer died, and see if you can get back to your regular "ready to work" state using your "restore" and a "new" computer (which can just be some random old box you have laying around in your closet). Do whatever you think you would do to get back to "ready to work," then log into your restored computer and see how much additional hassle you have to go through to really be ready to work. Also look to see what recent work you've done that's been lost on your new computer.

For extra credit, adjust your backup procedure to reduce the time you'll have to spend getting ready to go again, and the amount of recent work you lose in the process.
posted by spacewrench at 2:28 PM on May 22, 2019 [2 favorites]


I second fellow-spacer spacewrench's recommendation on how to test a restore. The only real metric is "how do i make this 'backup' useful to me again?"

this may be as simple as "man, I'll just reinstall Ubuntu and git clone my dotfiles back out of the archive" or it could be "I need to be able to write all this data to a fresh disk, update the bootloader, and reboot straight into a full copy of my entire computer." Other middle-grounds might be "I need to be able to reboot into this system as a docker image or other virtual image" or "I need to be able to copy most of /etc/ and /srv/ into place and get some services back. Horses for courses.
posted by rum-soaked space hobo at 2:37 PM on May 22, 2019 [2 favorites]


I would caution against having zero swap - having at least a couple of GB swap space means that if something suddenly decides to eat all available memory, your machine will become very slow as it spends time moving stuff in and out of swap, which is annoying but often better than starting to kill processes more or less at random, which it may well do otherwise. It also means that during normal operation, if any processes use up a bunch of memory which they subsequently don't access, the kernel will move those pages out to swap and use the RAM for something more useful.
posted by doop at 3:05 PM on May 22, 2019 [2 favorites]


My single-drive linux partitioning pattern is to set up two partitions sized to hold / and a third to serve as /home.

The twin / partitions let me dual-boot into different linuxes, which makes migrating to new OSes or versions easier ... especially nice when I'm running non-LTS versions.

I don't use a separate /boot partition and haven't missed it, though I understand why people might want to do that. But I also enjoy using Gnome so I am a weird outlier here.
posted by Sauce Trough at 3:55 PM on May 22, 2019 [1 favorite]


"how do you test a restore?"

This might be a bit out of touch, since I have 96GB total, but:

if you have a 1TB drive, partition it in halves and periodically restore the other half and switch to using that.

(Note: the other partition is not your backup. It's just the empty space into which you will test a restore by using it for the next six months. You're essentially doing blue/green deployment on a single physical drive in order to test your flip.)
posted by meaty shoe puppet at 7:20 PM on May 22, 2019 [1 favorite]


If you are using borg backup (and you should), those smaller drives may actually be good for a full backup for a good while. It’s amazing what de duplicating and high compression can do.

If it is of interest to you, consider using zfs. It makes the hourly snapshot backup and restore painless.

I’d go with boot partition, swap partition so you can switch between hibernation and encrypted swap on boot, and a big encrypted partition. On that partition lives LVM or Zfs. That works with the installer. Or go big and use native zfs encryption on selected volumes.
posted by unknown knowns at 8:31 PM on May 22, 2019


Also if you're frustrated with Gnome 3, you may enjoy the Unite extension
posted by rum-soaked space hobo at 1:17 AM on May 23, 2019


Looking at the thread, I'm rather astonished that people trust hibernation in Linux. I had written it off as unreliable years ago. Has it improved significantly?
posted by rum-soaked space hobo at 1:26 AM on May 23, 2019 [1 favorite]


As far as safety for out-of-memory situations, I'd rather have my systems kill processes than swap, but maybe that's just the SysAdmin in me. Once you start swapping, it's pretty much all over for performance for the next hour. Fail early, I say.
posted by rum-soaked space hobo at 1:29 AM on May 23, 2019


rum-soaked space hobo: Mint may have improved lately, but for years they disabled actual security updates from Ubuntu upstream.

That is putting it a bit strongly. Mint used to have three different levels for accepting updates, one of which accepted all updates much like Ubuntu does; the other two did not show some of the high-impact updates. So it was always possible to opt into getting all security updates from upstream.

The update system has changed, and Mint now encourages users to see and accept all updates. The level system is still present but not used by default, or rather the default setting is the one that shows and installs all updates.
posted by Too-Ticky at 2:17 AM on May 23, 2019 [2 favorites]


/boot partitions are used by some distributions to handle UEFI and also for things like full-disk encryption and advanced volume support.

Once you start swapping, it's pretty much all over for performance for the next hour.

That's not necessarily the case for recent kernels and desktop environments, which preemptively use swap to make space for higher-priority memory and disk cache. It's not really noticeable when this happens. Generally speaking, swap is good for predictable and temporary high memory loads (data analysis or complex software builds). The OOM Killer is better if you're dealing with memory leaks.
posted by GenderNullPointerException at 6:08 AM on May 23, 2019 [1 favorite]


Although 32GB RAM is a pretty good case for a no-swap system.
posted by GenderNullPointerException at 6:12 AM on May 23, 2019 [2 favorites]


Looking at the thread, I'm rather astonished that people trust hibernation in Linux. I had written it off as unreliable years ago. Has it improved significantly?

Two answers to this - yes, and it depends. On hardware that's well-tested and compliant with the relevant standards, I've found hibernation / sleep on to be fine. I run Fedora or Red Hat Enterprise Linux, not Ubuntu or an Ubuntu variant. The RHEL laptop I have from work (I work for Red Hat) is a supported model with a standard build supplied by our IT department. I have used Fedora or RHEL on various models of ThinkPad taking the laptop to / from work and docking/undocking it a few times a day for weeks without any problems.

My personal laptop is an X1 Carbon Thinkpad running various Fedora releases. Again, works fine - it's probably failed to come back from hibernation / sleep two or three times a year. This machine gets moved from room to room in my house and put to sleep regularly.

My thoughts on the OP's questions:

1) Make swap the same size as your RAM. Don't overthink it, you should have some swap, 2x RAM is not really necessary these days. The rest of your partitioning scheme sounds fine - unless you're doing something like using a lot of VMs or docker images that would be stored somewhere under / instead of under your /home directory. In that case, I'd probably allocate more like 120-200GB to / for that.

2) Since you prefer Debian-type Linuxes, I won't try to dissuade you. If I weren't using Fedora or RHEL, I'd go with Linux Mint. I prefer Cinnamon to GNOME and can't stand Unity. I have made my peace with GNOME, mostly.

3) I rsync my important files under /home to external drives. Drives plural, including a home NAS. My "restore" method is basically to do a clean install and restore my /home directory. (I exclude things from rsync like ~/.cache which gobbles up an astounding 8.4GB on my machine, currently.)

4) Maybe get an external enclosure or a SATA to USB adapter and use them for short term backups or such. Presumably you've been using these drives for some time already, possibly years? If so, their best years are behind them and I wouldn't recommend using them for anything "mission critical." But if you're already backing up to the cloud regularly, no harm in keeping them in the machine and syncing /home to the 500GB as the closest "crap, I deleted something I shouldn't have" option.

5) Not off the top of my head.
posted by jzb at 6:47 AM on May 23, 2019


« Older Best, effective, SAFE flea treatments for dogs and...   |   What does PowerShare mean in the context of a Dell... Newer »
This thread is closed to new comments.