You are not logged in.

#1 2024-07-04 02:53:14

Sving1024
Member
Registered: 2024-06-16
Posts: 31
Website

Grub: failed to find disk

Recently I have set up luks on my root partition and try to configure the grub with the help of Wiki. It works well when using passphrase.Then I tried to set my usb drive following this page and modified the script(/boot/grub/grub-pre.cfg) a little. Then I rebooted and the grub says 'disk <uuid of my usb drive> not found'. The rest part of the script ask me to enter the passphrase and grub works well after i entered it then.

Then I rebooted again and didnt type in the passphrase and grub return a grub rescue shell.I tried to use cryptomount using my passphrase and it works well.but when i set the root var to the uuid of unlocked device and tried to load normal module it says 'disk <uuid of the unlocked device> not found'. but the module can be loaded if i set the root to (crypto0).

After that I rebooted again. This time I used cryptomount to unlock the decive with keyfiles(uuid doesnt work,so i replace it with something like (hd0,msdos1) ) and it unlocked the device successfully. Then I load the module just like last time.

Then after the fourth rebooting,i didn't use the shell but entered the passphrase just like the first time. Then grub says 'disk <uuid of the unlocked device> not found'.And when i set the root to (crypto0), it works again.

Then grubx64.efi and the script wasn't modified between the first and the last rebooting and im sure the uuid is the correct one.

the script:

set keyfile_uuid=5864-9CD4
cryptomount -u e99fc578-f366-43ae-a996-9f08192c1838 -k ($keyfile_uuid)/<path to the key>
cryptomount -u e99fc578-f366-43ae-a996-9f08192c1838
set root=be695024-c892-42ea-8917-4a7d75d32cd7
set prefix=($root)/boot/grub
insmod normal
normal

<path to the key> is replaced with the real path.
the output of lsblk -f

NAME         FSTYPE FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
//there isn't anything useful in sda.there are only some private files and a windows system on it.
//it is there before the archlinux is installed. I think sda is not the point 
sdb                                                                                    
├─sdb1                                                                                 
├─sdb2       vfat   FAT32          08EA-1607                             289.1M    17% /efi
├─sdb3       BitLoc 2                                                                  
├─sdb4       ntfs                  6610235510232B8D                                    
├─sdb5       BitLoc 2                                                                  
│ └─bitlk-93571b39-76be-4744-983c-46498931bbb0
│            ntfs                  C02EDA77944056ED                      288.7G    74% /run/media/Sving1024/C02EDA77944056ED
├─sdb6       crypto 2              e99fc578-f366-43ae-a996-9f08192c1838                
│ └─Archlinux-ASM236X-crypted
│            ext4   1.0            be695024-c892-42ea-8917-4a7d75d32cd7  338.8G    28% /
└─sdb7       ntfs                  EEE4030DE402D7AB                                    
sdc                                                                                    
└─sdc1       vfat   FAT32 KINGSTON 5864-9CD4                              74.3G    36% /run/media/Sving1024/KINGSTON
sr0                                                                                    

the output of blkid

/dev/mapper/bitlk-93571b39-76be-4744-983c-46498931bbb0: BLOCK_SIZE="512" UUID="C02EDA77944056ED" TYPE="ntfs"
/dev/sdb4: BLOCK_SIZE="512" UUID="6610235510232B8D" TYPE="ntfs" PARTUUID="c1e9f819-3ad2-420a-9633-12f0456077b7"
/dev/sdb2: UUID="08EA-1607" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="d79bdfbe-fb9a-43e8-9985-006109ae2ff0"
/dev/sdb7: BLOCK_SIZE="512" UUID="EEE4030DE402D7AB" TYPE="ntfs" PARTUUID="de6bd2fa-c5a7-4baa-a922-0e8bcc785f7e"
/dev/sdb5: TYPE="BitLocker" PARTLABEL="Basic data partition" PARTUUID="8d8b65a7-bd89-4fb4-a8a8-217a74701212"
/dev/sdb3: TYPE="BitLocker" PARTLABEL="Basic data partition" PARTUUID="a87d0497-200b-49fb-9a71-63972f1f6944"
/dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="ae80244f-a8f9-4ba8-ae59-45c00ae984a4"
/dev/sdb6: UUID="e99fc578-f366-43ae-a996-9f08192c1838" TYPE="crypto_LUKS" PARTLABEL="Basic data partition" PARTUUID="588aeca3-a94f-4fc4-b35f-650d4a55ff82"
/dev/mapper/Archlinux-ASM236X-crypted: UUID="be695024-c892-42ea-8917-4a7d75d32cd7" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sdc1: LABEL_FATBOOT="KINGSTON" LABEL="KINGSTON" UUID="5864-9CD4" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="58101119-01"

some other info:

  • the archlinux is installed on the /dev/sdb6. /dev/sdb is a portable hard drive.

  • the key is on /dev/sdc1. It used to be used in windows

  • the grub is loaded by refind

  • After i entered normal grub,i entered the grub shell.I use ls to check the uuid of the usb drive with keyfile.It is the same as the one in the script.

  • the usb drive with key file if mbr gap,the disk which has archlinux is gpt gap

Offline

Board footer

Powered by FluxBB