있는 공유기에 OpenWRT를 설치하는 삽질까지 감당하지는 못하겠고...
OpenWRT가 사전 인스톨되어 있는 공유기를 찾아보던 중
Amazon.com
Enter the characters you see below Sorry, we just need to make sure you're not a robot. For best results, please make sure your browser is accepting cookies.
www.amazon.com
아마존에서 적당한 공유기를 찾았... 다고 생각했는데
알고 보니 2-3만원 정도 더 지불하면 훨씬 좋은 공유기를 고를 수 있었지만
이미 주문한 거 어쩌겠나.
국내 주문이었으면 반품 후 새로 주문하기라도 했겠지만 해외배송 왔다갔다도 너무 귀찮았고 작고 귀여운 맛에 그냥 쓰기로 했다.
내장 Storage가 128MB 였기 때문에 리눅스 패키지 몇 개 깔면 용량이 꽉 차서
Micro SD를 찾아서 꽂은 다음 패키지 설치 기본 영역인 /overlay에 마운트되어 있는 기본 Storage를 umount후 SD 카드를 ext4로 포맷하여 /overlay에 마운트해서 /overlay를 넓게 쓰는 작업을 우선 해주는데 이걸 Extroot라고 부르는 것 같다.
https://openwrt.org/docs/guide-user/additional-software/extroot_configuration
Extroot configuration
Extroot configuration This article relies on the following: * Accessing OpenWrt CLI * Managing configurations * Managing packages * Managing services Introduction This guide describes how to configure OpenWrt to use a storage device (USB or SATA or SD card
openwrt.org
opkg update
opkg install block-mount kmod-fs-ext4 e2fsprogs fdisk
DEVICE="$(sed -n -e "/\s\/overlay\s.*$/s///p" /etc/mtab)"
uci -q delete fstab.rwm
uci set fstab.rwm="mount"
uci set fstab.rwm.device="${DEVICE}"
uci set fstab.rwm.target="/rwm"
uci commit fstab
block info
/dev/mtdblock2: UUID="9fd43c61-c3f2c38f-13440ce7-53f0d42d" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock3: MOUNT="/overlay" TYPE="jffs2"
/dev/sda1: UUID="fdacc9f1-0e0e-45ab-acee-9cb9cc8d7d49" VERSION="1.4" TYPE="ext4"
DEVICE="/dev/sda1"
mkfs.ext4 ${DEVICE}
eval $(block info ${DEVICE} | grep -o -e "UUID=\S*")
uci -q delete fstab.overlay
uci set fstab.overlay="mount"
uci set fstab.overlay.uuid="${UUID}"
uci set fstab.overlay.target="/overlay"
uci commit fstab
mkdir -p /tmp/cproot
mount --bind /overlay /tmp/cproot
mount ${DEVICE} /mnt
tar -C /tmp/cproot -cvf - . | tar -C /mnt -xf -
umount /tmp/cproot /mnt
reboot
매뉴얼대로 하니 한번에 성공했는데,
중간에 (아마도) IP 설정을 변경하면서 뭐가 틀어진건지 Luci GUI가 먹통(정확히는 ID/PW 인증 실패로 로그인 불가) 현상이 발생하여 초기화를 한 뒤부터 삽질의 연속이 시작되었다.
https://old.reddit.com/r/openwrt/comments/duvyxh/cant_log_in_through_chrome_since_update/f7c98vd/
Can't log in through Chrome since update
Please remove the index/modul cache from `luci` into the directories `/tmp/luci-*` connect to your brick via `ssh`...
old.reddit.com
Please remove the index/modul cache from luci into the directories /tmp/luci-*
connect to your brick via ssh [root@192.168.1.1](mailto:root@192.168.1.1)
control the existent of directory via ls -lias /tmp/luci*
If exists this directories then remove it
/etc/init.d/uhttpd stop
rm -fr /tmp/luci-*
/etc/init.d/uhttpd start
Now you should be connect to your brick luci via Webbrowser without errors:
http://192.168.1.1/cgi-bin/luci/admin
https://192.168.1.1/cgi-bin/luci/admin
열심히 구글링을 해서 luci의 캐시도 지워보고
https://hamy.io/post/0016/how-to-properly-remove-luci-from-openwrt/
How to properly remove LuCi from OpenWrt | Hamy - The IT Guy
In this post, we're going to discuss the proper ways of removing LuCi web interface from OpenWrt firmwares for good.
hamy.io
opkg --autoremove remove luci
LuCi 자체를 지워보기도 하고...
별짓을 다했는데 결국 공유기 초기화 후 매뉴얼대로 다시 설정을 하니 마운트가 되기는 했다.
그런데 이번에는 SD카드가 /overlay 영역에 마운트됐다가 리부팅하니 떨어져 나가는 증상 발생.
뒤져보니 /etc/fstab에 이전 SD카드의 UUID가 박혀있어서 현재 UUID로 수정하니 리부팅해도 정상적으로 마운트가 확인되었고...
/overlay 영역도 32GB가 정상적으로 인식되었다.
https://www.nemonein.xyz/2020/07/4014/
Openwrt : Extroot; 외부 드라이브를 root 화. – 바깥 세상으로
www.nemonein.xyz
한글로 써주신 분도 계신데... 영문이어도 초보자들에게는 오피셜 매뉴얼이 좀 쉽지 않나 싶다.
하지만 덕분에
opkg update를 매번 리부팅 때마다 새로 입력해야 했던 이유가 /var/opkg-lists 가 메모리에 저장돼서 생기는 현상임을 알게됐다..
vi /etc/opkg.conf 로 수정시 디스크에 저장할 수 있음.
'Computer > Linux' 카테고리의 다른 글
Synology NAS - Goolgle Photo 백업 설정기 (0) | 2023.09.26 |
---|