Skip to content

Instantly share code, notes, and snippets.

@hsiboy
Last active August 3, 2021 19:51
Show Gist options
  • Save hsiboy/a97509189bb103ec50d2 to your computer and use it in GitHub Desktop.
Save hsiboy/a97509189bb103ec50d2 to your computer and use it in GitHub Desktop.
OpenWrt - increase storage on TP-Link WR703n

Having partitioned and formated (ext4) a usb flash/pen/thumb drive on another linux machine....

install required packages

opkg update
opkg install kmod-usb-storage kmod-fs-ext4 block-mount

check you can see the drive, if not reboot

ls /dev/sd*

create mount, temp directory, copy files

mkdir -p /mnt/sda1
mount /dev/sda1 /mnt/sda1
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf -
umount /tmp/cproot
umount /mnt/sda1

now edit fstab

vi /etc/config/fstab

enable new mount point, and change from /home to /

vi /etc/config/fstab

so it looks like this

config global automount
        option from_fstab 1
        option anon_mount 1

config global autoswap
        option from_fstab 1
        option anon_swap 0

config mount
        option target   /
        option device   /dev/sda1
        option fstype   ext4
        option options  rw,sync
        option enabled  1
        option enabled_fsck 0

config swap
        option device   /dev/sda2
        option enabled  0

then reboot

reboot

When the router comes back up

df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment