Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 the file system is read only.

BusyBox inside the router has limited commands, so I got a BusyBox binary for MIPs, and uploaded it by tftp:

tftp -g -r busybox-mips my.i.p.addr

I can now use full commands (/var/tmp/busybox-mips command).

There is no ROM inside the router (SDRAM), nor is there any other 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
share|improve this question

migrated from stackoverflow.com Aug 26 '11 at 19:24

This question came from our site for professional and enthusiast programmers.

    
What is the output of mount ? –  Joel F Aug 26 '11 at 12:50
    
Joel i updated my quiestion. sorry for delay, i cant post comments from my office. –  kursat Aug 26 '11 at 21:28

2 Answers 2

Squashfs is immutable. To change /etc/fstab you would need to make a new FS image for your router on a linux box. To get that on the router you do a "firmware upgrade".

You could also look in /proc/mounts to check whether mount is lying to you, as it only reads /etc/mtab. But the latter is in most distros a symbolic link.

share|improve this answer
    
hi Turbo J, I have checked /proc/mounts. It seems mountdisplays only /etc/mtab. I am confused in the "Frimware Upgrade" part. I think if you upgrade the firmware, then the system will still be readonly, won't it? So in my opinion I have to upgrade/change the FS. Do you know how to do that?? –  kursat Sep 5 '11 at 9:01
    
Even wikipedia knows unsquashfs and mksquashfs. Try Google next time. –  Turbo J Sep 6 '11 at 0:48
1  
The filesystem comes from the firmware. You can't modify the filesystem unless you rebuild and reflash the firmware. –  ultrasawblade Aug 9 '13 at 22:35

You might be able to make the thing writable for the current session, but the change will not be persistent: once you reboot, your changes will get lost. To do this, you mount a tempfs somewhere, copy the content of /etc into it, then mount --move it to /etc.

If you need persistent changes, then you'll have to recreate your squashfs. Other answers already include more detail on this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.