Discussion:
"cannot create /boot/grub/grub.cfg.new: Read-only file system" on a Power Mac G5
(too old to reply)
ilko Iliev
2024-08-10 18:50:01 UTC
Permalink
Hello,
Whenever I'm trying to upgrade/install something I get the following errors.
I'd appreciate some pointers as to where to begin as I'm clueless on the matter.

_______________________________________________________________________________________________________ apt-listchanges: Reading changelogs...
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):
installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)
_______________________________________________________________________________________________________ Tried purging as root:

***@debian:~# apt-get purge linux-image-6.1.0-9
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'linux-image-6.1.0-9-powerpc64' for regex 'linux-image-6.1.0-9'
The following packages will be REMOVED:

linux-image-6.1.0-9-powerpc64
0 upgraded, 0 newly installed, 1 to remove and 991 not upgraded.
3 not fully installed or removed.
After this operation, 302 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):

installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

_______________________________________________________________________________________________________ Some info about the system:

***@debian:~# uname -a
Linux debian 6.3.0-1-powerpc64 #1 SMP Debian 6.3.7-1 (2023-06-12) ppc64 GNU/Linux

***@debian:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
#










# / was on /dev/sda3 during installation
UUID=78d8bc92-2c65-4282-86b6-e305a3b8a1e3 /













ext4


errors=remount-ro 0





1
# /boot/grub was on /dev/sda2 during installation
UUID=32bf2d07-b070-372c-b1a5-5e304b1597cb /boot/grub




hfs



defaults






0





2
# swap was on /dev/sda4 during installation
UUID=f59b067e-06eb-40b0-b45b-0928f1945cda none










swap


sw












0





0
/dev/sr0






/media/cdrom0

udf,iso9660 user,noauto



0





0
***@debian:~#
***@debian:~#
***@debian:~# blkid
/dev/sda4: UUID="f59b067e-06eb-40b0-b45b-0928f1945cda" TYPE="swap" PARTLABEL="swap"
/dev/sda2: UUID="32bf2d07-b070-372c-b1a5-5e304b1597cb" LABEL="untitled" TYPE="hfs" PARTLABEL="untitled"
/dev/sda5: PARTLABEL="Extra"
/dev/sda3: UUID="78d8bc92-2c65-4282-86b6-e305a3b8a1e3" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="untitled"
/dev/sda1: PARTLABEL="Apple"
ilko Iliev
2024-08-10 19:00:02 UTC
Permalink
Hello,






Whenever I'm trying to upgrade/install something I get the following errors.



I'd appreciate some pointers as to where to begin as I'm clueless on the matter.




_______________________________________________________________________________________________________


apt-listchanges: Reading changelogs...
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):



installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)



_______________________________________________________________________________________________________


Tried purging as root:







***@debian:~# apt-get purge linux-image-6.1.0-9
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'linux-image-6.1.0-9-powerpc64' for regex 'linux-image-6.1.0-9'
The following packages will be REMOVED:

linux-image-6.1.0-9-powerpc64
0 upgraded, 0 newly installed, 1 to remove and 991 not upgraded.
3 not fully installed or removed.
After this operation, 302 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):

installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)







_______________________________________________________________________________________________________


Some info about the system:







***@debian:~# uname -a
Linux debian 6.3.0-1-powerpc64 #1 SMP Debian 6.3.7-1 (2023-06-12) ppc64 GNU/Linux







***@debian:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
#










# / was on /dev/sda3 during installation
UUID=78d8bc92-2c65-4282-86b6-e305a3b8a1e3 /













ext4


errors=remount-ro 0





1
# /boot/grub was on /dev/sda2 during installation
UUID=32bf2d07-b070-372c-b1a5-5e304b1597cb /boot/grub




hfs



defaults






0





2
# swap was on /dev/sda4 during installation
UUID=f59b067e-06eb-40b0-b45b-0928f1945cda none










swap


sw












0





0
/dev/sr0






/media/cdrom0

udf,iso9660 user,noauto



0





0
***@debian:~#
***@debian:~#
***@debian:~# blkid
/dev/sda4: UUID="f59b067e-06eb-40b0-b45b-0928f1945cda" TYPE="swap" PARTLABEL="swap"
/dev/sda2: UUID="32bf2d07-b070-372c-b1a5-5e304b1597cb" LABEL="untitled" TYPE="hfs" PARTLABEL="untitled"
/dev/sda5: PARTLABEL="Extra"
/dev/sda3: UUID="78d8bc92-2c65-4282-86b6-e305a3b8a1e3" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="untitled"
/dev/sda1: PARTLABEL="Apple"
ilko Iliev
2024-08-10 19:00:02 UTC
Permalink
Hello,






Whenever I'm trying to upgrade/install something I get the following errors.



I'd appreciate some pointers as to where to begin as I'm clueless on the matter.




_______________________________________________________________________________________________________


apt-listchanges: Reading changelogs...
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):



installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)



_______________________________________________________________________________________________________


Tried purging as root:







***@debian:~# apt-get purge linux-image-6.1.0-9
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'linux-image-6.1.0-9-powerpc64' for regex 'linux-image-6.1.0-9'
The following packages will be REMOVED:

linux-image-6.1.0-9-powerpc64
0 upgraded, 0 newly installed, 1 to remove and 991 not upgraded.
3 not fully installed or removed.
After this operation, 302 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):

installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)







_______________________________________________________________________________________________________


Some info about the system:







***@debian:~# uname -a
Linux debian 6.3.0-1-powerpc64 #1 SMP Debian 6.3.7-1 (2023-06-12) ppc64 GNU/Linux







***@debian:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
#










# / was on /dev/sda3 during installation
UUID=78d8bc92-2c65-4282-86b6-e305a3b8a1e3 /













ext4


errors=remount-ro 0





1
# /boot/grub was on /dev/sda2 during installation
UUID=32bf2d07-b070-372c-b1a5-5e304b1597cb /boot/grub




hfs



defaults






0





2
# swap was on /dev/sda4 during installation
UUID=f59b067e-06eb-40b0-b45b-0928f1945cda none










swap


sw












0





0
/dev/sr0






/media/cdrom0

udf,iso9660 user,noauto



0





0
***@debian:~#
***@debian:~#
***@debian:~# blkid
/dev/sda4: UUID="f59b067e-06eb-40b0-b45b-0928f1945cda" TYPE="swap" PARTLABEL="swap"
/dev/sda2: UUID="32bf2d07-b070-372c-b1a5-5e304b1597cb" LABEL="untitled" TYPE="hfs" PARTLABEL="untitled"
/dev/sda5: PARTLABEL="Extra"
/dev/sda3: UUID="78d8bc92-2c65-4282-86b6-e305a3b8a1e3" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="untitled"
/dev/sda1: PARTLABEL="Apple"
Lennart Sorensen
2024-08-11 03:20:01 UTC
Permalink
Post by ilko Iliev
Hello,
Whenever I'm trying to upgrade/install something I get the following errors.
I'd appreciate some pointers as to where to begin as I'm clueless on the matter.
_______________________________________________________________________________________________________ apt-listchanges: Reading changelogs...
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)
So what do you have mounted as /boot and/or /boot/grub?

I know some people in the past very incorrectly mounted their UEFI boot
partion as /boot or /boot/grub and that can be a problem. Of course
that doesn't apply to powerpc so I guess something else is the problem.

If /boot/grub is readonly, then clearly something isn't mounted right.
--
Len Sorensen
ilko Iliev
2024-08-11 11:10:01 UTC
Permalink
Hello Len,
Here's what the mounts are like:

TARGET






















































SOURCE




FSTYPE




OPTIONS
/



























































/dev/sda3

ext4






rw,relatime,errors=remount-ro
├─/sys






















































sysfs





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
├─/proc





















































proc






proc






rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc
































systemd-1

autofs




rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=7525
│

└─/proc/sys/fs/binfmt_misc






























binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime
├─/dev






















































udev






devtmpfs


rw,nosuid,relatime,size=436544k,nr_inodes=6821,mode=755,inode64
│ ├─/dev/pts
















































devpts




devpts




rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/shm
















































tmpfs





tmpfs





rw,nosuid,nodev,inode64
│ ├─/dev/hugepages










































hugetlbfs

hugetlbfs

rw,nosuid,nodev,relatime,pagesize=16M
│ └─/dev/mqueue













































mqueue




mqueue




rw,nosuid,nodev,noexec,relatime
├─/run






















































tmpfs





tmpfs





rw,nosuid,nodev,noexec,relatime,size=98816k,mode=755,inode64
│ ├─/run/lock















































tmpfs





tmpfs





rw,nosuid,nodev,noexec,relatime,size=5120k,inode64
│ ├─/run/user/1000










































tmpfs





tmpfs





rw,nosuid,nodev,relatime,size=98752k,nr_inodes=24688,mode=700,uid=1000,gid=1000,inode64
│ ├─/run/user/107











































tmpfs





tmpfs





rw,nosuid,nodev,relatime,size=98752k,nr_inodes=24688,mode=700,uid=107,gid=116,inode64
│ ├─/run/credentials/systemd-journald.service















ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
│ ├─/run/credentials/systemd-udev-load-credentials.service


ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
│ ├─/run/credentials/systemd-tmpfiles-setup-dev-early.service ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
│ ├─/run/credentials/systemd-sysctl.service

















ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
│ ├─/run/credentials/systemd-tmpfiles-setup-dev.service





ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
│ ├─/run/credentials/systemd-tmpfiles-setup.service









ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
│ └─/run/credentials/***@tty1.service





















ramfs





ramfs





ro,nosuid,nodev,noexec,relatime,nosymfollow,mode=700
├─/tmp






















































tmpfs





tmpfs





rw,nosuid,nodev,nr_inodes=1048576,inode64
└─/boot/grub
















































/dev/sda2

hfs







ro,relatime,uid=0,gid=0
Post by Lennart Sorensen
So what do you have mounted as /boot and/or /boot/grub?
I know some people in the past very incorrectly mounted their UEFI boot
partion as /boot or /boot/grub and that can be a problem. Of course
that doesn't apply to powerpc so I guess something else is the problem.
If /boot/grub is readonly, then clearly something isn't mounted right.
Lennart Sorensen
2024-08-11 21:30:01 UTC
Permalink
Post by ilko Iliev
Hello Len,
<snip things that did not survive plain text well>

/boot/grub /dev/sda2 hfs ro,relatime,uid=0,gid=0

That is certainly mounted readonly (ro) so unless you remount it rw it is not going to be able to update.

I am not sure why that is an hfs volume. Is that normal for grub on
a powermac? I am affraid I have only used other powerpc linux systems
myself. Looking it up a bit it does appear that it is normal to use
hfs for /boot/grub since the firmware has to read grub from there.

You could try doing: mount -o remount,rw /boot/grub

Maybe that will make it read write and hence able to allow grub to update.
--
Len Sorensen
Linux User #330250
2024-08-12 06:40:01 UTC
Permalink
Hello!
Post by Lennart Sorensen
I am not sure why that is an hfs volume. Is that normal for grub on
a powermac? I am affraid I have only used other powerpc linux systems
myself. Looking it up a bit it does appear that it is normal to use
hfs for /boot/grub since the firmware has to read grub from there.
You could try doing: mount -o remount,rw /boot/grub
Maybe that will make it read write and hence able to allow grub to update.
HFS is normal on a PowerMac. OpenFirmware by Apple is searching for a
boot volume in HFS file format.

There are various ways to boot. Mac OS X also had advanced from HFS to
HFS Plus, but OpenFirmware was still using the older HFS, so there is
merely a bootstrap loader on the HFS boot volume that then loads the
actual bootloader from the real boot volume, in the case of Mac OS X
almost always the HFS+ root volume.

Linux can skip this and keep the kernel and the config files on the HFS
volume, but there is also a way to keep them on a separate e.g. ext2 volume.

To understand this, there are various good reads, including this from
Gentoo Linux:
https://wiki.gentoo.org/wiki/GRUB_on_Open_Firmware_(PowerPC)

To modify the HFS volume, Linux never really supported it fully, and
thus there are external tools to safely access the volume, like
hfsutils. From this package you can use hmount and hcopy and so on.

GRUB features a configfile option, which will load an external
(additional) configuration file from any supported volume. The best way
to boot Linux on a PowerMac would be:

1. OpenFirmware looks for a bootable volume in HFS format (types include
"Apple_Boot" and "Apple_Bootstrap") with EXACTLY ONE blessed file on it.
2. On this HFS volume (specifically for Linux) you would install GRUB
with a generic grub.cfg, that uses only the configfile option, which
points to the real /boot partition from Linux.

Example:
/dev/sda1 = HFS bootstrap for Linux, UUID does not matter, grub.cfg
/dev/sda2 = /boot, ext2 (or ext4), note UUID
/dev/sda3 = / for Linux


On /dev/sda1 you'd have:
1. grub.img
2. grub.cfg, as follows:

search --no-floppy --fs-uuid --set=root <UUID from /dev/sda2>
set prefix=($root)/grub
configfile /grub/grub.cfg

3. a CHRP boot script with logo that is blessed (see e.g. Gentoo Wiki)


On /dev/sda2 you'd have your real grub.cfg and your kernels and so forth.

On /dev/sda3 you'd have your Linux.


The PowerMac OpenFirmware has a boot menu which will be displayed when
you hold the Option key (on a PC keyboard it's the Alt key) at the
chime. It will show the logos from the CHRP boot scripts of every HFS
volume it can find of the type Apple_Boot/Apple_Bootstrap with ONE
blessed file on it. ("blessed" is like a file attribute, like in DOS
system or hidden).


OpenFirmware can boot anything of the right format that you specify, but
only on supported volumes (HFS, and I think also FAT16) and only when
you specify the path in the OpenFirmware specific format, either in the
OpenFirmware shell, or in an NVRAM variable "boot-device" that specifies
the default boot loader. There can only be one default boot loader, and
when the NVRAM/PRAM battery is weak or dies, it looses it. It may also
loose it when you boot something else that alters it, like maybe Mac OS.

Therefore the HFS + CHRP script is the best method.


I hope that helps to understand the PowerMac boot process a bit better...

Just my 2¢,
Linux User #330250
ilko Iliev
2024-08-12 10:50:01 UTC
Permalink
Post by Lennart Sorensen
You could try doing: mount -o remount,rw /boot/grub
Maybe that will make it read write and hence able to allow grub to update.
Hi Len,
Thanks for the suggestion but issuing that command didn't change it to 'rw'.
Maybe it's not worth it pursuing it furthers.
Thanks for all the input.
John Paul Adrian Glaubitz
2024-08-12 11:00:02 UTC
Permalink
Post by ilko Iliev
Post by Lennart Sorensen
You could try doing: mount -o remount,rw /boot/grub
Maybe that will make it read write and hence able to allow grub to update.
Thanks for the suggestion but issuing that command didn't change it to 'rw'.
Maybe it's not worth it pursuing it furthers.
Errm, I gave you the exact instructions how to fix your issue. While I appreciate others trying to help, the off-topic texts seem to have buried my answer.

Adrian
ilko Iliev
2024-08-19 12:00:01 UTC
Permalink
Hi Adrian,
Post by John Paul Adrian Glaubitz
# umount /boot/grub
# fsck.hfs -y /dev/sda2
# mount -a
# dpkg-configure -a
Unfortunately that doesn't work because I can't install absolutely anything, it always fails with the same error as stated in OP: sudo apt-get install hfsprogs

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:

linux-image-6.1.0-9-powerpc64
The following NEW packages will be installed:

hfsprogs
0 upgraded, 1 newly installed, 1 to remove and 991 not upgraded.
3 not fully installed or removed.
Need to get 0 B/163 kB of archives.
After this operation, 301 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 131680 files and directories currently installed.)
Removing linux-image-6.1.0-9-powerpc64 (6.1.27-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-9-powerpc64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 270: cannot create /boot/grub/grub.cfg.new: Read-only file system
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-9-powerpc64 (--remove):

installed linux-image-6.1.0-9-powerpc64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:

linux-image-6.1.0-9-powerpc64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
Post by John Paul Adrian Glaubitz

Post by Lennart Sorensen
You could try doing: mount -o remount,rw /boot/grub
Maybe that will make it read write and hence able to allow grub to update.
Thanks for the suggestion but issuing that command didn't change it to 'rw'.
Maybe it's not worth it pursuing it furthers.
Errm, I gave you the exact instructions how to fix your issue. While I appreciate others trying to help, the off-topic texts seem to have buried my answer.



Adrian
Benjamin Cama
2024-08-19 13:10:01 UTC
Permalink
Hi Ilko,
Thanks for the suggestion but regarding: >You must install the
Post by John Paul Adrian Glaubitz
# umount /boot/grub
# fsck.hfs -y /dev/sda2
# mount -a
# dpkg-configure -a
Unfortunately that doesn't work because I can't install absolutely anything, it always fails with the same error as stated in OP: sudo apt-get install hfsprogs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-image-6.1.0-9-powerpc64
That’s what everyone including me missed: that you were first purging
this package for some reason. Either try to re-install it first (but I
suspect it will still try to change the grub config):

apt-get install linux-image-6.1.0-9-powerpc64

Or just download hfsprogs and install it manually:

apt-get install --download-only hfsprogs
sudo dpkg -i /var/cache/apt/archives/hfsprogs*.deb

Or if apt-get still does not work, just download it manually from here:

https://packages.debian.org/search?keywords=hfsprogs

and install it with "dpkg -i" as above.

Then follow Adrian’s advices.

Regards.
-- Benjamin
John Paul Adrian Glaubitz
2024-08-19 13:20:01 UTC
Permalink
Hello,
Post by ilko Iliev
Unfortunately that doesn't work because I can't install absolutely anything,
sudo apt-get install hfsprogs
Then download the package manually and install it with "dpkg".

# apt download hfsprogs
# dpkg -i hfsprogs_540.1.linux3-5+ports_ppc64.deb

Alternatively:

# wget http://ftp.ports.debian.org/debian-ports/pool-ppc64/main/h/hfsprogs/hfsprogs_540.1.linux3-5+ports_ppc64.deb
# dpkg -i hfsprogs_540.1.linux3-5+ports_ppc64.deb

then:

# umount /boot/grub
# fsck.hfs -y /dev/sda2
# mount -a

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
ilko Iliev
2024-08-20 03:20:02 UTC
Permalink
Hello and big thanks to both!
That fixed the issue.
Best wishes,
Ilko

John Paul Adrian Glaubitz
2024-08-12 11:00:02 UTC
Permalink
Post by Lennart Sorensen
You could try doing: mount -o remount,rw /boot/grub
Maybe that will make it read write and hence able to allow grub to update.
No, the problem has a very specific reason which is an unclean HFS filesystem which is why the proper fix is to fsck it.

Please give me at least a few hours to answer when such questions arise to avoid the confusion as seen in this thread.

Adrian
John Paul Adrian Glaubitz
2024-08-11 12:20:01 UTC
Permalink
Hello,
Post by ilko Iliev
Whenever I'm trying to upgrade/install something I get the following errors.
I'd appreciate some pointers as to where to begin as I'm clueless on the matter.
You must install the package “hfsprogs”, then run:

# umount /boot/grub
# fsck.hfs -y /dev/sda2
# mount -a
# dpkg-configure -a

Adrian
Loading...