0

I have the following situation with which I need some help.

I have a Linux-based OS running on a RaspberryPi Compute Module. The system was shutdown abruptly, which led to an issue where now the boot process keeps looping endlessly. This is because of a systemd service which cannot startup.

My approach to interrupting the endless loop is to try and disable the systemd service from starting up, by mounting the Compute Module and removing the systemd symlink. But here comes my problem:

The system is divided into several partitions, one of which (the root partition) is ReadOnly (squashfs). On this root partition is the /etc/systemd/system folder where I want to remove the symlink to the problematic service, so I can disable it.

My question is: How do I go about making changes to this ReadOnly partition so I can disable the systemd service?

Alternatives are also welcomed.

Gabriel Ruiu
  • 113
  • 3
  • By remounting it `rw`. See `man mount` for more info – Panki Dec 03 '19 at 09:21
  • I have tried `sudo mount -v -o rw,remount -t squashfs /dev/sdb3 /media/user/disk` but it doesn't do anything. The output from `mount` still lists the partition as readonly – Gabriel Ruiu Dec 03 '19 at 09:32
  • Did you `umount` it first before trying? – Panki Dec 03 '19 at 09:32
  • No, I did not. Will try now – Gabriel Ruiu Dec 03 '19 at 09:34
  • Doesn't seem to work. It looks like this only functions if the partition is already mounted, which was the case the first time I tried. The following is the output I get when trying to remount the unmounted partition: ``` $ sudo mount -o remount,rw /dev/sdb3 /media/user/disk/ mount: /media/user/disk: mount point not mounted or bad option. ``` – Gabriel Ruiu Dec 03 '19 at 09:41
  • Drop the `remount` flag, you're trying to mount it new – Panki Dec 03 '19 at 09:43
  • Dropped the `remount` flag, and the partition is till mounted as readonly. /dev/sdb3 on /media/user/disk type squashfs (ro,relatime) – Gabriel Ruiu Dec 03 '19 at 09:46
  • This [answer](https://unix.stackexchange.com/a/80312/332764) explains how to modify a squashfs image. You could create a new image without the symlink and replace the original image. Then fix the issue, shutdown the system properly and replace the modified image with the original. – Freddy Dec 03 '19 at 09:54
  • @Freddy the post you gave me unfortunately doesn't 100% fit to my situation. In my case, there is no .squashfs file which has to be modified, it's the squashfs *partition* which is mounted already. Thank you for the suggestion though – Gabriel Ruiu Dec 03 '19 at 11:28

0 Answers0