Discussion:
Can't upgrade kernel or GRUB: /boot/grub is a read-only filesystem
(too old to reply)
Ben Westover
2023-05-08 01:00:01 UTC
Permalink
Hello,

When I ran apt upgrade on my iMac G3, the kernel and GRUB packages
failed to configure. The step that failed in each case was update-grub
or grub-install, which failed when trying to write to the /boot/grub HFS
partition because it's a "Read-only filesystem."

Investigating /etc/fstab, even though it doesn't say to mount that
partition read-only, it was mounted as "ro,relatime,uid=0,gid=0". I
tried running `mount -o remount,rw`, but it still mounted as read-only.
I also tried mounting it in a non-Debian live environment [1], using the
rw option explicitly, but it was still mounted with those same options.

It now makes sense why writing to the disk fails, as it seems any HFS
mount is automatically read-only, but why is this only now breaking
kernel upgrades? It can't have been a recent change to HFS mounting,
since my live environment's ISO was from December 2022. Does anyone know
what the problem here could be?

Thanks,
--
Ben Westover

[1] https://archlinuxpower.org
Bob McGowan
2023-05-08 02:00:01 UTC
Permalink
I would suggest you run an fsck on the filesystem and see if there are
any problems.

Filesystems may be considered "required" for the system to function and
be mounted read-only when problems are detected, to prevent further
problems from developing while allowing the system to run.

Bob
Post by Ben Westover
Hello,
When I ran apt upgrade on my iMac G3, the kernel and GRUB packages
failed to configure. The step that failed in each case was update-grub
or grub-install, which failed when trying to write to the /boot/grub
HFS partition because it's a "Read-only filesystem."
Investigating /etc/fstab, even though it doesn't say to mount that
partition read-only, it was mounted as "ro,relatime,uid=0,gid=0". I
tried running `mount -o remount,rw`, but it still mounted as
read-only. I also tried mounting it in a non-Debian live environment
[1], using the rw option explicitly, but it was still mounted with
those same options.
It now makes sense why writing to the disk fails, as it seems any HFS
mount is automatically read-only, but why is this only now breaking
kernel upgrades? It can't have been a recent change to HFS mounting,
since my live environment's ISO was from December 2022. Does anyone
know what the problem here could be?
Thanks,
--
Ben Westover
[1] https://archlinuxpower.org
Ben Westover
2023-05-08 02:20:01 UTC
Permalink
Hi Bob,
Post by Bob McGowan
I would suggest you run an fsck on the filesystem and see if there are
any problems.
Filesystems may be considered "required" for the system to function and
be mounted read-only when problems are detected, to prevent further
problems from developing while allowing the system to run.
I had already run generic fsck on the filesystem, and it ran without any
meaningful output, so I assumed it was clean. It turns out the real
fsck.hfs program is inside the hfsprogs packages, not installed by
default, instead of the hfsutils package that every new install comes
with. One fsck.hfs later, the filesystem was repaired and became
writable again. I wish either that the hfsprogs package was installed by
default on powerpc, since it seems to be pretty important to have, or at
least the system did something to tell me there was a problem other than
just silently mounting it read-only.

Thanks for your suggestion!
--
Ben Westover
Paul Wise
2023-05-08 02:20:02 UTC
Permalink
Possibly the filesystem is damaged, I suggest you check dmesg for
errors when mounting it read-write and check the filesystem using the
fsck tool from the hfsprogs package in your live environment.
--
bye,
pabs

https://wiki.debian.org/PaulWise
Ben Westover
2023-05-08 02:30:01 UTC
Permalink
Hello,
Post by Paul Wise
Possibly the filesystem is damaged, I suggest you check dmesg for
errors when mounting it read-write and check the filesystem using the
fsck tool from the hfsprogs package in your live environment.
Yep, you were right. If I had just checked dmesg, I would've found this
out sooner.

Thanks,
--
Ben Westover
John Paul Adrian Glaubitz
2023-05-08 08:10:01 UTC
Permalink
Hello!
Post by Ben Westover
When I ran apt upgrade on my iMac G3, the kernel and GRUB packages
failed to configure. The step that failed in each case was update-grub
or grub-install, which failed when trying to write to the /boot/grub HFS
partition because it's a "Read-only filesystem."
Please install the hfsprogs package, then run fsck.hfs on the affected
partition.
Post by Ben Westover
It now makes sense why writing to the disk fails, as it seems any HFS
mount is automatically read-only, but why is this only now breaking
kernel upgrades? It can't have been a recent change to HFS mounting,
since my live environment's ISO was from December 2022. Does anyone know
what the problem here could be?
It's a known problem and can be fixed by running fsck.hfs. In the future,
it would be nice if we could switch the /boot/grub partition to FAT32
as it should be supported by the NewWorld firmware.

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Loading...