Optimising Stability

On an OS like Arch/EndeavourOS, it is the user error that is the biggest source of system instability.

In every case of my Arch or EndeavourOS systems breaking, it was my fault, 100% of time. I was careless and stupid and did something that broke my system (this is not the case with 'buntu, though). I have yet to experience a major OS breakage on Arch which wasn’t my fault, in the sense that I had no way of seeing it coming and couldn’t have prevented it by being less stupid.

So, the most general advice I have for system stability on Arch/EndeavourOS is: don’t be careless and stupid.

I know this is not very specific, so here are a few specific points (not an exhaustive list):

  1. Back up all important data. Verify that backups work, keep duplicate backups, keep backups on external media. Not doing so is the pinnacle of stupid.
  2. Don’t just copy-paste terminal commands from the internet not knowing what they do (that’s really stupid, almost as stupid as not having a backup).
  3. Whenever you type the word sudo into the terminal, let this be a cue for you to think twice about what you’re about to do. The three questions to ask yourself are: “What am I trying to do?”, “What am I actually doing?”, and “Why am I using sudo to do this?”.
  4. Never use sudo with GUI applications. Never use sudo with software-specific package managers like pip, gem, npm… (on most distros you can do this, but on Arch this will cause you trouble). Never use sudo with wine (this is incredibly stupid!). Never do sudo bash or sudo zsh. Avoid using sudo su (except on a live image). Do not login as your root user in an interactive shell (unless your system is utterly broken and you know exactly what you’re doing).
  5. In general, never use sudo when you can do the same task without sudo.
  6. When you are in doubt, ask on the forum. Even asking a stupid question is less stupid than not asking it and doing a stupid thing. Read the forum topics about other people having problems and what the solutions are. Smart people learn from the mistakes of others.
  7. Protect your cp, mv and rm commands with the -i flag in your .bashrc:
    alias cp="cp -i"
    alias mv="mv -i"
    alias rm="rm -i"
    
    This will require you to confirm with y every time you’re about overwrite or delete a file. When you have a lot of files to delete, you can override this with the -f flag manually (which also forces you to think about what you’re about to do). Also consider turning off redirection clobbering:
    set -o noclobber
    
    In my specific case, this has prevented about 90% of all my terminal accidents due to carelessness.
  8. Before doing something you don’t have a lot of experience with, think about it and plan it. Know what you want to do and how to do it in advance. Take the time to read the manpages and/or ArchWiki, whenever you’re about to enter uncharted territory.
  9. On the flip side, whenever you’re doing routine system maintenance and things you’re very comfortable doing and have a lot of experience with, resist the urge to be on autopilot. Do your best to pay attention to what’s going on. When updating your system, do not walk away from the keyboard. Never ignore error messages and warnings.
  10. Don’t use a GUI package manager (that’s stupid).
  11. Do not use the power and reset switches on your computer case to reboot your computer, even if it is completely frozen. Learn about the magic SysRq key. This will prevent filesystem corruptions due to hard reset.
5 Likes