🍣

Raspberry piを触るメモ

2023/02/17に公開

目的

raspberry piのOSを rasbian->ubuntuに変えたい
環境: mac

Ubuntuを入れる

既存のSDカードのバックアップを取る

https://zenn.dev/tmitsuoka0423/scraps/2edd956e4adac7

diskutil list
/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.3 GB    disk4
   1:             Windows_FAT_16 RECOVERY                2.5 GB     disk4s1
   2:                      Linux                         33.6 MB    disk4s5
   3:             Windows_FAT_32 boot                    268.4 MB   disk4s6
   4:                      Linux                         28.4 GB    disk4s7
diskutil umountDisk /dev/disk4
Unmount of all volumes on disk4 was successful
sudo dd if=/dev/disk4 of={イメージ名}.img bs=1m status=progress

初期化

https://qiita.com/ikemura23/items/f3dfc0311d50bc34aa25

diskutil eraseDisk MS-DOS RPI disk4
Started erase on disk4
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk4s2 as MS-DOS (FAT) with name RPI
512 bytes per physical sector
/dev/rdisk4s2: 60623904 sectors in 1894497 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=411648 drv=0x80 bsec=60653568 bspf=14801 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk4

Ubuntu入れる

https://www.bioerrorlog.work/entry/raspberry-pi-installing-ubuntu

Raspberry Pi Imagerのインストーラをダウンロード
https://www.raspberrypi.org/software/

Raspberry Pi Imager
画像はDesktopを入れてるけどGUI使わないからServerに変更。

起動とssh

ubuntu desktopの場合だと

ssh [ip address]
ssh: connect to host x.x.x.x port 22: Connection refused
telnet x.x.x.x 
Trying x.x.x.x ...
telnet: connect to address x.x.x.x : Connection refused
telnet: Unable to connect to remote host

そうだよね。ディスプレイ必要(横着しました)
https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up/3

初期設定

https://qiita.com/kotarella1110/items/f638822d64a43824dfa4
https://linuxfan.info/ubuntu-server-change-console-font

Discussion