2

I made an IMG-File of my LibreELEC and now i want to edit it on my Windows machine.

I need to make changes in the /etc-Folder and I can't do that live on the system since LibreELEC is read-only FS.

So I opened the img-File with 7-zip and there is no /etc-Folder. It seems as this is the /storage-Folder!

7zip

Any suggestions where I can find and edit the /etc-Folder?

  • Hello, can you add to some details on how you created your IMG file to your question? From your screenshot it looks like you're in some sort of nested archive rather than an actual disk image (LibreELEC_Backup.img\1.img). Is there a LibreELEC_Backup.img\0.img or ..\2.img that might be other partitions of the disk? – Roger Jones May 22 at 15:33
  • Well there is 1.img but this is the boot partition and there is 3 - without any file Extension, maybe it is the swap file – Michael Gierer May 24 at 4:45
2

libreELEC uses a squashfs filesystem. This is a compressed read only filesystem. Because it is a sophisticated Linux method, I don't believe that you can manage it with MS Windows in any way. You should have to use Linux, maybe a live CD from Ubuntu or Debian if you haven't a running Linux system.

Another problem is that, if you are logged in to your libreELEC with ssh, you cannot do the work on the squashfs image, because there are not the needed tools to manage it. So you have to pull out the SD Card of your RasPi and attach it with a card reader to your Linux computer. Now you are able to mount its partitions. You only need the first partition if the SD Card is attached for excample as /dev/sdb:

pc ~$ sudo mkdir /mnt/p1
pc ~$ sudo mount /dev/sdb1 /mnt/p1

Then you will find the squashfs filesystem in the image /mnt/p1/SYSTEM and its checksum in /mnt/p1/SYSTEM.md5. Check with:

pc ~$ sudo file /mnt/p1/SYSTEM
/mnt/p1/SYSTEM: Squashfs filesystem, little endian, version 4.0, 131633489 bytes, 10022 inodes, blocksize: 524288 bytes, created: Sat May  4 18:29:03 2019

Now you are able to modify it. How to do it you can look at Mounting a squashfs filesystem in read-write. Here is a copy it:


Quote:
As root, copy filesystem.squashfs to some empty dir, e.g.:

cp /mnt/clonezilla/live/filesystem.squashfs /path/to/workdir
cd /path/to/workdir

Unpack the file then move it somewhere else (so you still have it as a backup):

unsquashfs filesystem.squashfs
mv filesystem.squashfs /path/to/backup/

Go in squashfs-root, add/modify as per your taste then recreate filesystem.squashfs:

cd /path/to/workdir
mksquashfs squashfs-root filesystem.squashfs -b 1024k -comp xz -Xbcj x86 -e boot

copy the newly created filesystem.squashfs over the existing one on your USB drive, e.g.:

cp filesystem.squashfs /mnt/clonezilla/live/

then reboot and use your LIVE USB.

Note: the above commands are part of squashfs-tools.
End quote


I do not have verified the quoted instructions. It's up to you ;-)
I think when you have created the new /mnt/p1/SYSTEM you have to make its checksum in /mnt/p1/SYSTEM.md5.

  • Well, i took the image via Win32DiskImager. But the statement you gave about destroying the /etc folder is not true, since LibreElec uses a Read-only system and you cannot alter anything under these folders, also not with root! – Michael Gierer May 24 at 4:44
  • @MichaelGierer You are right. I haven't realized that there is running a compressed read only squashfs filesystem. I have updated my answer. – Ingo May 24 at 10:17
0

Install partitionguru application in ur windows pc. Then insert your rpi sd card and u will find boot and primary disks in the left panel open primary. Open your folder and u can edit or delete the file as you wish.image of partition guru

  • Are you sure that you can open a compressed read only squashfs image within an image with partitionguru on MS Windows? Have you tried it? – Ingo May 24 at 19:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.