> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avert.ldeo.columbia.edu/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating an SD card

The first task, before even powering on the SBC, is to create a bootable SD card with a functioning operating system. For our chosen single-board computer, the embeddedTS-7970, this operating system must be for the armhf architecture. This process is best conducted with a Linux system, as we need to format the SD card with an ext3 filesystem on a single partition.

First, insert the SD card into a reader attached to your system and identify the name of the disk and the corresponding location in the devices directory (`/dev/`), e.g., `/dev/mmcblk0`. To list out the devices, use:

```bash theme={null}
sudo fdisk -l
```

<Note>
  Run this command before inserting your card, insert the card, rerun the
  command and find the new entry.
</Note>

Once you’ve identified the device, you need to create a single partition. If you want to be extra meticulous, the first thing to do is completely wipe the SD card. Be careful, this command can destroy your machine if misused. To perform a clean wipe, run the following command, replacing `<device>` with the name of the device previously identified:

```bash theme={null}
sudo dd if=/dev/zero of=/dev/<device> bs=8192
```

This can take a number of hours, depending on the size of the SD card.

Once the SD card is wiped, create a new partition using the `fdisk` utility. This will open up a command-line interface. The instructions in the code-block below shows the key press order:

```shell theme={null}
sudo fdisk <device>
n  # Create new partition
p  # Specify the partition is the primary partition
1  # Specify this is the first partition
2048  # Specify the first sector for the partition
<last-sector>  # Specify the last sector (just used the recommended value)
w  # Write the partition table
```

The partition should now appear in the `/dev` directory as `/dev/<device>p1`, where `p1` indicates this is partition 1.

Format this partition using the `mkfs` utility:

```bash theme={null}
sudo mkfs.ext3 /dev/<device>p1
```

This can take a few minutes.

Finally, mount the prepared SD card and unpack the latest Debian image (which can be downloaded from the embeddedTS website [here](https://docs.embeddedts.com/TS-7970#Debian_12_-_Bookworm)):

```bash theme={null}
mkdir /mnt/sd
sudo mount /dev/<device>p1 /mnt/sd/
sudo tar --numeric-owner -xjf <image> -C /mnt/sd
sudo umount /mnt/sd
sync
```

replacing `<image>` with the path to the downloaded image file.

Voila! Your SD card is ready to go.
