티스토리 뷰

OS/Banana Pi /BPI-Bit

BPI-M4 : M.2 E-Key - SD 드라이브 설치

파란크리스마스 2021. 2. 20. 02:19
728x90

출처

BPI-M4의 경우 전용 카메라, 모니터를 사용할 수 있는 확장 슬롯이 없고 기본 eMMC가 용량이 작아서 아쉬웠는데 M.2 E-Key로 SD 메모리를 확장 할 수 있어서 소개합니다.

SD 메모리 장착 전, 후
확장보드 장착 전, 후

리눅스 정보 확인

pi@bpi-iot-ros-ai:~$ uname -a
Linux bpi-iot-ros-ai 4.9.119-BPI-M4-Kernel #1 SMP PREEMPT Mon May 18 10:41:36 HKT 2020 aarch64 aarch64 aarch64 GNU/Linux

리눅스 배포판 버전 확인

pi@bpi-iot-ros-ai:~$ grep . /etc/*-release
/etc/armbian-image-release:# PLEASE DO NOT EDIT THIS FILE
/etc/armbian-image-release:BOARD=bananapim64
/etc/armbian-image-release:BOARD_NAME="Banana Pi M64"
/etc/armbian-image-release:BOARDFAMILY=sun50iw1
/etc/armbian-image-release:VERSION=5.41
/etc/armbian-image-release:LINUXFAMILY=pine64
/etc/armbian-image-release:BRANCH=default
/etc/armbian-image-release:ARCH=arm64
/etc/armbian-image-release:IMAGE_TYPE=user-built
/etc/armbian-image-release:BOARD_TYPE=csc
/etc/armbian-image-release:INITRD_ARCH=arm
/etc/armbian-image-release:KERNEL_IMAGE_TYPE=Image
/etc/lsb-release:DISTRIB_ID=Ubuntu
/etc/lsb-release:DISTRIB_RELEASE=18.04
/etc/lsb-release:DISTRIB_CODENAME=bionic
/etc/lsb-release:DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
/etc/os-release:NAME="Ubuntu"
/etc/os-release:VERSION="18.04.4 LTS (Bionic Beaver)"
/etc/os-release:ID=ubuntu
/etc/os-release:ID_LIKE=debian
/etc/os-release:PRETTY_NAME="Ubuntu 18.04.4 LTS"
/etc/os-release:VERSION_ID="18.04"
/etc/os-release:HOME_URL="https://www.ubuntu.com/"
/etc/os-release:SUPPORT_URL="https://help.ubuntu.com/"
/etc/os-release:BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
/etc/os-release:PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
/etc/os-release:VERSION_CODENAME=bionic
/etc/os-release:UBUNTU_CODENAME=bionic

dmesg 확인

pi@bpi-iot-ros-ai:~$ dmesg | grep pci
[    2.204941] [RTD139x PCIE] 98060000.pcie: PCIE host driver initial begin.
[    2.204973] [RTD139x PCIE] 98060000.pcie: PCIE Debug Mode off
[    2.441801] [RTD139x PCIE] 98060000.pcie: PCIE device has link down in slot 2
[    2.441833] [RTD139x PCIE] 98060000.pcie: rtk_pcie_139x_hw_initial fail
[    2.441886] [RTD139x PCIE]: probe of 98060000.pcie failed with error -22
[    4.922306] ehci-pci: EHCI PCI platform driver
[    4.922978] ohci-pci: OHCI PCI platform driver

블럭장치 확인

확장 드라이브 설치 전

pi@bpi-iot-ros-ai:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  7.3G  0 disk 
├─mmcblk0p1  179:1    0  256M  0 part /media/pi/BPI-BOOT
└─mmcblk0p2  179:2    0  6.8G  0 part /
mmcblk0boot0 179:8    0    4M  1 disk 
mmcblk0boot1 179:16   0    4M  1 disk 
mmcblk0rpmb  179:24   0  512K  0 disk

확장 드라이브 설치 후

pi@bpi-iot-ros-ai:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    1 29.7G  0 disk 
└─sda1         8:1    1 29.7G  0 part /media/pi/3665-3463
mmcblk0      179:0    0  7.3G  0 disk 
├─mmcblk0p1  179:1    0  256M  0 part /media/pi/BPI-BOOT
└─mmcblk0p2  179:2    0  6.8G  0 part /
mmcblk0boot0 179:8    0    4M  1 disk 
mmcblk0boot1 179:16   0    4M  1 disk 
mmcblk0rpmb  179:24   0  512K  0 disk

USB 정보 확인

확장 드라이브 설치 전

pi@bpi-iot-ros-ai:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:c820 Realtek Semiconductor Corp. 
Bus 001 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

확장 드라이브 설치 후

pi@bpi-iot-ros-ai:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:c820 Realtek Semiconductor Corp. 
Bus 001 Device 003: ID 05e3:0751 Genesys Logic, Inc. 
Bus 001 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

fdisk 확인

pi@bpi-iot-ros-ai:~$ sudo fdisk -l
 
... 생략 ...
 
Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)

추가된 디스트의 파티션을 만들고 mount 하기

디스크 확인

pi@bpi-iot-ros-ai:~$ sudo fdisk -l | grep '^Disk'
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk0: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Disklabel type: dos
Disk identifier: 0xc69bd2d7
Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disklabel type: dos
Disk identifier: 0x00000000

기존 파티션을 삭제하고 새로 파티션 생성

pi@bpi-iot-ros-ai:~$ sudo fdisk /dev/sda
 
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
 
Command (m for help): p
Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)
 
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
 
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62333951, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-62333951, default 62333951): 
 
Created a new partition 1 of type 'Linux' and of size 29.7 GiB.
 
Command (m for help): w
The partition table has been altered.
Failed to remove partition 1 from system: Device or resource busy
Failed to add partition 1 to system: Device or resource busy
 
The kernel still uses the old partitions. The new table will be used at the next reboot. 
Syncing disks.

재부팅

pi@bpi-iot-ros-ai:/sd_disk$ sudo shutdown -r now

디스크 format

pi@bpi-iot-ros-ai:~$ sudo mkfs.ext4 /dev/sda1
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 7791488 4k blocks and 1949696 inodes
Filesystem UUID: ca144d66-31b2-4bac-ac7d-db0d6ccb0075
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000
 
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:        
done

mount 할 디렉토리 생성

pi@bpi-iot-ros-ai:~$ sudo mkdir /sd_disk

mount

pi@bpi-iot-ros-ai:~$ sudo mount /dev/sda1 /sd_disk

확인

pi@bpi-iot-ros-ai:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            320M     0  320M   0% /dev
tmpfs            68M  6.0M   63M   9% /run
/dev/mmcblk0p2  6.7G  5.4G  992M  85% /
tmpfs           340M     0  340M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           340M     0  340M   0% /sys/fs/cgroup
tmpfs           340M  4.0K  340M   1% /tmp
tmpfs            68M   16K   68M   1% /run/user/1000
overlaid         68M   16K   68M   1% /run/user/1000/pi-chromium
/dev/sda1        30G  128K   30G   1% /sd_disk
/dev/mmcblk0p1  256M   38M  218M  15% /media/pi/BPI-BOOT

자동 mount

UUID 확인

pi@bpi-iot-ros-ai:~$ sudo blkid
/dev/mmcblk0: PTUUID="c69bd2d7" PTTYPE="dos"
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="BPI-BOOT" UUID="D0B7-DA68" TYPE="vfat" PARTUUID="c69bd2d7-01"
/dev/mmcblk0p2: LABEL="BPI-ROOT" UUID="f28d8061-d9a4-495b-96f0-c3e5233eaa1d" TYPE="ext4" PARTUUID="c69bd2d7-02"
/dev/sda1: UUID="ca144d66-31b2-4bac-ac7d-db0d6ccb0075" TYPE="ext4"

fstab 파일에 파티션 추가

pi@bpi-iot-ros-ai:~$ sudo vi /etc/fstab

 

# 파티션 추가 
UUID=ca144d66-31b2-4bac-ac7d-db0d6ccb0075 /sd_disk ext4 defaults 0 0
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함