Managing Raspberry Pi images: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Created page with "== Creating SD cards == There is a Windows program that some people use but I only use the Raspberry Pi imager, or sometimes Balena Etcher. == Copy IMG == Mick warns that pi-shrink is unreliable. Here it is all the same. https://www.instructables.com/How-to-BackUp-and-Shrink-Your-Raspberry-Pi-Image/ I did this on Bellman and worked there I think. I think. Did I make notes? sudo apt install dcfldd gparted == Building new images == [https://github.com/RPi-Distro/p..."
 
Brian Wilson (talk | contribs)
Line 26: Line 26:


I put the experimental svxlink image into a SanDisk card reader and popped it into a USB slot on pi5. The builtin card reader shows up in  
I put the experimental svxlink image into a SanDisk card reader and popped it into a USB slot on pi5. The builtin card reader shows up in  
/dev/mmcblk0. It looks like this:
/dev/mmcblk0. SD cards are fine but not roomy enough for what I am about, and slow anyway.
For pi5, I put the image on an NVME drive so I'd have enough space to work on images. It won't do to build 8GB images on an 8GB card for example.
After booting it looks like this.


<pre>
<pre>
bwilson@pi5:~ $ sudo fdisk -l /dev/mmcblk0
sudo fdisk -l /dev/sda
Disk /dev/mmcblk0: 7.48 GiB, 8035237888 bytes, 15693824 sectors
Disk /dev/sda: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: RTL9210B-CG
Units: sectors of 1 * 512 = 512 bytes
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disklabel type: dos
Disk identifier: 0x3c4a82fb
Disk identifier: 0xdcf0eea7


Device         Boot  Start     End Sectors Size Id Type
Device     Boot  Start       End   Sectors   Size Id Type
/dev/mmcblk0p1        8192 1056767 1048576 512M  c W95 FAT32 (LBA)
/dev/sda1          8192   1056767   1048576   512M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      1056768 15693823 14637056    7G 83 Linux
/dev/sda2      1056768 1000215215 999158448 476.4G 83 Linux
</pre>
</pre>


Line 45: Line 48:


<pre>
<pre>
bwilson@pi5:~ $ sudo fdisk -l /dev/sda
sudo fdisk -l /dev/sdb
Disk /dev/sda: 28.82 GiB, 30941380608 bytes, 60432384 sectors
Disk /dev/sdb: 28.82 GiB, 30941380608 bytes, 60432384 sectors
Disk model: SDDR-B531 Reader
Disk model: SDDR-B531 Reader
Units: sectors of 1 * 512 = 512 bytes
Units: sectors of 1 * 512 = 512 bytes
Line 55: Line 58:


Device    Boot  Start      End  Sectors  Size Id Type
Device    Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192  532479  524288  256M  c W95 FAT32 (LBA)
/dev/sdb1         8192  532479  524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 60432383 59899904 28.6G 83 Linux
/dev/sdb2       532480 60432383 59899904 28.6G 83 Linux
</pre>
</pre>


Since it's not mounted I could immediately make a copy but I'd be copying a 32GB card to an 8GB. Hardly likely. I need
Now I need tools. I need pi-gen and that needs Docker.
to add an NVME drive in a USB enclosure.  


mkdir Documents
<pre>
cd Documents
curl -sSL https://get.docker.com | sh
sudo apt install git
sudo usermod -aG docker $USER
git clone https://github.com/RPI-Distro/pi-gen.git
mkdir Documents
# Install Docker engine, it's where pi-gen will run.
cd Documents
curl -sSL https://get.docker.com | sh
sudo apt install git
sudo usermod -aG docker $USER
git clone https://github.com/RPI-Distro/pi-gen.git
</pre>


[[Category: Raspberry Pi]]
[[Category: Raspberry Pi]]
[[Category: Embedded]]
[[Category: Embedded]]

Revision as of 04:20, 14 February 2024

Creating SD cards

There is a Windows program that some people use but I only use the Raspberry Pi imager, or sometimes Balena Etcher.

Copy IMG

Mick warns that pi-shrink is unreliable. Here it is all the same.

https://www.instructables.com/How-to-BackUp-and-Shrink-Your-Raspberry-Pi-Image/

I did this on Bellman and worked there I think. I think. Did I make notes?

sudo apt install dcfldd gparted

Building new images

pi-gen is what the Raspberry Pi folk use. See /boot/issue.txt on a standard image. For example,

Raspberry Pi reference 2023-12-11
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 2acf7afcba7d11500313a7b93bb55a2aae20b2d6, stage2

Loading an SD card

Thing is, I could use Bellman but that does not help Mick since it's 800 miles away from him. So I am working with pi5 instead since he has access to his own inventory of Pi hardware.

I put the experimental svxlink image into a SanDisk card reader and popped it into a USB slot on pi5. The builtin card reader shows up in /dev/mmcblk0. SD cards are fine but not roomy enough for what I am about, and slow anyway. For pi5, I put the image on an NVME drive so I'd have enough space to work on images. It won't do to build 8GB images on an 8GB card for example. After booting it looks like this.

sudo fdisk -l /dev/sda
Disk /dev/sda: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: RTL9210B-CG
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdcf0eea7

Device     Boot   Start        End   Sectors   Size Id Type
/dev/sda1          8192    1056767   1048576   512M  c W95 FAT32 (LBA)
/dev/sda2       1056768 1000215215 999158448 476.4G 83 Linux

The SD card in the card reader shows up in /dev/sda.

sudo fdisk -l /dev/sdb
Disk /dev/sdb: 28.82 GiB, 30941380608 bytes, 60432384 sectors
Disk model: SDDR-B531 Reader
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x570b8731

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdb1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sdb2       532480 60432383 59899904 28.6G 83 Linux

Now I need tools. I need pi-gen and that needs Docker.

curl -sSL https://get.docker.com | sh
sudo usermod -aG docker $USER
mkdir Documents
cd Documents
sudo apt install git
git clone https://github.com/RPI-Distro/pi-gen.git