Remount linux filesystem from ro to rw
SquashFS is a read-only file system.
https://en.wikipedia.org/wiki/SquashFS
You could create a new filesystem and copy the contents of the squashfs to that. To do that, you need to:
- Backup your data from the old filesystem
- Start from a Live-CD/USB
- Make a new Filesystem on /dev/mtdblock3
- Copy your data to the new filesystem
Instead of booting from a Live-CD you could create the new filesystem on another partition/drive.
You have then to make sure your OS uses that new filesystem. Typically this is achieved by changing the corresponding line in /etc/fstab, but in your case this seems to be not the case. You have to find out where the root filesystem is mounted and change it there.
- Reboot
Related videos on Youtube
Sebastian Rockefeller
Updated on September 18, 2022Comments
-
Sebastian Rockefeller over 1 year
I need to remount my linux filesystem from ro to rw. But nothing gonna work. I will be very grateful if someone help me.
# mount /dev/mtdblock3 on / type squashfs (ro) proc on /proc type proc (rw) ramfs on /tmp type ramfs (rw) devpts on /dev/pts type devpts (rw) none on /tmp/netslink type ramfs (rw) # cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root / squashfs ro 0 0 proc /proc proc rw 0 0 ramfs /tmp ramfs rw 0 0 devpts /dev/pts devpts rw 0 0 none /tmp/netslink ramfs rw 0 0
I tried this:
# mount -o rw,remount -t squashfs /dev/root / mount: Mounting /dev/root on / failed: Permission denied
And I tried this:
# mount -o rw,remount -t squashfs /dev/mtdblock3 / Command "mount -o rw,remount -t squashfs /dev/mtdblock3 /" is forbidden!
And just this:
# mount -o rw,remount / Can't find / in /etc/fstab
/etc/fstab:
# cat /etc/fstab proc /proc proc defaults 0 0 ramfs /tmp ramfs defaults 0 0 devpts /dev/pts devpts defaults 0 0
The system doesn't have the root user, but have the root group and I do it by the user which consists in the root group, is it not enough?
What is the right solution? Thanks!
-
Mathieu over 8 yearsDid you try to remout with sudo? Could you post your /etc/fstab file.
-
Sebastian Rockefeller over 8 yearsAdded the /etc/fstab file content in the question above. There is no sudo command in the target system
-
-
Sebastian Rockefeller over 8 yearsThanks for the answer, so what could be done to make it rw?
-
tastytea over 8 yearsYou can't make the filesystem rw. You can make a new filesystem and copy the contents of the squashfs to that.
-
Sebastian Rockefeller over 8 yearsIs it possible to do this if the target host is far away from me, and I'm working through the ssh? If yes, could you please send some links how to do this :)
-
tastytea over 8 yearsUpdated answer. Since you are working with the root fs, I strongly recommend beeing in physical proximity.
-
Sebastian Rockefeller over 8 yearsThanks for the update, it helped a lot. But I don't have an ability to being in physical proximity for the near future. Is it possible to do this remotely in any possible way?
-
tastytea over 8 yearsYes, if you have a free partition, see my answer. You can't overwrite /dev/mtdblock3 while it's beeing used.