usb 드라이버 설치
usb를 usb포트에 삽입합니다.
opkg update
opkg install kmod-usb-storage
usb가 올바르게 인식하는지 확인
opkg install usbutils
lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
정상적으로 usb가 인식이 된 경우 위와같이 표시되며 Class = Mass Storage는 연결된 USB 장치를 xhci는 usb3.0, ehci는 usb2.0, uhci 또는 ohci는 usb1.0을 나타냅니다.
usb가 인식되지 않는다면 기본적인 usb 드라이버가 설치되어 있지 않으므로 드라이버 추가 설치 합니다.
opkg install kmod-usb-core kmod-usb2 kmod-usb3
insmod ehci-hcd
insmod xhci-hcd
usb 디스크 파티션 인식하는지 확인
ls -al /dev/sd*
brw------- 1 root root 8, 0 Jan 1 1970 /dev/sda
brw------- 1 root root 8, 1 Oct 14 08:39 /dev/sda1
기존 파티션 정보를 확인
opkg install block-mount
block info | grep /dev/sd
/dev/sda1: UUID="ce6a01c5-e09f-49fc-9f5c-67bd970faa73" VERSION="1.0" TYPE="ext4"
파티션 생성
위에서 파티션(예 : "/dev/sda1", "/dev/sda2", "/dev/sdb1"…) 정보가 나오지 않는다면 파티션 생성
opkg install gdisk
gdisk /dev/sda
파일시스템 드라이버 설치
ext4 파일 시스템 드라이버를 설치
opkg install e2fsprogs
opkg install kmod-fs-ext4
포멧
포멧이 안된 장치는 파일 시스템을 만들기 위해 포멧합니다.
mkfs.ext4 /dev/sda1
ls -al /mnt/sda1
파티션 자동 마운트
block detect | uci import fstab
uci set [email protected][-1].enabled='1'
uci set [email protected][0].check_fs='1'
uci commit fstab
cat /etc/config/fstab
config global option anon_swap '0' option anon_mount '0' option auto_swap '1' option auto_mount '1' option delay_root '5' option check_fs '1' config mount option target '/mnt/sda1' option uuid 'ce6a01c5-e09f-49fc-9f5c-67bd970faa73' option enabled '1'
usb 드라이브에 접근가능 여부 확인
block info
/dev/sda1: UUID="ce6a01c5-e09f-49fc-9f5c-67bd970faa73" VERSION="1.0" MOUNT="/mnt/sda1" TYPE="ext4
서비스 등록
/etc/init.d/fstab boot