SARPi Project - Slacking on a Raspberry Pi


Choosing a suitable storage device

In order to boot the Raspberry Pi you need to prepare a suitable storage device. This guide covers preparation of a microSD card or SSD for Linux, Windows, and macOS users. Size matters in this instance, and a 32GB microSD card is advised to complete a full installation of Slackware Linux which will leave you with a modest amount of free space to work with. Slackware Linux requires approx. 14GB of storage space for a full installation and there's the swap and boot partitions to conider too. So, adequate available storage space is of primary importance when using a microSD card. The type of microSD card you may use is also important because cards vary greatly in performance. For example, a class 10 UHS-II U3 v90 microSD card will be much faster at reading and writing than a standard class 10 card. Therefore, with a faster microSD card the time it takes for you to run a program or complete an installation will be much shorter. Be aware that "The faster a microSD card is, the better it is!" does not always apply.

The same can be said for SSD devices. Although this is much less apparent on Raspberry Pi devices due to the data transfer speeds they operate at. An older SSD will still offer great speed and throughput. More recent SSD devices are far more capable speed-wise than Raspberry Pi device thresholds.

Throughout this SARPi installation guide there are only references to 'microSD cards' and not full size 'SD cards'. Although it's more than possible to read/write and configure a microSD card using a full size SD card adapter. Only the Raspberry Pi (1) - and not the +plus version - can use full size SD cards. The rest of the Raspberry Pi range uses microSD cards.

SARPi Project muse views ... We will be using a Slackware AArch64 Linux operating system installed on a Raspberry Pi 5 [8GB RAM] to prepare storage devices in this guide.

For a solid state drives [SSD], whatever SSD you have laying around or can buy that's affordable will suffice. There are a multitude of possibilities for connecting it to a Raspberry Pi computer. The best solution on how to do this is entirely up to you.

For microSD cards, at SARPi Project we have found the Kingston Canvas Go! Plus - SDCG3 UHS-I, U3, V30, A2 range to be very reasonably priced and 100% trouble-free while running Slackware Linux on the Raspberry Pi. They are totally reliable and extremely quick at reading and writing data, out-performing many other microSD cards from PNY, Sandisk, Samsung, etc. We've been using these specific Kingston SDCG3 microSD cards for years at the SARPi Project and not one of them has failed, thus far. The benefit of microSD cards is that they are usually smaller capacity than SSDs and easier to manage, backup, and swap/replace for testing (etc.), but the drawbacks are that they have a vastly reduced lifespan than SSDs and their longevity is finite. We've certainly had a few microSD cards fail on us in times gone by but they were all from the cheaper end of the market. Rest assured, when quality and reliability is a factor, and pay that little bit extra.

Quick links for Linux users

Configure a SSD to install Slackware Linux
Manually creating storage device /boot partitions
 ◦ Formatting the boot partition and writing boot files
 ◦ Writing boot files to the /boot partition
Prepare a microSD card or USB drive by flashing a SARPi installer image

Quick links for other OS users

Windows and macOS users click here for instructions
macOS users can also click here ...

Configure a microSD card to install Slackware Linux

Connect the SSD storage device to your Linux system. How you do this is entirely up to you. When connecting the SSD via a USB port the device name will be something like '/dev/sdX' - where sdX can be sda, sdb, sdc, etc. depending on your setup. Make sure you are logged in as, or elevated to, 'root' user at this stage.

Type 'fdisk -l' at the command prompt:

root@iana:~# fdisk -l

This will output a list of all storage devices available on your system. Hopefully it includes your SSD storage device. See our screenshot below as an example.

fdisk-l

In the above screenshot we can see that our SSD has been detected as '/dev/nvme0n1' and not '/dev/sdX'. This is because on our Raspberry Pi 5 the SSD is connected through the PCIe interface (via a NVMe Base by Pimoroni) and not plugged in to a USB port. If the SSD is connected to a USB port via an adapter then you can expect to see it detected as '/dev/sdX', etc. So, in our example we know that the SSD is shown, along with our microSD card which we booted from, and all the partitions they contain.

You'll notice that our SSD is a "KIOXIA-EXCERIA G2 SSD" and is approx. 1TB capacity. We chose this particular SSD because it was perfect for our needs and very cheap to buy, compared to other available alternatives. We have already created partitions on our SSD in preparation for what's to come.

SARPi Project muse views ... One significant point is, you'll also notice that the SSD is 'Disklabel type: gpt' and not 'Disklabel type: msdos'. The "disk type" may be something that many people are not aware of but is very much worth noting for future reference: All Raspberry Pi computers support a 'msdos' disk type, but only the Raspberry Pi 4 and Raspberry Pi 5 support a 'gpt' disk type and Raspberry Pi computers up to the Raspberry Pi 3B+ will refuse to boot if the disk type is not 'msdos' when using the official Raspberry Pi bootloader firmware. It may be different if using the U-Boot universal bootloader but the SARPi Project only uses the official Raspberry Pi bootloader firmware so it's not a topic that will be addressed in this guide.

Once the SSD has been detected and can be ssen on the system the next step is to create partitions and make the device bootable.

Manually creating storage device /boot partitions

When creating partitions there are various options available. To keep things simple, and not to obfuscate matters, using the TUI (text user interface) based tools 'cfdisk' and 'cgdisk' is easiest for most users. So that's what will be covered in this guide. For Disklabel type: 'msdos' use 'cfdisk'. For Disklabel type: 'gpt' use 'cgdisk'. The safest and assured success choice is Disklabel type: 'msdos' for reasons stated above on this page. If you're installing on a Raspberry Pi 4 or Raspberry Pi 5 then choosing Disklabel type: 'gpt' is an option and the one we'll be using in this guide.

Whether you're using a microSD card or SSD as a storage device, setting up partitions is applicable to both mediums. There are no fundamental differences in doing this.

The TUI based tools 'cfdisk' and 'cgdisk' are mostly the same in operation and make it quite effortless to create, delete, modify, and save partition table entires. No matter which method is used for this process it's basically identical. So, according to your chosen disk type, type 'cfdisk' or 'cgdisk' followed by your SSD device name at the command prompt:

root@iana:~# cgdisk /dev/nvme0n1

If you are setting up a new SSD there will be no existing partitions on it. If you are re-configuring an existing SSD containing partitions, remove them all by highlighting each partition and selecting [ Delete ] in the menu, or you can just press the 'D' key. Do this until all existing partitions have been removed. You should see a screen resembling something similar to the following screenshot:

cgdisk

Now you need to create a /boot partition. Move the highlight to It's advised to [ New ] and just press the key to accept the first sector. When asked for the size in sectors type '200MiB' to make this partition 200MiB in size. If you're using 'cfdisk' select [ Type ] (or press the 'T' key) and scroll up the list to 'b W95 FAT32' and hit the key to set this partition type to a FAT partition. If you're using 'cgdisk' then enter '0700' to set this as a 'Microsoft basic data' partition. When asked for a partition name just hit the key to skip this.

While you're in this interface it's a good idea to create the swap and root partitions at the same time. You do this in exactly the same way as creating the boot partition, but selecting a different type to identify them.

The size of the swap partition is generally down to personal preference but it's always a rule of thumb to make it around twice the size as the amount of RAM on the system. This not written in stone and larger or smaller swp file partitions may benefit or hamper the performance of your system, depending on how you're using it. For our requirements we'll be sticking to the norm and creating a swap partition of 16GB which is twice the size of our 8GB RAM on the Raspberry Pi 5.

So move the higlight down to 'free space' and select [ New ] on the menu and hit the key. Accept the first sector setting and hit the key. When asked for size in sectors make it double the saize of your total RAM, unless you have a reason to change that. Remember that 'GB' are not the same as 'GiB' and it's highly advised to stick with 'GiB' to eliminate any confusion, but not absolutely essential. In 'cfdisk' move the highlight to [ Type ] and hit the key then select "Linux swap" and hit the key once more. In 'cgdisk' when asked for partition type enter '8200' and hit the key. When asked for a partition name just hit the key to skip this. Now you should have a Limux swap partition listed underneath the 200MiB boot partition you created first.

To create a root partition do exactly the same as before, except use the remaining free space on the storage device. You do not need to enter a size or partition type. Just hit the key to accept the defaults. This is the same for 'cfdisk' and 'cgdisk'.

You should end up with something similar to the following screenshot:

cgdisk

In addition to the partitions that have been created, there's also free space at the start and end of the partition table. This is excepted and nothing to be concerned with. Just leave it as it is if you see the same.

The next thing to do is to write the partition table to the disk. This is done by highlighting [ Write ] and hitting the key, or by just pressing the 'W' key. Now type the word 'yes' and hit the key to write the partition table to the disk. This can be seen in the following screenshot:

cgdisk

Once that has been done, highlight [ Quit ] and hit the key, or hit the 'Q' key, to exit the 'cfdisk' or 'cgdisk' interface. This will put you back at the command prompt.

So far you've created blank partitions that contain no filesystems. Basically, /boot is the only partition that needs formatting. The swap and root partitions will be formatted at a later stage, during the Slackware 'setup' procedure. All the partitions could be formatted at this point but there's no real benefit in doing so.

Formatting the boot partition and writing boot files

You should format the /boot partition with a vfat filesystem. This is required in order for the Raspberry Pi to boot using the official bootloader firmware. So, first check to see which device name your /boot partition has using the 'lsblk' command.

root@iana:~# lsblk

This will display the results of detected storage devices and their partitions on your system. The following screenshot shows the results of using this command on our system:

cgdisk

From these results, we know that 'mmcblk0' is our microSD card storage device, and 'nvme0n1' is our SSD storage device. Therefore, we now know that our /boot partition is identified as '/dev/nvme0n1p1' on our SSD - it's within the tree of our SSD and 200M in size. So, '/dev/nvme0n1p1' cannot be anything else than our /boot partition. You can do the same on your system to work out which is your /boot partition.

To format the /boot partition with a vfat filesystem you will use the 'mkfs.vfat' command. Like this:

root@iana:~# mkfs.vfat -I -F 32 /dev/nvme0n1p1

This will format the /boot partition and prepare it for accepting data to be written to it and read from it. The '-I' option in this command means "Ignore and disable safety checks". The '-F 32' option means "Use a 32-bit File allocation table".

Writing boot files to the /boot partition

With the /boot partition formatted with a vfat filesystem, it's now possible to write data to it and read data from it. In order for this storage device to be made bootable it needs an appropriate kernel, bootloader and config files writing to it. This will be done by downloading an existing SARPi .zip archive containing these files. The file you download will be specific to the Raspberry Pi version you are using which is available from the SARPi downloads section. For our setup this will be the sarpi5_64-installer-boot_slackcurrent_28Feb24_sp1.zip archive for the Raspberry Pi 5.

SARPi Project muse views ... Please Note:
• For the purpose of this guide we will be installing Slackware AArch64 current on a Raspberry Pi 5.
• When installing a different version of Slackware Linux you will not be using the same installer image. Also, you may not be installing on a Raspberry Pi 5. The filenames of the SARPi installer images are slightly different, so make sure you have the right one.
• When writing these boot files the procedure is identiical no matter which SARPi installer image is used.
• Therefore, bear in mind throughout this guide that filenames and screenshots and your own results may vary slightly from those shown.

First download the appropriate SARPi installer-boot .zip file archive:

root@iana:~# wget https://slackware.uk/sarpi/rpi5/current-armv8/img/sarpi5_64-installer-boot_slackcurrent_03May24_sp1.zip

Once this file has downloaded, you need to mount the /boot partition. This can be done easily, you just need a mount point for the disk partition:

root@iana:~# mount /dev/mmcblk0p1 /mnt/floppy

When the /boot partition has been mounted, you can then write the downloaded .zip archive files to it:

root@iana:~# unzip sarpi5_64-installer-boot_slackcurrent_29Feb24_sp1.zip -d /mnt/floppy/

This will write the .zip archive files to the /boot partition that's mounted in the /mnt/floppy directory.

SARPi Project muse views ... The '-d' option of the 'unzip' command tells it to unpack the archive into a different folder than the one it's currently located in. With our /boot partition being mounted in '/mnt/floppy' this is where we unpacked the files to.

You can check the files were written to the /boot directory using the 'ls' command:

cgdisk

And there they all are, as expected.

The last thing to do is unmount the /boot partition from its mount point:

root@iana:~# umount /mnt/floppy/

That completes writing boot files to the /boot partition. You can now go to the next page in this guide - Download Slackware Linux source media. [optional]

If you're planning to use a FTP/HTTP server for your Slackware source you can go to the Notes for Pre-installation page.

Prepare a microSD card or USB drive by flashing a SARPi installer image

SARPi Project muse views ... NB: The instructions and processes involved of preparing a microSD card and USB drive are exactly the same.

To prepare a microSD card as 'root' user. If you are using another Linux distribution the command structure may be a little different (e.g. using 'sudo' before a command on most Debian-like systems when not 'root' user). We are using a 64GB microSD card (a Kingston Canvas Go! Plus - SDCG3 UHS-I, U3, V30, A2 because it's fast and reliable). Using larger capacity microSD cards works too! You might struggle using 8/16GB microSD cards as a full install requires just over 14GB of storage capacity, so you will have to omit some packages during the install process. Of course, it's still possible to install Slackware Linux on a 8/16GB microSD card and experienced Slackware users will already know what to do under these circumstances. If you're installing Slackware Linux for the first time, it's recommended you go for a full installation on an 32GB (or larger) microSD card.

So, assuming you have, at least, a 32GB microSD card, here's what you need to do:
• put the microSD card into the card reader of your Linux system
• make sure you're logged in as, or elevated to, root user
• at the command prompt type the following command:

root@iana:~# fdisk -l

This will give you details of all the drives currently connected to your system. You're looking for the microSD card device you've just plugged in. On our system we received the following information:

fdisk

So we now know that our microSD card is device /dev/sda on the system. That's the important bit. We can also see there are no partitions or filesystems on the microSD card. It's blank. Yours may contain existing partitions, filesystems, and data.

!!! IMPORTANT !!! : Be sure you do not use a microSD card that contains any data you want to keep because this process will overwrite everything on it!

Now you'll need to download a SARPi installer image file to write to your microSD card. These installers are optimised for the Raspberry Pis and were built using a modified Slackware Linux initial RAM disk and boot-firmware from the official Raspberry Pi GitHub repository. The SARPi installers support all available versions of Slackware Linux on ARM architecture. All available SARPi installer images are located in the Downloads section.

NB: At this stage, you should only download and use the SARPi installer version which specifically matches your Raspberry Pi single board computer.

SARPi Project muse views ... Please Note:
• For the purpose of this guide we will be installing Slackware AArch64 current on a Raspberry Pi 5.
• When installing a different version of Slackware Linux you will not be using the same installer image. Also, you may not be installing on a Raspberry Pi 5. The filenames of the SARPi installer images are slightly different, so make sure you have the right one.
• When flashing a disk image the procedure is identical no matter which SARPi installer image is used.
• Therefore, bear in mind throughout this guide that filenames and screenshots and your own results may vary slightly from those shown.

Before downloading a SARPi installer image, you are going to change to the /tmp directory. At the command prompt type the following:

root@iana:~# cd /tmp/
root@iana:~# wget https://slackware.uk/sarpi/rpi5/current-armv8/img/sarpi5_64-installer_slackcurrent_03May24_sp1.img.xz

SARPi Project muse views ... You may also want to verify the integrity of the installer image file using the md5 checksum. If so, type the following:

root@iana:/tmp# wget https://slackware.uk/sarpi/rpi5/current-armv8/img/sarpi5_64-installer_slackcurrent_03May24_sp1.img.md5

So you should now have the SARPi installer image file in the /tmp directory on your system. You can check by typing 'ls' at the command prompt.

root@iana:/tmp# ls
sarpi5_64-installer_slackcurrent_03May24_sp1.img.xz
root@iana:/tmp#

SARPi Project muse views ... Now you can check to see if the contents of the installer image are genuine. You should see "OK" after the filename:

root@iana:/tmp# md5sum -c sarpi5_64-installer_slackcurrent_03May24_sp1.img.md5
sarpi5_64-installer_slackcurrent_03May24_sp1.img.xz: OK

If you see something similar to the above (given that there may also be other files of your own already in this directory) you have downloaded the installer image file successfully. So the next thing to do is write the installer image to the microSD card. Remember, in this guide our microSD card was /dev/sda (yours might be a different designation) and we're going to use that in the next command. Type the following command, where [device] is the given designation of your microSD card (e.g. /dev/sda, /dev/sdb, etc.).

root@iana:/tmp# xz -dc sarpi5_64-installer_slackcurrent_03May24_sp1.img.xz | dd of=[device] bs=65536

Example: xz -dc sarpi5_64-installer_slackcurrent_03May24_sp1.img.xz | dd of=/dev/sda bs=65536

SARPi Project muse views ... xz may be a package you need to install on your Linux system if you do not already have it. The currently available releases of Slackware Linux comes with xz installed by default. If you need to install the xz package from source, it's available from the XZ Utils website.

It takes a moment or two for the installer image to be written to your microSD card, after which it will be configured to boot with the Slackware Linux installer. You can check this by typing:

root@iana:/tmp# fdisk -l

The results from the fdisk command will show you there is a partition on your microSD card. You should see something similar to the following:

fdisk

If you can see there is now a partition present on your microSD card then this is looking very good indeed! Now you can remove the microSD card from your card reader.

If you don't see the partition listed try writing the image to the microSD card again using the xz command shown above. Also try removing the microSD card from your system and plugging it in again. If this process fails continually you may have a faulty or incompatible card. In this case, locate another microSD card.

SARPi Project muse views ... NB: The /boot partition on a RPi must be formatted with a FAT32 filesystem. EXT*, NTFS, FAT16 filesystems will NOT work!

That's it for configuring your microSD card in Linux.

You can now go to the next page in this guide - Download Slackware Linux source media. [optional]

If you're planning to use a FTP/HTTP server for your Slackware source you can go to the Notes for Pre-installation page.

Prepare a microSD card or USB drive by flashing a SARPi installer image... for Windows and macOS Users

Using a Windows operating system or macOS with a microSD card reader installed, or a USB-microSD adapter, it is possible to configure your microSD card to boot the SARPi installer on your Raspberry Pi. This can be done by installing and using 7zip file archiver and balenaEtcher, which is a very easy and straightforward method.

SARPi Project muse views ... NB: If there are any existing partitions on your microSD card they will be over-written! Make sure you are not using a microSD card which contains important data before writing the SARPi installer image to it!

NB: The instructions and processes involved of preparing a microSD card and USB drive are exactly the same.

NB: balenaEtcher can handle compressed disk images but is sometimes unreliable in doing so. Therefore it is prudent to extract any compressed image files before writing them to a storage device, such as a microSD card.

How to achieve this:

• Download and install 7zip file archiver.
• Download the appropriate SARPi installer image file for your specific Raspberry Pi version.
• Extract the SARPi installer image file from the .xz archive to a folder using 7zip file archiver.
• Download and install balenaEtcher application for writing disk image files to microSD cards.
• Plug a microSD card (32GB capacity or greater is recommended) into your Windows or macOS machine.
• Use balenaEtcher to write the SARPi installer image file you've extracted to the microSD card.
• Check that the /boot files are physically on the microSD card by viewing its contents.
• You should see a FAT32 (DOS) partition containing the Raspberry Pi boot-firmware, kernel, initial ramdisk file, and overlays directory, at least. The disk label (i.e. name) should be "RPI?BOOT" - where '?' is the Raspberry Pi model you intend to install Slackware Linux for - e.g. RPI4BOOT, RPI5BOOT, etc.

If you can see the FAT32 /boot partition and the files it contains on your storage device then you know the installer image was written to the microSD card successfully. If you don't see the partition and files then try writing the installer image to the microSD card again. If the problem persists try another microSD card.

Once you have confirmed all the files are there, continue to the next section... Download Slackware Linux source media. [optional]

If you're planning to use a FTP/HTTP server for your Slackware source you can go to the Notes for Pre-installation page.

Back to Top


Updated: 2024-03-08 16:48:10 UTC

Disclaimer: The SARPi Project website is for non-commercial and general information purposes only. The content is provided by Penthux.NET and while we endeavour to keep information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or any information, software, products, services, or related graphics which is available on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk. In no event will Penthux.NET be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website or any of its contents. Through this website you are able to visit other websites which are not under our control. Penthux.NET has no influence over the nature, content or availability of any external URLs. The inclusion of any URLs does not necessarily imply a recommendation or endorsement of any content therein. Every effort is made to ensure the SARPi Project website remains accessible. However, Penthux.NET takes no responsibility for, and will not be liable for, the SARPi Project website being temporarily unavailable due to technical issues beyond our control. SARPi Project is in no way affiliated with Slackware Linux, Inc, or the Linux Foundation, or Raspberry Pi Ltd., or any of their respective members, trustees, partners, or associates.


Accept!

SARPi Project uses cookies for website traffic data analytics purposes only. Cookies from this website do not collect or store any of your personal data.

Please read the SARPi Project website [ Cookie Policy ] for more details.