2

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
  • You will likely have to provide more information. What are you trying to mount and what are the mount options you are trying (your exact mount command) ?
    – Silbee
    May 28, 2021 at 9:28
  • I have added some more information, I hope it is helpful
    – dev
    May 28, 2021 at 9:38
  • That was indeed very helpful :)
    – Silbee
    May 28, 2021 at 10:13
  • You could also work around the permissions issue by mounting tmp as a tmpfs on boot, but without knowing more about what's booting, I'm unsure as to how you would do this.
    – Lawrence
    May 28, 2021 at 14:16

1 Answer 1

5

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
  • Are there any suggested tools that I can use for extraction? I have tried binwalk, but for some reason, that does not extract all the directories.
    – dev
    May 28, 2021 at 10:50
  • Mount it read-only, then use something like rsync , or even the ancient cpio -p on it. May 28, 2021 at 20:44
  • rsync worked, thank you much!
    – dev
    May 29, 2021 at 6:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .