Sunday, May 23, 2021

To clone or not to clone

I was asked this week if I clone SD cards or not. The short answer is no. I'll explain what I do.

My usual process is to write an SD card with Raspberry Pi OS (64 bit) from the official image downloaded from the Raspberry Pi foundation website.

Once the Pi has booted up for the 2nd time I run raspi-config, change the password, give it a new host name, set the language, set the location and reduce the GPU memory to the minimum of 16MB and reboot.

Once it comes back and I have logged in again I mount a NFS share. My NFS server is simply a Pi4 2GB with an external hard disk. I have some config files that I copy. The official 64 bit image is a little old so update it:

sudo apt update
sudo apt upgrade -y

At this point it has taken maybe 5 minutes. Next I install BOINC, a firewall and ntp on it. If you copy the account files into the BOINC data directory the next time BOINC starts it will automatically attach to each project. If its a reinstall the project server works out its seen this computer before and will give you the previous host id. 

On the NFS server I have the following BOINC files:

account_boinc.bakerlab.org_rosetta.xml
account_einstein.phys.uwm.edu.xml
cc_config.xml
database_357d5d93529_n_methyl.zip
einstein_64bit_0.13.tar
global_prefs_override.xml
remote_hosts.cfg
rosetta_4.20_aarch64-unknown-linux-gnu

The einstein_64bit_0.13.tar is an archive file containing the optimized Einstein app for ARM64. Einstein don't have an official ARM64 app.

The database_357d5d93529_n_methyl.zip and rosetta_4.20_aarch64-unknown-linux-gnu are the Rosetta@home database and project app. The database is 485MB and the app is 133MB, so this saves having to download them each time I setup or reinstall a Pi4. When the first Rosetta work unit runs it will unpack the database.

In about 7 or 8 minutes I can get a Pi going with fairly minimal effort and more importantly not get the host id's mixed up which can often happen when cloning from another Pi's SD card. I don't even bother backing up the compute nodes because its so easy to re-image an SD card and reinstall. It also allows for some customizing. For example the Pi3's can't run Rosetta (due to the memory required) so I simply don't copy the Rosetta files to them.

I posted about how to setup an NFS server on a Pi back in 2016 here as part of setting up a beowulf cluster. Its probably about time I posted a new one although the instructions haven't changed.


1 comment:

mikey said...

I love it thanks! That does make alot more sense than cloning does and adding the account files is ALOT faster than manually attaching to each and every project manually.