简体   繁体   中英

How to make squash file system read-write

My RTL8196EU Realtek board having read-only squash file system. How do I make this file system Read-Write.

I have tried mount command

mount -o remount,rw /

But its not fixing the problem.

Help me make a Read-Write squash fs

You can't. squashfs is inherently read-only.

If you want to upload new files, you'll need to create and mount a separate read-write filesystem. If you want to modify the existing files, you'll need to create and (carefully!!) upload a replacement filesystem image.

Squashfs is readonly. Because the entire filesystem is compressed and zipped, before it is written to the storage media. And so making any changes to any files, it will have to be zipped and rewritten to the entire partition again - which is a great waste of effort if done repeatedly. And if the entire filesystem cannot fit into the memory you will need a separate holding storage area to store the intermediate files during compression/decompression - taking up even more unnecessary storage space.

As others have mentioned, you can't mount a squashfs filesystem as read-write. There is however still a way to modify the contents. You will need the squashfs or squashfs-tools package for the [un|mk]squashfs tools.

As root, copy filesystem.squashfs to some empty dir, eg:

$ mkdir /tmp/foo
$ cp /[path]/[filesystem.squashfs] /tmp/foo
$ cd /tmp/foo

Unpack the squashfs-file:

$ unsquashfs [filesystem.squashfs]

Enter the squashfs-root directory and modify it to you liking and then recreate filesystem.squashfs :

$ cd /tmp/foo
# Do your thing here
$ mksquashfs squashfs-root [filesystem.squashfs] -comp xz

Copy the newly created filesystem.squashfs over the existing one.

$ cp /tmp/foo/[filesystem.squashfs] /[path]/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM