메뉴 건너뛰기

KIM0.COM

처음에 /dev/sda usb저장소를 /dev/sda1 (fdisk로 포맷하고 파티션 만들어야함) df로 확인가능


ext4로 파티션만들어져있으면 그냥 포맷하고 시작
////////////////////// 
umount /dev/sda1
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt/sda1
/////////////////////////

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

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