0

I am accessing a device via SSH. I would like to change a file on the www directory, but when attempting to do this it says Read-only file system.

mount gives me some info, but I cannot see any references to www, why www is RO or how www is mounted:

admin@(none):/# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=127752k,nr_inodes=31938,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)

It has nothing to do, but I have permissions to write the file:

drwxr-xr-x   14 admin root          5999 May 27 05:17 www

What could I do?


admin@(none):/# ls -l /
drwxr-xr-x    2 admin root             3 May 27 05:17 asus_jffs
drwxr-xr-x    2 admin root           667 May 27 05:12 bin
drwxr-xr-x    2 admin root             3 May 27 05:17 cifs1
drwxr-xr-x    2 admin root             3 May 27 05:17 cifs2
drwxr-xr-x    5 admin root          1580 Nov  8 18:46 dev
lrwxrwxrwx    1 admin root             7 May 27 05:17 etc -> tmp/etc
lrwxrwxrwx    1 admin root             8 May 27 05:17 home -> tmp/home
drwxr-xr-x    5 admin root             0 Nov  8 20:19 jffs
drwxr-xr-x    3 admin root           402 May 27 05:17 lib
lrwxrwxrwx    1 admin root             9 May 27 05:17 media -> tmp/media
drwxr-xr-x    2 admin root             3 May 27 05:17 mmc
lrwxrwxrwx    1 admin root             7 May 27 05:17 mnt -> tmp/mnt
lrwxrwxrwx    1 admin root             7 May 27 05:17 opt -> tmp/opt
dr-xr-xr-x   97 admin root             0 Jan  1  1970 proc
drwxr-xr-x    7 admin root           766 May 27 05:17 rom
lrwxrwxrwx    1 admin root            13 May 27 05:17 root -> tmp/home/root
drwxr-xr-x    2 admin root          2566 May 27 05:17 sbin
drwxr-xr-x   11 admin root             0 Jan  1  1970 sys
drwxr-xr-x    2 admin root             3 May 27 05:17 sysroot
drwxrwxrwx   12 admin root           880 Nov  8 20:19 tmp
drwxr-xr-x    8 admin root           139 May 27 05:17 usr
lrwxrwxrwx    1 admin root             7 May 27 05:17 var -> tmp/var
drwxr-xr-x   14 admin root          5999 May 27 05:17 www
8
  • According t6o your output '/dev/root' is RO. Can you aqdd the output of ls -l /' to show us if there is a direct link of /www` on /? (If so it would ofc be RO). Please also add if this is a router or not (many of those have root RO on flash, so you would want to add data in another place). – Hennes Nov 8 '16 at 19:17
  • Thanks. No link as you can see in the edit. It is a router. – user1156544 Nov 8 '16 at 19:23
  • www seems re gular directory on ./. And / is mounted RO. Thus you either need to make / RW, or (more likely) tell your webserver to use another directory, e.g. on a mounted USB pendrive or on /tmp/www' (the latter probably being cleaned every reboot, but useful for testing) – Hennes Nov 8 '16 at 19:26
  • Where do you see / is RO? (/dev/root?) Well, I would prefer making / (or just www) RW if there is a way to do it – user1156544 Nov 8 '16 at 19:32
  • 1
    1) Yes, from your output: /dev/root on / type squashfs (ro,relatime). 2) If / is RO then /something on the same filesystem is also going to be RO. And it is likely RO since on a router / is probably on RO flash.. Notice from your output how every filesystem which needs writing seems to be suymlinked to /tmp/. And look at your post to see tmpfs on /tmp type tmpfs (rw,relatime) (RW, READ-WRITE, tempfs). – Hennes Nov 8 '16 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.