Is it possible to make permission changes to a read only file system in linux?

I have a compressed rom file system, to which I require some permission changes to be made.

rootfs: Linux Compressed ROM File System data, little endian size 7360512 version #2 sorted_dirs CRC 0xa71a1ac3, edition 0, 4279 blocks, 942 files

It is a root file system with basic directories like bin, sbin, etc, ... I require certain permission changes to be made in the etc directory to get the system to boot on QEMU.

I have tried to mount the file system with read write privileges but I only get the following:

mount: warning: tmp seems to be mounted read-only.

This is the command I am using:

sudo mount -o remount,rw -t cramfs rootfs tmp
4

1 Answer

No. The filesystem you have is cramfs. That filesystem can't be made read/write.

You will most likely need to extract the filesystem, modify it, and build a new cramfs image. I've not played around with it, but the steps would be something along the lines of:

  1. create a directory on a read/write filesystem.
  2. copy the files from the cramfs filesystem to that directory.
  3. modify the data in the created directory
  4. use a tool like mkcramfs on given directory to make a new compressed image
  5. replace the cramfs file device with the newly created one.
3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like