I have made a img, using windows and my Rpi 4,
I did not read this complete topic, so maybe it's bin writen up like I did.
Parts list;
.
Flashed RaspberryPi OS lite to ssd whit rasberry Pi Imager
unplug ssd from PC, and pluged back in.
on the boot drive create file ssh, and edit config.txt and cmdline.txt
Code: Select all
config.txt ---- DON'T use mine, use it as a reference, things i have added
# Disable Ethernet LEDs
dtparam=eth_led0=14
dtparam=eth_led1=14
# Disable the PWR LED
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
# Disable the Activity LED
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
#disable all we dont need
dtoverlay=disable-wifi
dtoverlay=disable-bt
gpu_mem=32
remove te last part from the line,
make sure there will be
only 1 line (No enter no next line)
Remove this --> "
init=/usr/lib/raspi-config/init_resize.sh"
Next boot Rpi from your ssd,
First we need to create some more space on the disk. it's now 1.5G
p – Print exiting partition table and take note of /dev/sda2 start (in my case it was
532480 but this is very important)
d and then
2 – to delete exiting partition /dev/sda2
n –
p –
2 create new partition, set it primary, and its number 2
First sector – this is the magic number in my case it was
532480 and press enter.
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-8191, default 8191):
+2.5G
Do you want to remove the signature? [Y]es/[N]o:
n
w to save partition table
q and exit fdisk
reboot the pi.
If all went well we now have 2.5G
Now you have some more space to do the updates upgrades install your app's
I installed docker, docker-compose and mc
pub and private key's for secure login, set my hoste name and timezone.
If you are sure your done so no reboot's any more, then the last thing is edit
and add to the end
init=/usr/lib/raspi-config/init_resize.sh again no enter no new line
save and
Now it is time to make the image,
if you made your pi bootable from usb, you must have a Micro SD with rpi os,
boot you pi from the Micro SD, hard drive not plugged in
connect your usb ssd to the pi.
find the end sectors nummer last line of the output starts whit a
2 column
end
Code: Select all
sudo dd if=/dev/sda of=/home/pi/clone.img count=your sector number
replace
your sector number whit your number of sectors
+ 1
This will create a img about 2.6G in your home dir on your Micro SD..
I used WinSCP to copy the file from the Rpi to my windows machine