Raspberry pi Zero2WのSSD化−2

前の記事はツールを使わずroot権限でSDカードの内容をSSDへ全コピーした、今回SDで立ち上げ後cmdline.txtを書き換えSSDのルート化をする・・・他サイトではSDカードを取り外しSSDのみで運用との記事を見受けるが筆者の環境では出来なかった

⑤SSDとSDの内容が同じ事を確認後、母艦LinuxマシンからSDとSSDを取り出しラズパイへ装着

# l SD
bin@   home/            lost+found/  proc/  service/  usr/          www/
boot/  initrd.img@      media/       root/  srv/      var/
dev/   initrd.img.old@  mnt/         run/   sys/      vmlinuz@
etc/   lib@             opt/         sbin@  tmp/      vmlinuz.old@

# l SSD
bin@   home/            lost+found/  proc/  service/  usr/          www/
boot/  initrd.img@      media/       root/  srv/      var/
dev/   initrd.img.old@  mnt/         run/   sys/      vmlinuz@
etc/   lib@             opt/         sbin@  tmp/      vmlinuz.old@

# umount SD SSD

⑥ラズパイ立ち上げ後cmdline.txtを編集

# ssh pi@iot008.local
# i@iot008.local's password:
Linux iot008 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64
.
root@iot008:/home/pi# df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev               75508       0     75508   0% /dev
tmpfs              42832    2920     39912   7% /run
/dev/mmcblk0p2   6927044 3267264   3288120  50% /
tmpfs             214152       0    214152   0% /dev/shm
tmpfs               5120       8      5112   1% /run/lock
tmpfs             102400       0    102400   0% /tmp
tmpfs              65536      68     65468   1% /var/log
tmpfs             204800    9024    195776   5% /www
/dev/mmcblk0p1    522232   62392    459840  12% /boot/firmware
tmpfs              42828       4     42824   1% /run/user/1000
# cat /boot/cmdline.txt 
DO NOT EDIT THIS FILE

The file you are looking for has moved to /boot/firmware/cmdline.txt
.
root@iot008:/home/pi# cat /boot/firmware/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=a168ebd8-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=JP

console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=JP

/boot/cmdline.txt ・・・ではなく/boot/firmware/cmdline.txtを編集する

編集 root=PARTUUID=a168ebd8-02 –> root=/dev/sda2

⑥リブートすると/dev/sda2のSSDルートで立ち上がる

ssh  pi@iot008.local
pi@iot008.local's password:
Linux iot008 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
pi@iot008:~ $ sudo su
root@iot008:/home/pi# df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev               75508       0     75508   0% /dev
tmpfs              42832    2920     39912   7% /run
/dev/sda2        6897176 3265900   3259616  51% /
tmpfs             214152       0    214152   0% /dev/shm
tmpfs               5120       8      5112   1% /run/lock
tmpfs             102400       0    102400   0% /tmp
tmpfs              65536      60     65476   1% /var/log
tmpfs             204800    6656    198144   4% /www
/dev/sda1         523244   62896    460348  13% /boot/firmware
tmpfs              42828       4     42824   1% /run/user/1000

以下次回に続く

Follow me!

IOT

前の記事

Raspberry pi Zero2WのSSD化−1
IOT

次の記事

Raspberry pi Zero2WのSSD化−3