4

I want to change some files on my router. Firstly i can change everything in /var, but i want to change /etc/fstab. when i try to change it, i get an error message that says filesystem is read only.

Busybox inside router, has limited commands, so i had got busybox binary for mips http://www.busybox.net/downloads/binaries/1.19.0/busybox-mips, and upload it by tftp (tftp -g -r busybox-mips my.i.p.addr), so now i can use full commands (/var/tmp/busybox-mips command).

There is no rom inside router (sdram), or there is no another partition. it must be related with busybox.

# /var/tmp/busybox-mips df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 1344      1344         0 100% /

# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw,nodiratime)
ramfs on /var type ramfs (rw)
# 



Model: 
        Airties 5021
Processor:
        BCM6332KFBG
        HS1037 P12
        994981 N1
Memory: 
        M12L64164A-7T (SDRAM)
        ANM1P02HL 1028
VividD
  • 123
  • 8
0xmtn
  • 240
  • 1
  • 2
  • 7

2 Answers2

10

This isn't related to BusyBox. BusyBox is a set of unix utilities designed for low-resource environments such as routers. Your router's root filesystem is mounted read-only because it's stored on SquashFS, a compressed filesystem which cannot be written to. A SquashFS filesystem is compressed in one go when the filesystem is built and cannot be modified afterwards.

Such routers generally run a variant or derivative of DD-WRT. Most variants have another filesystem on the side, usually JFFS, which is writable. It looks like yours is completely locked down. Check if there's an option somewhere to “unlock” an extra filesystem (it could be an option in NVRAM that you can set through the web interface, or with the nvram utility if you have one). If you don't find a way in, consider installing an alternate firmware, such as OpenWRT, DD-WRT, Tomato, … (check that your particular router model is supported before starting the installation).

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
0

use unionfs and create some small MB size partition and with unionfs attached both partition and make r/o partition also r/w