(le sigh…) well this one is totally my fault.
i had a working setup of Fedora 32 workstation added as a dual boot on my Macbook Pro.
since i’m sharing disk space with MacOS (separate partitions of course), I ran low pretty fast because MacOS is beefy (I haven’t deleted it because many have said it’s good to keep).
Well…I cleared out some apps and freed up space in MacOS, set aside that extra spaces as a new partition, then deleted that partition thus converting it to Unallocated space. The plan was to merge that with the Fedora /home ext4 partition to give me much needed disk space there.
Everything is going well until I realize that I have two separated Unallocated volumes, one next to APFS, and the other at the every end (or bottom) of the stack. The only way to combine these into one single unallocated volume (so I can merge it with /Home (ext4)) is to move those space past Boot, Root/, Swap, and Home volumes.
First I tried using a Gparted live USB but Macbook’s stupid T2 chip doesn’t allow many images like this to run. So then I used a linux live USB to access Gparted. Gparted did in fact warn me there’s a good chance I’ll cause damage if I attempt to shift/move /Boot. I ignored it. During that file structure operation, the Macbook crashed. I went back into the Live USB and ran Gparted. The next time, it successfully moved the unallocated space. I proceeded to incremenally shift that unallocated space to the very end of the stack so that it was adjacent to Home. I then attempted to Resize Home to grow/merge with some of the unallocated volume. During this operation the computer again crashed.
Well sure enough, upon a fresh reboot, Fedora 32 no longer loads gracefully. Instead I see:
Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists posible device or file completions.
grub>
so this means I broke the grub bootloader.
this is what i see:
unlike what’s described in this blog, the prompt isn’t grub rescue>
, it’s just grub>
I flashed and tried running live USBs of Rescatux and Supergrub2 however although Rescatux boots up, it quickly freezes with a black screen while the macbook’s fans go loud like a jet engine, 15 minutes later I realize nothing is happening and a do a hard shutdown. The fact that many other images struggle to run on macbook is most likely because of the Apple T2 chip, which is another story. Anyways, many of the help articles i’ve read in the last 12 hours say i need to first identify which volume is assigned to /root. Fortunately there are several clues.
-
screenshot of the original configuration (snapped this when first installed Fedora)
-
current display of Gparted (this is taken from Fedora Live USB)
Note: you’ll see i’ve set the Mount Points for some of the volumes to /mnt/sysimage/*
, that’s because I was trying to follow Thomas Leister’s help article, but I’m stuck because at this step because I don’t see /etc/resolv.conf
.
Also note the difference between Old and New partition names, for example /Home
used to be nvme0n1p8
and now it is nvme0n1p9
, and so forth.
- Fresh readout from terminal (while running Live USB)
$ sudo fdisk -l
Disk /dev/nvme0n1: 233.78 GiB, 251000193024 bytes, 61279344 sectors
Disk model: APPLE SSD AP0256M
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 13B00169-B0C5-4055-A08B-7DBC704553B4
Device Start End Sectors Size Type
/dev/nvme0n1p1 6 76805 76800 300M EFI System
/dev/nvme0n1p2 76806 30703781 30626976 116.9G Apple APFS
/dev/nvme0n1p4 30703872 30966015 262144 1G
/dev/nvme0n1p5 30966016 31228159 262144 1G EFI System
/dev/nvme0n1p7 31228160 45868031 14639872 55.9G Linux filesystem
/dev/nvme0n1p8 45868032 47965183 2097152 8G Linux swap
/dev/nvme0n1p9 47965184 61279231 13314048 50.8G Linux filesystem
Disk /dev/sda: 3.84 GiB, 4105175040 bytes, 8017920 sectors
Disk model: DISK 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3815d7c3
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 0 4141215 4141216 2G 0 Empty
/dev/sda2 156 16579 16424 8M ef EFI (FAT-12/16/32)
/dev/sda3 16656 51567 34912 17M ef EFI (FAT-12/16/32)
Disk /dev/loop0: 24 KiB, 24576 bytes, 48 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 4.12 MiB, 4313088 bytes, 8424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 1.87 GiB, 1988771840 bytes, 3884320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 7.51 GiB, 8053063680 bytes, 15728640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/live-rw: 7.51 GiB, 8053063680 bytes, 15728640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/live-base: 7.51 GiB, 8053063680 bytes, 15728640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/live-osimg-min: 7.51 GiB, 8053063680 bytes, 15728640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 24K 1 loop
loop1 7:1 0 4.1M 1 loop
└─live-osimg-min 253:2 0 7.5G 1 dm
loop2 7:2 0 1.9G 1 loop
loop3 7:3 0 7.5G 1 loop
├─live-rw 253:0 0 7.5G 0 dm /
├─live-base 253:1 0 7.5G 1 dm
└─live-osimg-min 253:2 0 7.5G 1 dm
loop4 7:4 0 32G 0 loop
└─live-rw 253:0 0 7.5G 0 dm /
sda 8:0 1 3.8G 0 disk
├─sda1 8:1 1 2G 0 part /run/initramfs/live
├─sda2 8:2 1 8M 0 part
└─sda3 8:3 1 17M 0 part
nvme0n1 259:0 0 233.8G 0 disk
├─nvme0n1p1 259:8 0 300M 0 part
├─nvme0n1p2 259:9 0 116.9G 0 part
├─nvme0n1p4 259:10 0 1G 0 part
├─nvme0n1p5 259:11 0 1G 0 part
├─nvme0n1p7 259:12 0 55.9G 0 part
├─nvme0n1p8 259:13 0 8G 0 part
└─nvme0n1p9 259:14 0 50.8G 0 part
$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0 squashfs 4.0
loop1 DM_snapshot_cow
└─live-osimg-min ext4 1.0 _fedora-mbp-x86_ MASKED FOR PRIVACY
loop2 squashfs 4.0
loop3 ext4 1.0 _fedora-mbp-x86_ MASKED FOR PRIVACY
├─live-rw ext4 1.0 _fedora-mbp-x86_ MASKED FOR PRIVACY 1G 85% /
├─live-base ext4 1.0 _fedora-mbp-x86_ MASKED FOR PRIVACY
└─live-osimg-min ext4 1.0 _fedora-mbp-x86_ MASKED FOR PRIVACY
loop4
└─live-rw ext4 1.0 _fedora-mbp-x86_ MASKED FOR PRIVACY 1G 85% /
sda iso9660 Joliet Extension fedora-mbp-x86_64-202007010638 2020-07-01-07-02-59-00
├─sda1 iso9660 Joliet Extension fedora-mbp-x86_64-202007010638 2020-07-01-07-02-59-00 0 100% /run/initramfs/live
├─sda2 vfat FAT16 EFI MASKED FOR PRIVACY
└─sda3 hfsplus Livecd Fedora MASKED FOR PRIVACY
nvme0n1
├─nvme0n1p1 vfat FAT32 EFI MASKED FOR PRIVACY
├─nvme0n1p2 apfs MASKED FOR PRIVACY
├─nvme0n1p4 vfat FAT32 MASKED FOR PRIVACY
├─nvme0n1p5 vfat FAT32 MASKED FOR PRIVACY
├─nvme0n1p7 ext4 1.0 MASKED FOR PRIVACY
├─nvme0n1p8 swap 1 MASKED FOR PRIVACY
└─nvme0n1p9 ext4 1.0 home MASKED FOR PRIVACY
Note: i have masked the UUIDs for privacy reasons for this post.
What can i do to repair Grub and get back on my feet?