From b8c0c18ebf1eb38a9e8eb96474f8db02a6fddc6f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 4 Oct 2023 10:58:05 +0200 Subject: Fixed omission in last article --- content/blog/nix/installing-nixos-on-a-vps.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/blog/nix/installing-nixos-on-a-vps.md b/content/blog/nix/installing-nixos-on-a-vps.md index 7948f31..7350fc1 100644 --- a/content/blog/nix/installing-nixos-on-a-vps.md +++ b/content/blog/nix/installing-nixos-on-a-vps.md @@ -24,6 +24,7 @@ Install your vps or compute instance normally using a Linux distribution (or any We are going to remount the partitions as the running OS as read only. In order to do that, we are going to shutdown nearly everything! If at some point you lose access to your system, just force reboot it and try again. Our goal is for those commands to run without an error: ```sh +swapoff -a mount -o remount,ro /boot mount -o remount,ro / ``` @@ -37,7 +38,13 @@ On most Linux you can list running services using `systemctl|grep running` and b - session-XX - user@0 (root) and any user@XX where XX is the uid you connected with -Everything else should be fair game, here is a list of what I shutdown on an oracle cloud compute before I could remount / read only: +Everything else should be fair game, what you are looking for are processus that keep files opened for writing. Those can be identified with: +- `lsof / | awk '$4 ~ /[0-9].*w/'` +- `fuser -v -m /` +- `ps aux` +- `systemctl|grep running` + +Here is a list of what I shutdown on an oracle cloud compute before I could remount / read only: ```sh systemctl stop smartd systemctl stop rpcbind @@ -77,6 +84,7 @@ systemctl stop serial-getty@ttyS0.service Remember, your success condition is to be able to run this without errors: ```sh +swapoff -a mount -o remount,ro /boot mount -o remount,ro / ``` -- cgit v1.2.3