January 19, 2024 Howto Download a Raspberry Pi 4B bootable image from http://ghostbsdarm64.hopto.org/packages/

 Download a Raspberry Pi 4B bootable image for a USB Flash drive 16GB or larger size

March 6, 2024  update:  use  Feb27_2.img.xz  file

http://ghostbsdarm64.hopto.org/packages/   Here is the directory to look at.

http://ghostbsdarm64.hopto.org/packages/write_freebsd_img_dd_to_da1.sh 
Here is the shell script for GhostBSD / FreeBSD that will download the 

  1. FreeBSD-14.0-RELEASE image
  2. GhostBSD Feb27_2.img.xz  image file. HDMI Audio will eventually be working 
  3. Paste in any URL link to download that file using BSD Fetch command
  4. 0.)  Select '0' to download the FreeBSD-14.0-RELEASE CHECKSUM-RPI text file and compare against the FreeBSD-14.0-RELEASE  sha512 checksum value 

 

 

./write_freebsd_img_dd_to_da1.sh: 143 lines, 6488 characters.
root@Ghost14-selfbuilt-rpi4B-nginx-tst1:~/write_test # ./write_freebsd_img_dd_to_da1.sh
 execute this write_freebsd_snapshot_image.sh  shell script file to download an image file 
 0.)    fetch https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.0/CHECKSUM.SHA512-FreeBSD-14.0-RELEASE-arm64-aarch64-RPI
 1.)    fetch https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.0/FreeBSD-14.0-RELEASE-arm64-aarch64-RPI.img.xz
 2.)    fetch  http://ghostbsdarm64.hopto.org/packages/Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img.xz
 3.)    fetch   user provided file URL: to download. 

Enter 0,1,2,3 number to select which file to download >2
 FILE_IMAGE = Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img.xz is your selected download 
gpart status of  da0 da1 disk devices 
 Name  Status  Components
da1p1      OK  da1
da1p2      OK  da1
da1p3      OK  da1
da0p1      OK  da0
da0p2      OK  da0
da0p3      OK  da0
 Download Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img.xz and write to this device /dev/da1  Hit Ctrl-C to exit! 
Exit & Edit this shell script to change Filename
 
 What disk device & size to resize and growfs UFS partition /dev/da1p3 to size 12G
Enter /dev/da1 DISK1 dev string: /dev/da0
Enter /dev/da1p3 resize partition  size in GBytes like 27G: 80G
DISK1 value/dev/da0<---- DISK1_tmp value /dev/da0 


 Downloading file Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img.xz , decompress file, dd Writing file image to disk /dev/da0 , 
 Resize the UFS partition /dev/da0p3 to size 80G
  Ctrl-C now to Exit & make changes 


 Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img.xz file exists. 

  File Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img was already downloaded & decompressed 

 dd write Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img into whole disk /dev/da0  Ctrl-C to exit now!  

 Expect about 8 minutes to write 5.0 Gbytes at 14MB/second into a USB 3.0 16Gbyte or larger Flash Drive 
+ sleep 7
+ time dd 'if=Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img' 'of=/dev/da0' 'conv=sync' 'bs=4M' 'iflag=direct' 'oflag=direct' 'status=progress'
  7570718720 bytes (7571 MB, 7220 MiB) transferred 497.306s, 15 MB/s
1805+0 records in
1805+0 records out
7570718720 bytes transferred in 497.392246 secs (15220822 bytes/sec)
      497.41 real         2.12 user        26.29 sys

 FILE_SELECT value is 2 <--- 

+ gpart status /dev/da0
 Name   Status  Components
da0p1  CORRUPT  da0
da0p2  CORRUPT  da0
da0p3  CORRUPT  da0
+ gpart show -lp /dev/da0
=>       3  14782464    da0  GPT  (115G) [CORRUPT]
         3    102400  da0p1  esp  (50M)
    102403   4194304  da0p2  swapfs  (2.0G)
   4296707  10485760  da0p3  rootfs  (5.0G)

+ ls -lh Ghost14_5g_selfbuilt_raspi4b_Feb27_2.img
-rw-r--r--  1 root wheel  690M Jan 23 23:41 Ghost14_5g_selfbuilt_raspi4b_Jan22_0.img.xz -> 

root@Ghost14-selfbuilt-rpi4B-nginx-tst1:~/write_test # ls -lh /root/Gh*.img
-rw-r--r--  1 root wheel  690M Jan 23 23:41 Ghost14_5g_selfbuilt_raspi4b_Jan22_0.img.xz

-rw-r--r--  1 root wheel  7.0G Jan 18 19:03 /root/Ghost14_5g_selfbuilt_raspi4b_Jan18_2.img
-rw-r--r--  1 root wheel   12G Dec 12 23:33 /root/Ghost14_selfbuilt_raspi4b_Dec12_3.img
-rw-r--r--  1 root wheel   12G Jan 17 03:48 /root/Ghost14_selfbuilt_raspi4b_Jan16_1.img

Example Values to enter into Shell script  ./write_freebsd_img_dd_to_da1.sh

2        <--- Select  GhostBSD-Arm64 image
/dev/da0   <--- Select  device drive for USB flash /dev/da1  or /dev/da2
27G    <--- Select the size to Resize the UFS partition  /dev/da1p3 or /dev/gpt/rootfs/
             12G  for  16GB flash,  27G for 32GB flash , 60GB for 64GB, 118G for 128GB flash
yes      <----  Yes, you want to resize the partition size

1      <---  Select the FreeBSD-14.0-RELEASE image to download
0      <---  Select the CHECKSUM-SHA512-RPI 182byte file to download
3      <---  Select a URL File to download.   Paste the whole URL Link https://xy


 Sequence of Steps to manually perform the same task as the write_image

  1. Download the File Image you wish to burn
  2. xz --decompress --keep --verbose  File_Image.img.xz 
  3. dd if=GhostBSD-Arm64.img of=/dev/da1 bs=1M conv=sync status=progress
  4. Resize 3rd partition  /dev/da1p3  gpart resize -i 3 -a 4k -s82G /dev/da1
  5. Growfs 3rd partition to fill the space.  growfs /dev/da1p3  or /dev/gpt/rootfs
  6. fsck -Ffyv /dev/da1p3   to verify the UFS files system checks


Once you complete and boot the USB Flash Drive in a Raspberry Pi, read these 2 other blog posts.  Use a blank unpartitioned USB to SSD case drive (NVMe stick or 2.5" inch SATA SSD disk drive) for creating a ZFS boot on root SSD.

 


Comments

Popular posts from this blog

FreeBSD 14.0 Compiling kernel for Raspberry Pi 4B

HDMI Audio sound patches into GhostBSD source code /usr/ghost14/ghostbsd-src SOLVED Jan20 2024

How to install GhostBSD-Arm64 into a USB Flash Drive stick April 24, 2024 update edition.