Post-install: when to reboot?

Hello,

Immediately after the installation and before launching the ansible script to customize my machine, I execute the commands underneath. This basically installs the nvidia driver, install the CPU patches and configures BTRFS. I currently do three reboots, after each block.
Would it be safe to do just one reboot at the end?

Thanks.

***** Install nvidia-driver *****
nvidia-inst
sudo reboot
*****  install CPU patch *****
sudo pacman -S intel-ucode
sudo reboot
***** configure BTRFS *****
yay -S snapper-support btrfs-assistant
sudo snapper -c root create-config /
sudo snapper -c home create-config /home
sudo snapper list-configs
sudo snapper -c root set-config ALLOW_USERS=$USER SYNC_ACL=yes
sudo snapper -c home set-config ALLOW_USERS=$USER SYNC_ACL=yes
echo 'PRUNENAMES = ".snapshots"' | sudo tee -a /etc/updatedb.conf
sudo mkdir -v /.snapshots/1
sudo bash -c "cat > /.snapshots/1/info.xml" <<EOF
<?xml version="1.0"?>
<snapshot>
  <type>single</type>
  <num>1</num>
  <date>$(date -u +"%F %T")</date>
  <description>Initial Snapshot Root Subvolume</description>
</snapshot>
EOF

sudo mkdir -v /home/.snapshots/1
sudo bash -c "cat > /home/.snapshots/1/info.xml" <<EOF
<?xml version="1.0"?>
<snapshot>
  <type>single</type>
  <num>1</num>
  <date>$(date -u +"%F %T")</date>
  <description>Initial snapshot Home subvolume</description>
</snapshot>
EOF

sudo btrfs subvolume snapshot / /.snapshots/1/snapshot
sudo btrfs subvolume snapshot /home /home/.snapshots/1/snapshot

SNAP_1_ID="$(sudo btrfs inspect-internal rootid /.snapshots/1/snapshot)"

echo ${SNAP_1_ID}

sudo btrfs subvolume set-default ${SNAP_1_ID} /

sudo btrfs subvolume get-default /
sudo reboot

Yes, it would.

There is nothing there that I see that needs an immediate reboot.

That being said, why are you simulating a Snapper snapshot? Why not just use snapper to make an initial snapshot?

1 Like

Hello,

Thanks for you help. I do this to create a predictable config I can restore to when something goes wrong in Ansible. As you can see, the snapshot shows up in Snapper and it is very ease to bring the system back to rollout state. I’m new to EndeavourOS and finetuning the Ansible playbooks from Fedora takes some time.

George

You could replace all this with(not tested):

snapper create -t single -d "Initial Snapshot Root Subvolume"
snapper -c home create -t single -d "Initial Snapshot Home Subvolume"

don’t overthink it, also you do not have to reboot after individual installations, just install everything, run all ur scripts, then reboot once.