The ZB2 boots without issues. The attached drives – 2 SATA HDs and 2 m.2 – are there but I can’t create mount points so I can’t access them. Commands error out saying the hard drive is read-only. Suggestions anyone?
Most likely the kernel has forced the disk into read-only to protect it, not a ZimaOS issue.
Usually happens from:
- disk errors / bad sectors
- unsafe shutdown
- filesystem corruption
Quick checks:
lsblk -o NAME,FSTYPE,MOUNTPOINT,RO
dmesg | grep -i read-only
If you see RO=1 or errors, run a repair (replace sdX1):
umount /dev/sdX1
fsck.ext4 -f /dev/sdX1
(or ntfsfix if NTFS)
Also worth checking disk health:
smartctl -a /dev/sdX
If you can share lsblk + dmesg, we can tell straight away if it’s filesystem or failing disk.
Thanks for this. Here’s the output from lsblk and dmesg:
neil@ZimaBoard2:/ ➜ $ lsblk -o NAME,FSTYPE,MOUNTPOINT,RO
NAME FSTYPE MOUNTPOINT RO
loop0 squashfs 1
loop1 squashfs 1
loop2 squashfs 1
loop3 squashfs 1
loop4 squashfs 1
loop5 squashfs 1
mmcblk0 0
├─mmcblk0p1 vfat /mnt/boot 0
├─mmcblk0p2 squashfs 0
├─mmcblk0p3 squashfs / 0
├─mmcblk0p4 0
├─mmcblk0p5 0
├─mmcblk0p6 0
├─mmcblk0p7 ext4 /mnt/overlay 0
└─mmcblk0p8 ext4 /DATA 0
mmcblk0boot0 1
mmcblk0boot1 1
zram0 0
zram1 0
zram2 0
neil@ZimaBoard2:/ ➜ $ dmesg | grep -i read-only
[ 0.733422] Write protecting the kernel read-only data: 28672k
I’m at a loss for which device to umount. Here’s the output from findmnt:
$ findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mmcblk0p3 squashfs ro,relatime,errors=continue
├─/dev devtmpfs devtmpfs rw,relatime,size=8056372k,nr_inodes=2014093,mode=755
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime
│ └─/dev/hugepages hugetlbfs hugetlbfs rw,nosuid,nodev,relatime,pagesize=2M
├─/proc none proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/fs/nfsd nfsd nfsd rw,relatime
├─/sys none sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup cgroup2 cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot
│ ├─/sys/fs/bpf bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700
│ ├─/sys/kernel/tracing tracefs tracefs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/debug debugfs debugfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime
│ └─/sys/kernel/config configfs configfs rw,nosuid,nodev,noexec,relatime
├─/mnt/overlay /dev/mmcblk0p7 ext4 rw,relatime
├─/etc overlayfs overlay rw,relatime,lowerdir=/etc,upperdir=/mnt/overlay/upper_etc,workdir=/mnt/ove
├─/run tmpfs tmpfs rw,nosuid,nodev,size=3223772k,nr_inodes=819200,mode=755
│ ├─/run/credentials/systemd-journald.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-tmpfiles-setup-dev-early.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-tmpfiles-setup-dev.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-network-generator.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-udev-load-credentials.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-vconsole-setup.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-sysctl.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/credentials/systemd-tmpfiles-setup.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
│ ├─/run/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
│ └─/run/credentials/systemd-networkd.service
│ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode
├─/tmp tmpfs tmpfs rw,nosuid,nodev,nr_inodes=1048576
├─/var tmpfs tmpfs rw,nosuid,nodev,relatime,nr_inodes=1048576
│ ├─/var/lib/rauc /dev/mmcblk0p7[/var/lib/rauc]
│ │ ext4 rw,relatime
│ ├─/var/lib/zerotier-one /dev/mmcblk0p7[/var/lib/zerotier-one]
│ │ ext4 rw,relatime
│ ├─/var/lib/casaos_data /dev/mmcblk0p8 ext4 rw,relatime,commit=30
│ ├─/var/lib/casaos /dev/mmcblk0p8[/.casaos]
│ │ ext4 rw,relatime,commit=30
│ ├─/var/lib/bluetooth /dev/mmcblk0p8[/.bluetooth]
│ │ ext4 rw,relatime,commit=30
│ ├─/var/lib/docker /dev/mmcblk0p8[/.docker]
│ │ ext4 rw,relatime,commit=30
│ ├─/var/lib/extensions /dev/mmcblk0p8[/.extensions]
│ │ ext4 rw,relatime,commit=30
│ ├─/var/log /dev/mmcblk0p8[/.log]
│ │ ext4 rw,relatime,commit=30
│ ├─/var/lib/icewhale /dev/mmcblk0p8[/.icewhale]
│ │ ext4 rw,relatime,commit=30
│ └─/var/lib/libvirt /dev/mmcblk0p8[/.libvirt]
│ ext4 rw,relatime,commit=30
├─/mnt/boot /dev/mmcblk0p1 vfat rw,relatime,sync,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,sh
├─/DATA /dev/mmcblk0p8 ext4 rw,relatime,commit=30
├─/media /dev/mmcblk0p8[/.media]
│ ext4 rw,relatime,commit=30
├─/opt /dev/mmcblk0p8[/.opt]
│ ext4 rw,relatime,commit=30
└─/usr sysext overlay ro,nodev,relatime,lowerdir=/run/systemd/sysext/meta/usr:/run/systemd/sysex
Good info, I believe this isn’t a read-only issue at all.
Everything important is mounted rw, and the only read-only parts are the normal ZimaOS squashfs. Nothing there is wrong.
What stands out is I don’t see any of your SATA or M.2 drives in lsblk — only the internal eMMC.
I suggest checking if the drives are even being detected:
lsblk
dmesg | grep -i sata
dmesg | grep -i nvme
If nothing shows up, I’d look at cables, power, or seating, because right now it looks like the drives aren’t being seen at all.
Sorry, I should have mentioned that by that point I’d taken the SATA and m.2 drives off the ZB2 (after re-seating cables and testing). Those drives when connected are detected by lsblk.
Further poking around has revealed that while I can write to /tmp (drwxrwxrwt) I cannot write to /home (drwxr-xr-x) or any other subdir that I try. For example:
neil@ZimaBoard2:/home ➜ $ sudo touch test.txt
touch: cannot touch ‘test.txt’: Read-only file system
Since I am able to write to /tmp then clearly the whole FS is not in read-only mode (as you point out). But why then do I get a Read-only error when I try to mount a drive?
Maybe it’s a user permissions issue? But ZimaOS doesn’t recognize the su command and that’s about as far as I can go with my level of expertise.
Do you have any further suggestions? With thanks.
[edit] To be clear (in case it matters) when I say “mount a drive” the drives in question (SATA) are in a ZFS pool, and I’m using the zpool command to ‘mount’ them. This command is giving a Read-only error when it tries to make the mount point. I did also try to mount a stand alone m.2 drive but ZimaOS does not seem to support gdisk and, again, that’s where my knowledge hits the wall.
Ahh yep, this makes more sense now.
I believe the issue isn’t the disk, it’s where you’re trying to write/mount.
ZimaOS uses an immutable root (overlay system), so paths like /home are effectively read-only, even if they don’t look it.
That’s why:
/tmpworks (tmpfs)/homefails (not writable in this OS design)
I suggest you only use writable paths, mainly:
/DATA
Try creating your mount point there instead:
mkdir -p /DATA/zfs_mount
Then run your zpool mount again targeting that path.
Same applies to anything else, don’t use:
/home/mnt(sometimes ok, sometimes not depending on overlay)
Stick with /DATA , that’s the only guaranteed writable location on ZimaOS
That explains everything. Thank you for the help.