You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2022-11-28-mac-hfsplus-boot-partition-read-only.md
+143-3Lines changed: 143 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ categories: mac arch boot
9
9
10
10
A few weeks ago I set up a local server to manage my 3d printer and home assistant instance with an old mac system. In order for the mac to boot properly, I needed to use HFS+ for the /boot partition. I used this excellent tutorial to do that: https://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/.
11
11
12
-
However today, after upgrading the kernel (this will matter later) and rebooting, I was left with this rather cryptic message:
12
+
However today, after upgrading the kernel (this will matter later) and rebooting, I was left with this rather cryptic message:
13
13
14
14
```
15
15
Starting systend-udevd version 252.1-2-arch
@@ -28,7 +28,7 @@ My USB keyboard wasn't recognized as well so I couldn't investigate just from th
28
28
So I mount `/` and `/boot` and chroot inside. Initially everything seemed fine, but trying to run `mkinitcpio` was outputing errors that seemed to tell that something was off with the `/boot` partition. Some forum posts were telling "your boot partition isn't mounted", and I was like "but I just did". More investigation was needed. Maybe I was just using `mkinitcpio` wrong. Let's just try `pacman -S linux` because the hooks should run everything again anyway.
29
29
30
30
```
31
-
# sudo pacman -S linux
31
+
# sudo pacman -S linux
32
32
warning: linux-6.0.10.arch2-1 is up to date -- reinstalling
@@ -73,3 +73,143 @@ Hopefully, we should be able to prevent that by running `fsck` on each boot. Tha
73
73
We can do this by adding the `fsck.mode=force` kernel parameter.
74
74
75
75
Also, next time, actually checking the update ran successfully before rebooting will help ;)
76
+
77
+
# Update 2025-08-31: It happened again!
78
+
79
+
Three years later, and I hit the same issue during a system update. This time I saw the update fail, and thought I could fix it by running `fsck.hfsplus` and remounting the partition. Let me walk you through what happened:
80
+
81
+
```
82
+
:: Running pre-transaction hooks...
83
+
(1/3) etckeeper: pre-transaction commit
84
+
[master af46571] saving uncommitted changes in /etc prior to pacman run
85
+
5 files changed, 3 insertions(+), 1 deletion(-)
86
+
(2/3) Removing linux initcpios...
87
+
rm: cannot remove '/boot/initramfs-linux-fallback.img': Read-only file system
88
+
rm: cannot remove '/boot/initramfs-linux.img': Read-only file system
89
+
rm: cannot remove '/boot/vmlinuz-linux': Read-only file system
Still read-only! And the kernel log keeps saying the same thing:
146
+
147
+
```
148
+
❯ sudo dmesg | grep hfs
149
+
[2686028.481168] hfsplus: filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. leaving read-only.
150
+
[2686273.749134] hfsplus: filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. leaving read-only.
151
+
```
152
+
153
+
At this point I tried the force flag too but it didn't find any issues either. I found [a thread on the Arch forums](https://bbs.archlinux.org/viewtopic.php?id=227493) that unmounts first, then remounts:
154
+
155
+
```
156
+
❯ sudo umount /boot
157
+
❯ sudo mount -t hfsplus -o force,rw /dev/sda1 /boot
(1/1) checking for file conflicts [#########################] 100%
182
+
(1/1) checking available disk space [#########################] 100%
183
+
:: Running pre-transaction hooks...
184
+
(1/2) Removing linux initcpios...
185
+
rm: cannot remove '/boot/initramfs-linux-fallback.img': Read-only file system
186
+
rm: cannot remove '/boot/initramfs-linux.img': Read-only file system
187
+
rm: cannot remove '/boot/vmlinuz-linux': Read-only file system
188
+
error: command failed to execute correctly
189
+
```
190
+
191
+
Still hitting the read-only issue but at this point the initramfs should match.
192
+
193
+
Sadly after rebooting, the Mac wasn't showing up on the network. I connected a screen (after grumbling my way to the office) and sadly took notice that it's actually booting with `linux-zen` by default, not the regular `linux` kernel!
194
+
195
+
I selected the regular `linux` kernel from GRUB's advanced boot menu, and the system booted properly. And to my surprise, when I checked the file system:
196
+
197
+
```
198
+
❯ grep "[[:space:]]ro[[:space:],]" /proc/mounts
199
+
```
200
+
201
+
No more read-only `/boot`! It was now mounted read-write. I'm not sure why a simple reboot fixed it when `fsck` didn't, but I'll take it.
202
+
203
+
I completed the upgrade by reinstalling `linux-zen` and `linux` (which I downgraded earlier):
204
+
205
+
```
206
+
❯ sudo pacman -S linux-zen linux
207
+
warning: linux-zen-6.16.4.zen1-1 is up to date -- reinstalling
208
+
```
209
+
210
+
After the reinstall completed successfully and all the initramfs files were correctly generated, another reboot got me back to the usual `linux-zen` kernel.
211
+
212
+
So, a few takeaways:
213
+
1. The `fsck.mode=force` kernel parameter I added earlier clearly didn't fully solve the issue, and I have no logs to explain why.
214
+
2. Sometimes a reboot is still needed, even after running fsck manually
215
+
3. Having multiple kernels installed is a lifesaver if they're not updated at the same time (but you still need a keyboard/screen to select it)
0 commit comments