In this case, if I had access to a Linux desktop machine, I'd:
1. Make a disk image of the SD card. You've made one on macOS, which will mainly only be useful on macOS.
2. Install the same version OS on a new card. You now have a working partition table and boot partition.
3. Copy the OS partition from your mounted image to your new card, overwriting the newly installed os (Linux Gparted can copy only used space for ext4 filesystems, which is significantly quicker than a full partition copy if you have a large partition but very little data)
...and take it from there, which probably entails:
4. Run blkid /dev/<my-sd-card> for the new SD-card when you have it in your desktop/laptop card reader, to acquire the new disk signature for your new SD-card.
5. Change the <disk signature>-1 and <...>-2 lines in /etc/fstab in your newly copied OS partition to reflect the new disk signature.
6. Change the PARTUUID= in /boot/cmdline.txt (or whatever the equivalent file is in that version of the OS) on the boot partition of the new card. Maybe you first want to copy your own config files from the old boot partition to the new one, if you manage to mount and read the old one that is (FAT, should be readable on macOS).
That's off the top of my head. At least I had to do something very similar the other day when I decided to copy an SD card to a bigger one.
PS. This assumes your boot partition is broken somehow and not your partition table. If your partition table is broken, then you'd be better off with some data rescue tool specifically for that purpose. I suppose fdisk /dev/<my-sd-card> could tell you if that were the case.
1. Make a disk image of the SD card. You've made one on macOS, which will mainly only be useful on macOS.
2. Install the same version OS on a new card. You now have a working partition table and boot partition.
3. Copy the OS partition from your mounted image to your new card, overwriting the newly installed os (Linux Gparted can copy only used space for ext4 filesystems, which is significantly quicker than a full partition copy if you have a large partition but very little data)
...and take it from there, which probably entails:
4. Run blkid /dev/<my-sd-card> for the new SD-card when you have it in your desktop/laptop card reader, to acquire the new disk signature for your new SD-card.
5. Change the <disk signature>-1 and <...>-2 lines in /etc/fstab in your newly copied OS partition to reflect the new disk signature.
6. Change the PARTUUID= in /boot/cmdline.txt (or whatever the equivalent file is in that version of the OS) on the boot partition of the new card. Maybe you first want to copy your own config files from the old boot partition to the new one, if you manage to mount and read the old one that is (FAT, should be readable on macOS).
That's off the top of my head. At least I had to do something very similar the other day when I decided to copy an SD card to a bigger one.
PS. This assumes your boot partition is broken somehow and not your partition table. If your partition table is broken, then you'd be better off with some data rescue tool specifically for that purpose. I suppose fdisk /dev/<my-sd-card> could tell you if that were the case.
Statistics: Posted by Levajn — Sun Nov 09, 2025 11:27 pm