ทำให้ Raspberry Pi4 บูทจาก SSD
- บูทจาก SDCard ปรกติ
- Login pi/raspberry
sudo apt update
sudo apt full-upgrade
3. แก้ไฟล์
sudo nano /etc/default/rpi-eeprom-update
จาก “critical” to “stable”
4.เช็คเวอร์ชั่น Bootloader Firmware Version
vcgencmd bootloader_version
ผล
pi@raspberrypi:~ $ vcgencmd bootloader_version
May 10 2019 19:40:36
version d2402c53cdeb0f072ff05d52987b1b6b6d474691 (release)
timestamp 0
update-time 0
capabilities 0x00000000
เห็นวันที่คือ May 10 2019 หรืออาจจะ Mar 19 2020 ซึ่งจะเก่าหน่อยทำให้ไม่สามารถ Boot จาก USB ได้
5.ติดตั้ง bootloader ใหม่ด้วยคำสั่ง
sudo rpi-eeprom-update -d -a
ผลการ RUN
pi@raspberrypi:~ $ sudo rpi-eeprom-update -d -a
BCM2711 detected
VL805 firmware in bootloader EEPROM
*** INSTALLING EEPROM UPDATES ***
BOOTLOADER: update available
CURRENT: Thu 19 Mar 2020 02:27:25 PM UTC (1584628045)
LATEST: Sat 16 Jan 2021 02:10:13 PM UTC (1610806213)
FW DIR: /lib/firmware/raspberrypi/bootloader/stable
VL805: up-to-date
CURRENT: 000137ad
LATEST: 000137ad
BOOTFS /boot
EEPROM updates pending. Please reboot to apply the update.
6. reboot ด้วยคำสั่ง
sudo reboot
7.เช็คเวอร์ชั่น Bootloader Firmware Version อีกครั้ง
vcgencmd bootloader_version
อาจจะเห็นข้อความดังนี้
pi@raspberrypi:~ $ vcgencmd bootloader_version
Jan 16 2021 14:10:13
version d1be7b5ba3adb192b6192ea2561584aa5c7be6bd (release)
timestamp 1610806213
update-time 1612365610
capabilities 0x0000001f
การเตรียม SSD ที่จะใช้งาน
สามารถสร้าง SSD ได้จากสองวิธี
1. Copy SDcard ลงบน SSD ด้วยการใช้โปรแกรม SD Card Copier application ในเมนู accessories ( ใช้ไม่ได้กับ SDcard ที่สร้างจากNoobs เพราะ noobs มี recovery partition)
2. ใช้โปรแกรม Raspberry Pi Imager เขียนลงบน SSD โดยตรง
OS ที่เลือกเขียนทับ อาจเลือกเป็น raspberry PI OS(32-bit)
การเริ่มใช้งาน
ถอด SDcard ออก เสียบ SSD ที่เขียน Image ทับไว้แล้วเข้า Port USB (ที่เป็นช่อง USB 2.0 คือสีดำ ผู้เขียนพบว่าหากเสียบเข้าช่อง USB 3.0 สีฟ้าจะใช้งานไม่ได้)
แล้ว reboot เครื่อง
หมายเหตุ Troubleshooting
กรณีที่หากใช้คำสั่ง
sudo rpi-eeprom-update -d -a
แล้วมีการเช็คว่าเป็น Firmware วันเดียวกันที่ติดตั้งอยู่ใน PI กับที่ Update มา คำสั่งดังกล่าวจะไม่ขึ้นว่า
BOOTLOADER: update available
แต่แจ้งว่า
BOOTLOADER: up-to-date
ทำให้ไม่เกิดการเขียนทับ Firmware เราอาจจะต้องใช้คำสั่งบังคับให้เขียนทับ
ก่อนอื่นให้ดูใน /lib/firmware/raspberrypi/bootloader/stable/
pi@raspberrypi:~ $ ls /lib/firmware/raspberrypi/bootloader/stable/
pieeprom-2020–04–16.bin pieeprom-2020–09–03.bin recovery.bin
pieeprom-2020–06–15.bin pieeprom-2020–12–11.bin vl805–000137ad.bin
pieeprom-2020–07–16.bin pieeprom-2021–01–11.bin vl805–000138a1.bin
pieeprom-2020–07–31.bin pieeprom-2021–01–16.bin
เห็นว่ามี File ใหม่สุดคือ
/lib/firmware/raspberrypi/bootloader/stable/pieeprom-2021–01–16.bin
ให้ใช้คำสั่ง
sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2021–01–16.bin
แล้วตามด้วย sudo reboot
Tip! เพิ่มเติม
1.ดูว่ามี package อะไรที่ upgrade ได้บ้าง
apt list — upgradable
2. ดูว่าใช้ USB Adapter รุ่นอะไรยี่ห้ออะไรอยู่
ใช้คำสั่ง lsusb && lsusb -t
pi@raspberrypi:~ $ lsusb && lsusb -t
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 4, If 0, Class=Mass Storage, Driver=uas, 480M
3.ดูว่า Firmware มีการตั้งค่าอะไรไว้บ้าง ใช้คำสั่ง sudo rpi-eeprom-update && vcgencmd bootloader_config
sudo rpi-eeprom-update && vcgencmd bootloader_config
BCM2711 detected
VL805 firmware in bootloader EEPROM
BOOTLOADER: up-to-date
CURRENT: Sat 16 Jan 2021 02:10:13 PM UTC (1610806213)
LATEST: Thu 03 Sep 2020 12:11:43 PM UTC (1599135103)
FW DIR: /lib/firmware/raspberrypi/bootloader/default
VL805: up-to-date
CURRENT: 000138a1
LATEST: 000138a1
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
4. กรณีใช้กับกล่อง Argon M2 ให้บูทด้วย SDcard ก่อน แล้วเสียบ USB Connector
แล้วใช้โปรแกรม SD card Copier
เลือก
เลือก From SD
เลือก To WDC WDS120G เป็นต้น แล้วคลิก Start ดึง SDcard ออกแล้วเปิดเครื่อง เครื่องควรจะบูทตรงได้จาก SSD ได้
5. ถ้า Clone SDcard แล้วไม่เห็น eth0 หรือ wlan0 เกิดจาก Dhcpcd stop เพราะ Docker ดูใน /var/log/syslog จะเห็น
dhcpcd.service: Main process exited, code=killed, status=11/SEGV
dhcpcd.service: Failed with result ‘signal’.
ref: https://forums.raspberrypi.com/viewtopic.php?t=305640
สาเหตุเพราะว่า
The behavior of dhcpcd is to try to IP-config every interface that is live in the system. Bridges are an exception somehow; older versions of dhcpcd used to jump in when a bridge was created, but now you need to declare the interface in dhcpcd.conf for it to get configured.
Nevertheless Docker usually creates bridges, but also the veth pairs that are used to connect containers to said bridges.
Dhcpcd doesn’t see the veths that are within containers, but it sees the other halves, plugged into the bridges in the host. And it tries to configure them.
Of course the bridge(s) created by docker are not connected to a regular DHCP network, so dhcpcd fails at DHCP config, and falls back to zeroconf. This takes time and perhaps Docker fights back. Meanwhile, bridge members must not have an IP config, and dhcpcd doesn’t care if the interface has a master or not, it just tries again and again.
So until you exclude veth from being processed by dhcpcd, it is super busy disrupting networking in the host, and possibly for the containers as well.
แก้โดยใส่บรรทัด
denyinterfaces veth*
ในไฟล์ /etc/dhcpcd.conf
ก่อน Interface eth0