Micro SD card writing environment: MacBook Pro MacOS Mojave Raspberry pi : pi 4 Model B 8GB RAM 4core Micro SD card: 512 GB
Reference article / site https://7ka.org/raspberrypi-sd-init-mac/ https://www.centos.org/download/ https://www.raspberrypi.org/documentation/installation/installing-images/mac.md https://www.clara.jp/media/?p=5792#1-BOSPCmicroSD https://www.sgv417.jp/~makopi/blog/archives/2019 https://qiita.com/ftom/items/bdbb44383299029ea3b0
Insert the MicroSD card into your Mac and format it on the command line.
1-1. First, use the diskutil list to display the list of connected disks and find the MicroSD card. In my environment / dev / disk3 is the MicroSD card.
diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 250.8 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +250.8 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 230.1 GB disk1s1
2: APFS Volume Preboot 64.9 MB disk1s2
3: APFS Volume Recovery 522.7 MB disk1s3
4: APFS Volume VM 3.2 GB disk1s4
/dev/disk2 (disk image):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme +18.0 MB disk2
1: Apple_partition_map 32.3 KB disk2s1
2: Apple_HFS Flash Player 18.0 MB disk2s2
/dev/disk3 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *512.1 GB disk3
1: Windows_NTFS 512.0 GB disk3s1
1-2. Next, format / dev / disk3.
diskutil eraseDisk MS-DOS RPI disk3
Started erase on disk3
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk3s2 as MS-DOS (FAT) with name RPI
newfs_msdos: /dev/rdisk3s2: newfs_exfat should be used for SDXC media
512 bytes per physical sector
/dev/rdisk3s2: 999487104 sectors in 15616986 FAT32 clusters (32768 bytes/cluster)
bps=512 spc=64 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=411648 drv=0x80 bsec=999731200 bspf=122008 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk3
2-1. Download the CentOS image. https://www.centos.org/download/
In this article, I downloaded the OS image from the mirror site below. http://mirror.aktkn.sg/centos-altarch/7.8.2003/isos/armhfp/
This article has downloaded CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-4-2003-sda.raw.xz.
2-2. When the download is complete, double-click the file to unzip it.
Write the unzipped file (CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-4-2003-sda.raw) to the MicroSD card. 3-1. First, unmount Disk.
diskutil unmountDisk /dev/disk3
3-2. Execute the following command to write.
if =
sudo dd bs=1m if=CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-4-2003-sda.raw of=/dev/rdisk3; sync
Password:
2612+0 records in
2612+0 records out
2738880512 bytes transferred in 35.963779 secs (76156638 bytes/sec)
If you see Resource busy, do the following:
sudo diskutil unmountDisk /dev/disk3
3-3. Eject
If the writing is successful, execute the following command.
sudo diskutil eject /dev/rdisk3
4-1. Insert the MicroSD card into the Raspberry pi and turn it on.
4-2. localhost login: will be displayed. Enter root and enter centos as the password.
5-1. At this stage, the free space on the MicroSD card is not allocated for use, so allocate it. First, execute the df command for confirmation.
Only 1.7 GB is allocated to root as shown below. The following is the state where 100% of root is used because the installation work was done without doing this work ...
df -hT
File system type size used remaining used% mount position /dev/root ext4 1.7G 1.7G 0 100% / devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs tmpfs 3.9G 17M 3.9G 1% /run tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/mmcblk0p1 vfat 286M 58M 229M 21% /boot tmpfs tmpfs 788M 0 788M 0% /run/user/0
5-2.Extend the root assignment.
rootfs-expand
5-3.Check again with the df command.
The size available for root has been expanded.
df -hT
File system type size used remaining used% mount position /dev/root ext4 469G 1.2G 468G 1% / devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs tmpfs 3.9G 17M 3.9G 1% /run tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/mmcblk0p1 vfat 286M 54M 233M 19% /boot tmpfs tmpfs 788M 0 788M 0% /run/user/0 [root@localhost ~]#
### 6.Wifi settings
Connect to wifi.
6-1.Start network.
service network start
6-2.Check the status of network devices.
nmcli d
wifi is displayed as disconnected.
6-3.Since the wifi device is working, it will show you the available access points.
nmcli dev wifi list
6-4.Connect to the SSID.
nmcli --ask dev wifi connect
You will be asked for the password, so enter it.
6-5.If you can connect, please check if you can enter from another terminal with ssh.
This is the end of the first step of installing CentOS 7 for the time being.
Please change the password and install the package according to your purpose.:cat: :cat:
Recommended Posts