Read-only file system - SSH Debugging

After several attempts and many searches I cannot find any solution for my problem:

  • Hassio last version
  • Enabled SSH debugging mode
  • Simple command like mkdir says:

mkdir: can’t create directory ‘aaaa’: Read-only file system

  • I tried to repair the card plugging into another Raspbian but it reports:

fsck -n /dev/sda6

fsck from util-linux 2.32.1
e2fsck 1.44.4 (18-Aug-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks…
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda6

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
or
e2fsck -b 32768

Any idea?

The Hassio HassOS image is not running Raspbian. It is running a custom hypervisor for the Hassio containers. I do not know what filesystem it uses. I guess it is not ext2.

You are right. I mean, on another Raspberry with Raspbian

I tried again with ext4. Same output:

# fsck.ext4 -n /dev/mmcblk0
e2fsck 1.44.4 (18-Aug-2018)
Warning!  /dev/mmcblk0 is in use.
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/mmcblk0

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/mmcblk0

Just another reason why, if you must run Hassio, I recommend a more mature, standardized system like Raspbian Lite.

If I understood correctly, the SSH debugging mode allows full access and of course read&write to filesystem.

Another question is how is it showing write protected and the Hass.io system is working properly … updating files …

Just in case someone is interested on this issue. I tried with a new installed Hassio and the result is the same, no write access

What exactly are you trying to achieve? HassOS is a streamlined, container oriented Linux distribution. It does not have the same file system structure as a generic Linux distribution like Raspbian / Ubuntu, etc.

The partitioning for HassOS is different depending on the target hardware. Raspberry Pi versus ODroid XU4, etc., can have slightly different partitions. I suspect that your /dev/sda6 partition is not formatted with ext4 for the HassOS distribution you are running. Some of the other volumes on that SD card probably are ext4 formatted. The boot partition is likely fat32 (probably /dev/sda1).

The filesystems (except for data and boot) are read-only by default when HassOS is running.

You cannot install arbitrary data or packages like with a generic distribution. You can, however, install docker container based applications using the HassIO add-on subsystem. The SSH add-on itself is a docker container that has access to the underlying system, but it cannot directly modify the base OS either.

If you want to install custom applications into the base OS you can either rebuilt HassOS from scratch using the build scripts published on github or you could create your own add-on that runs as a docker container.

If you don’t want to work within the HassOS contraints, it’s probably a good idea to switch to running Home Assistant via another mechanism. Hassbian might be a good choice: https://www.home-assistant.io/docs/installation/hassbian/installation/

Thanks for your answer and clarification. It was on my mind that doings thing right it was not possible to access filesystem in write mode, it seemed protected by default.

I have just moved to NUC with Ubuntu VM and Hassio, RPi3 was not responding properly, memory +80% and SWAP 100%, several IOWait alerts

Sounds like a good choice.

I also switched away from Raspberry Pi due to limitations with SD cards and memory. I am running HassOS on an ODroid HC1 to get much better performance inside a <10 watt power envelope: double RAM, quadruple the CPU, 5~10X the IO Bandwidth. Still has the same Docker limitations, but I’m OK with that since I have another server.

Your setup is likely much faster than my HC1, of course.

Interesting config for storage intensive needs. I didn’t know your device. Thanks for sharing.

I need access to OS and HassOS don’t give that ability. HassIO above other Linux is perfect for me.