Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

MacMini RAID1 ESP UEFI (SOLVED)

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#21 Post by Deekee »

OK I successfully played again through STEP 1-5 and did dpkg-reconfigure grub-efi-amd64 suggested and added grub to the replaced SDD on sda1 only.

The status of the RAID just looked fine and the system worked as expected.

Code: Select all

$ cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sda2[1] sdb2[0]
      975526912 blocks super 1.2 [2/2] [UU]
      bitmap: 0/8 pages [0KB], 65536KB chunk
So I decided to test further and disconnect the drive from the system booted before, so the system would boot from the just recovered drive...

After trying to ssh in the connection got refused but I was able to ping, so the system was alive!

Code: Select all

dirk@dirks-macbook-air ~ % ssh dirk@192.168.1.48
ssh: connect to host 192.168.1.48 port 22: Connection refused
So I connected a screen, a mouse and keyboard to see what was going on..
ubuntu2.JPG
ubuntu2.JPG (100.65 KiB) Viewed 792 times
Not sure what I did wrong!

Some further help would be very much appreciated and many thanks in advance and have a nice Sunday evening!
Last edited by Deekee on 2022-09-19 05:59, edited 1 time in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#22 Post by p.H »

The picture is too small to see but I think it is because of the now missing EFI partition which is supposed to be mounted on /boot/efi in /etc/fstab.
A trick may be to set the same identifier (UUID or LABEL) to both EFI partitions so that either could be mounted on /boot/efi.
Or add "nofail" to the mount options to avoid a hard failure when the partition is missing.

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#23 Post by Deekee »

OK, changed the picture size in the post above, should be readable now :-)

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#24 Post by p.H »

As expected, the system goes into emergency mode because it could not mount the EFI partition defined in /etc/fstab.

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#25 Post by Deekee »

Strange I even can't shutdown the system now!

Code: Select all

root@macmini:/usr/sbin# shutdown
root@macmini:/usr/sbin#
Nothing happens at all..

Not sure on how to continue from here...

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#26 Post by p.H »

Try with -f. Or fix the ESP UUID in /etc/fstab and exit the emergency shell.

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#27 Post by Deekee »

I typed "exit" then I got

Code: Select all

Failed to start default target: Transaction for multi-user.target/start is destructive (emergency.target has 'start' job queued, but 'stop' is included in the transaction.
.. and no response from the system anymore!

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#28 Post by p.H »

I have no clue about this message. Did you try to reboot with Ctrl+Alt+Del ?

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#29 Post by Deekee »

I was unable to shutdown the system at all!

So I modified /etc/fstab and made the following changes:

Code: Select all

# /dev/disk/by-uuid/2F34-5025 /boot/efi vfat defaults 0 1
/dev/disk/by-uuid/2F57-ABFB /boot/efi vfat defaults 0 1
and powered the system off manually and rebooted.

It booted now successfully and I also can SSH in again :-)

Now, I will try to reinstall Debian 11 and try to configure it the same way, as I don't want to run Ubuntu at all, because it's derived from Debian and I will go for the stable branch, It may not have the latest software and features but I think when it comes to stability, Debian is rock solid.

Many thanks or for all your help and guidance, ver much appreciated.

CU and have a nice day!

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#30 Post by p.H »

I'm afraid that Debian does not natively support installing GRUB on multiple EFI partitions so you will have to manage that part manually.

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#31 Post by Deekee »

Here it's described nicely on how to do that :-)

https://help.ggcircuit.com/knowledge/ap ... oot-loader

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#32 Post by p.H »

AFAIK, in Debian the configuration of grub-efi-amd64 does not offer to select where to install the boot loader. It automatically and implicitly uses the EFI partition mounted on /boot/efi.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#33 Post by Head_on_a_Stick »

Deekee wrote: 2022-09-19 13:09 Here it's described nicely on how to do that :-)

https://help.ggcircuit.com/knowledge/ap ... oot-loader
That's for grub-pc, which is for non-UEFI systems.
deadbang

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#34 Post by p.H »

The page also mentions grub-efi-amd64 for UEFI systems, but AFAICS this package does not have a configuration item to select boot devices in Debian (unlike Ubuntu, I hate to say).

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#35 Post by Deekee »

Yeah, you've right I just tried it and it doesn't has that option when I run dpkg-reconfigure in Debian!

So I will have to copy it manually I guess, can I just mount that drive and copy everything over?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#36 Post by p.H »

Copying files won't update EFI boot variables in NVRAM.
You can install GRUB in the other EFI partition and update EFI boot variables with

Code: Select all

grub-install --efi-directory=/path/to/other/efi/partition/mountpoint --force-extra-removable

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#37 Post by Deekee »

Thanks, this worked like a charm and I can boot nicely from sda1 or sdb1 just by uncommenting/commenting one or the other entry in /etc/fstab

Code: Select all

# /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.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/md0 during installation
UUID=d2c78252-cc96-4e19-a8fc-426038c3465a /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
# Used to boot from sdb1
UUID=0E24-AF68  /boot/efi       vfat    umask=0077      0       1
# Used to boot from sda1
# UUID=0E20-1E4F  /boot/efi       vfat    umask=0077      0       1
Thanks again for all you help and patience and have a wonderful day :-)

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#38 Post by Deekee »

I'm happy to be back on Debain again and ready to learn more :-)

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#39 Post by p.H »

Commenting and uncommenting entries in /etc/fstab does not change which EFI partition you boot from, only which one should be mounted on /boot/efi after booting. Which partition you boot from is defined by BootOrder in EFI boot variables managed by efibootmgr (or by the UEFI firmware boot order which may override it).

Neither of your current /boot/efi entries allow a successful redundant boot. If the partition in the uncommented entry is missing (because the drive failed or was removed), then the mount will fail and the system will enter emergency mode instead of booting normally.

To avoid this, you can add the "nofail" mount option to the EFI partition entry, so that a mount failure will not trigger emergency mode.
Or you can set the same identifier (UUID, LABEL, PARTUUID or PARTLABEL) to both EFI partitions and use this identifier in the fstab entry (even though these identifiers are usually supposed to be unique). This way, the system will mount whichever EFI partition is present. As a general rule, any filesystem which is not required for normal system operation should have the "nofail" option in fstab. This includes /boot and /boot/efi which are not used after the kernel and initramfs are loaded.

Deekee
Posts: 91
Joined: 2022-07-02 17:50
Has thanked: 5 times
Been thanked: 3 times

Re: MacMini RAID1 ESP UEFI (SOLVED)

#40 Post by Deekee »

Thanks for your reply, it's very much appreciated and I must say this is a very well written answer :-)
Or you can set the same identifier (UUID, LABEL, PARTUUID or PARTLABEL) to both EFI partitions and use this identifier in the fstab entry (even though these identifiers are usually supposed to be unique).
Do I just need to set one of the above, so changing the UUID will do?

Setting the UUID on the second disk I basically straight forward and I've tested it alread with an USB stick..

Code: Select all

# UUID="1234-ABCD"
# printf "\x${UUID:7:2}\x${UUID:5:2}\x${UUID:2:2}\x${UUID:0:2}" \
| dd bs=1 seek=67 count=4 conv=notrunc of=/dev/sdd1
As both UUID's are the same now, so one entry in /etc/fstab is OK.

Code: Select all

# /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.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/md0 during installation
UUID=d2c78252-cc96-4e19-a8fc-426038c3465a /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
# Used to boot from sda1 or sdb1 as both have the same UUID
UUID=0E24-AF68  /boot/efi       vfat  nofail   umask=0077      0       1
The following entries where listed:

Code: Select all

# efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000,0002,0001
Boot0000* debian	HD(1,GPT,9ea62a12-52cd-4dea-b4e0-4ee63b65f1b4,0x800,0x1dc800)/File(\EFI\debian\shimx64.efi)
Boot0001* ubuntu	HD(1,GPT,c714fc4d-3b27-4576-9529-4a330d61e35c,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi)
Boot0002* ubuntu	HD(1,GPT,cc78b180-faf4-4a0b-9369-b0a82aa5c0fa,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi)
Boot0080* 	PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,0,0)/HD(1,GPT,fbb8e9c7-869a-4bf6-8dfe-eb56718c1a6c,0x40,0x1fc0)/File(\EFI\BOOT\BOOTX64.efi)
BootFFFF* 	PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,0,0)/HD(1,GPT,fbb8e9c7-869a-4bf6-8dfe-eb56718c1a6c,0x40,0x1fc0)/File(\EFI\BOOT\BOOTX64.efi)
I think Boot0001 and Boot0002 are not needed anymore, as I'm back on Debian, so I deleted them already

Code: Select all

# # efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
Boot0000* debian	HD(1,GPT,9ea62a12-52cd-4dea-b4e0-4ee63b65f1b4,0x800,0x1dc800)/File(\EFI\debian\shimx64.efi)
Boot0080* 	PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,0,0)/HD(1,GPT,fbb8e9c7-869a-4bf6-8dfe-eb56718c1a6c,0x40,0x1fc0)/File(\EFI\BOOT\BOOTX64.efi)
BootFFFF* 	PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,0,0)/HD(1,GPT,fbb8e9c7-869a-4bf6-8dfe-eb56718c1a6c,0x40,0x1fc0)/File(\EFI\BOOT\BOOTX64.efi)
What I don't get is for what are the entries Boot0080 and BootFFFF for?

Could they be leftovers from previous installed disk and hence those entries can be deleted as well?

Code: Select all

lsblk -o +UUID,FSTYPE,PARTLABEL,PARTUUID /dev/sda1 /dev/sdb1
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT UUID       FSTYPE   PARTLABEL               PARTUUID
sda1   8:1    0  953M  0 part            0E20-1E4F  vfat                             2b8d99be-e716-4fa0-84fb-f7a01fc1da5b
sdb1   8:17   0  953M  0 part /boot/efi  0E24-AF68  vfat     EFI System Partition    9ea62a12-52cd-4dea-b4e0-4ee63b65f1b4
So I now added a new entry using:

# efibootmgr --create --disk=/dev/sda --part=1 --label="debian" --loader='\EFI\debian\shimx64.efi'

Code: Select all

# efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0001,0000
Boot0000* debian	HD(1,GPT,9ea62a12-52cd-4dea-b4e0-4ee63b65f1b4,0x800,0x1dc800)/File(\EFI\debian\shimx64.efi)
Boot0001* debian	HD(1,GPT,2b8d99be-e716-4fa0-84fb-f7a01fc1da5b,0x800,0x1dc800)/File(\EFI\debian\shimx64.efi)
Boot0080* 	PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,0,0)/HD(1,GPT,fbb8e9c7-869a-4bf6-8dfe-eb56718c1a6c,0x40,0x1fc0)/File(\EFI\BOOT\BOOTX64.efi)
BootFFFF* 	PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,0,0)/HD(1,GPT,fbb8e9c7-869a-4bf6-8dfe-eb56718c1a6c,0x40,0x1fc0)/File(\EFI\BOOT\BOOTX64.efi)

I got a warning but I think tht doesn't matter

Code: Select all

efibootmgr: ** Warning ** : Boot0000 has same label debian
What I don't get is for what are the entries Boot0080 and BootFFFF?

Could that be left overs from previous installed disk and hence those entries can be remmoved as well?

Thanks again for your comments :-)

Post Reply