On Sun, Dec 30, 2018 at 9:54 PM Frank Scheiner <frank.schei...@web.de> wrote: > > Dear all, > > I experienced some major problems with hfsprogs on G5 Power Macs. > > Once in a while (already seen multiple times on 11,2 and 7,3 type Power > Macs) the OS refuses to mount the NewWorld bootstrap - or simply HFS - > partition that hosts the GRUB installation at startup in read-write > mode. Trying to check the HFS with `fsck.hfs` always leads to > segmentation faults (details below). > > So one actually cannot repair that issue from a G5 - or maybe not even > any issue with an HFS at all, because the same also happens when trying > to check a clean HFS with `fsck.hfs`. The result is that an existing > GRUB installation can no longer be upgraded on a G5 as soon as someone > hits that problem. Actually I'm also unsure if my HFS problems were > created by an unclean shutdown at all. > > One could solve this by recreating the HFS partition from scratch and > restoring the contents (incl. file blessing and file types (i.e. > `tbxi`)). Or maybe by rewriting a `dd`ed image from a clean HFS - if you > have one at hand. Trying to repair the partition with `fsck.hfs` from a > Mac mini G4 (via SATA to USB adapter) worked for me also. But all these > workarounds are unhandy to the least.
The way you describe this bug makes me think of a 64bits vs 32bits issue. Next time this happen to you, use a foreign powerpc installation to run ppc32 binary on your G5. > The last changelog entry for `hfsprogs` is already from 2013 and the > used source code from Apple seems to be even older than that (e.g. check > the used version 332.25 against the versions available from [1]). There > seems to be some recent progress in Arch Linux (following the discussion > on [2]) but I'm unsure if this will also apply to NewWorld Power Macs. > So I dare to say that we have a situation with hfsprogs similar to the > situation we have with yaboot, maybe even worse, as a critical > functionality just doesn't work on G5 Power Macs. > > [1]: https://opensource.apple.com/source/diskdev_cmds/ > [2]: https://aur.archlinux.org/packages/hfsprogs/ > > Cheers, > Frank > > **** > > ``` > root@powermac-g5-2:~# dmesg | grep hfs > [ 16.234586] hfs: filesystem was not cleanly unmounted, running > fsck.hfs is recommended. mounting read-only. > > root@powermac-g5-2:~# fsck.hfs -d /dev/sda2 > ** /dev/sda2 > Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K. > ** Checking HFS volume. > Segmentation fault > > root@powermac-g5-2:~# strace fsck.hfs -d /dev/sda2 > execve("/sbin/fsck.hfs", ["fsck.hfs", "-d", "/dev/sda2"], 0x7ffff6dd0670 > /* 17 vars */) = 0 > brk(NULL) = 0x2d210000 > access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or > directory) > access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or > directory) > openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 > fstat(3, {st_mode=S_IFREG|0644, st_size=38472, ...}) = 0 > mmap(NULL, 38472, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fffbb2d0000 > close(3) = 0 > access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or > directory) > openat(AT_FDCWD, "/lib/powerpc64-linux-gnu/libbsd.so.0", > O_RDONLY|O_CLOEXEC) = 3 > read(3, > "\177ELF\2\2\1\0\0\0\0\0\0\0\0\0\0\3\0\25\0\0\0\1\0\0\0\0\0\2\345h"..., > 832) = 832 > fstat(3, {st_mode=S_IFREG|0644, st_size=133368, ...}) = 0 > mmap(NULL, 200880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) > = 0x7fffbb290000 > mmap(0x7fffbb2b0000, 131072, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7fffbb2b0000 > close(3) = 0 > access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or > directory) > openat(AT_FDCWD, "/lib/powerpc64-linux-gnu/libc.so.6", > O_RDONLY|O_CLOEXEC) = 3 > read(3, > "\177ELF\2\2\1\3\0\0\0\0\0\0\0\0\0\3\0\25\0\0\0\1\0\0\0\0\0\36\326\300"..., > 832) = 832 > fstat(3, {st_mode=S_IFREG|0755, st_size=2046080, ...}) = 0 > mmap(NULL, 2119632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, > 0) = 0x7fffbb080000 > mprotect(0x7fffbb250000, 65536, PROT_NONE) = 0 > mmap(0x7fffbb260000, 196608, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d0000) = 0x7fffbb260000 > close(3) = 0 > access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or > directory) > openat(AT_FDCWD, "/lib/powerpc64-linux-gnu/librt.so.1", > O_RDONLY|O_CLOEXEC) = 3 > read(3, > "\177ELF\2\2\1\3\0\0\0\0\0\0\0\0\0\3\0\25\0\0\0\1\0\0\0\0\0\1\367\370"..., > 832) = 832 > fstat(3, {st_mode=S_IFREG|0644, st_size=69392, ...}) = 0 > mmap(NULL, 134872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) > = 0x7fffbb050000 > mmap(0x7fffbb060000, 131072, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fffbb060000 > close(3) = 0 > access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or > directory) > openat(AT_FDCWD, "/lib/powerpc64-linux-gnu/libpthread.so.0", > O_RDONLY|O_CLOEXEC) = 3 > read(3, > "\177ELF\2\2\1\3\0\0\0\0\0\0\0\0\0\3\0\25\0\0\0\1\0\0\0\0\0\3\344H"..., > 832) = 832 > fstat(3, {st_mode=S_IFREG|0755, st_size=237672, ...}) = 0 > mmap(NULL, 281120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) > = 0x7fffbb000000 > mmap(0x7fffbb030000, 131072, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x20000) = 0x7fffbb030000 > close(3) = 0 > mprotect(0x7fffbb260000, 131072, PROT_READ) = 0 > mprotect(0x7fffbb030000, 65536, PROT_READ) = 0 > mprotect(0x7fffbb060000, 65536, PROT_READ) = 0 > mprotect(0x7fffbb2b0000, 65536, PROT_READ) = 0 > mprotect(0x10030000, 65536, PROT_READ) = 0 > mprotect(0x7fffbb330000, 65536, PROT_READ) = 0 > munmap(0x7fffbb2d0000, 38472) = 0 > set_tid_address(0x7fffbb344250) = 4837 > set_robust_list(0x7fffbb344260, 24) = 0 > rt_sigaction(SIGRTMIN, {sa_handler=0x7fffbb03e3b8, sa_mask=[], > sa_flags=SA_SIGINFO}, NULL, 8) = 0 > rt_sigaction(SIGRT_1, {sa_handler=0x7fffbb03e3d0, sa_mask=[], > sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0 > rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 > prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, > rlim_max=RLIM64_INFINITY}) = 0 > stat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 > stat("/dev/sda2", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 2), ...}) = 0 > stat("/dev/sda2", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 2), ...}) = 0 > stat("/dev/sda2", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 2), ...}) = 0 > openat(AT_FDCWD, "/dev/sda2", O_RDONLY) = 3 > brk(NULL) = 0x2d210000 > brk(0x2d240000) = 0x2d240000 > fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0 > openat(AT_FDCWD, "/dev/sda2", O_WRONLY) = 4 > write(1, "** /dev/sda2\n", 13** /dev/sda2 > ) = 13 > write(1, "\tUsing cacheBlockSize=32K cacheT"..., 65 Using > cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K. > ) = 65 > mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, > -1, 0) = 0x7fffb9000000 > fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 2), ...}) = 0 > ioctl(3, BLKGETSIZE64, [10000384]) = 0 > _llseek(3, 0, [0], SEEK_SET) = 0 > read(3, > "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., > 32768) = 32768 > _llseek(3, 9994240, [9994240], SEEK_SET) = 0 > read(3, > "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., > 32768) = 6144 > write(1, "** Checking HFS volume.\n", 24** Checking HFS volume. > ) = 24 > _llseek(3, 65536, [65536], SEEK_SET) = 0 > read(3, > "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., > 32768) = 32768 > _llseek(3, 98304, [98304], SEEK_SET) = 0 > read(3, > "\0\0\0\"\0\0\0\36\377\1\0\4\0\0\6\0\0\0\1@\0\0\4\0\0\0\0\0\0\0\0\0"..., > 32768) = 32768 > --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_BNDERR, > si_addr=0x8001b901eff4} --- > +++ killed by SIGSEGV +++ > Segmentation fault > > root@powermac-g5-2:~# dmesg | grep hfs > [ 1593.639820] fsck.hfs[4814]: unhandled signal 11 at 000080019b19eff4 > nip 000000001001e740 lr 0000000010022bd4 code 3 > [ 1663.526515] fsck.hfs[4833]: unhandled signal 11 at 00008001ad9aeff4 > nip 000000001001e740 lr 0000000010022bd4 code 3 > ```