Grub cryptdevice 可以更改设备名称吗?

Grub cryptdevice 可以更改设备名称吗?

我觉得这是一个愚蠢的问题。

我有一个加密的 Arch 设置(没有 LVM),单个磁盘 (sdc) 包含未加密的启动分区和加密的根分区。

下面是 lsblk 的输出:

NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda             8:0    0   1.4T  0 disk  
└─sda1          8:1    0   1.4T  0 part  
sdb             8:16   1   3.8G  0 disk  
└─sdb1          8:17   1   3.8G  0 part  
sdc             8:32   0 238.5G  0 disk  
├─sdc1          8:33   0    64M  0 part  /boot
└─sdc2          8:34   0 238.4G  0 part  
  └─cryptroot 254:0    0 238.4G  0 crypt /
sdd             8:48   0  83.9G  0 disk  
├─sdd1          8:49   0   100M  0 part  
└─sdd2          8:50   0  83.8G  0 part  
sde             8:64   0 930.8G  0 disk  
└─sde1          8:65   0 930.8G  0 part  
sr0            11:0    1  1024M  0 rom   

只要我插入 USB 驱动器(甚至可能是空的),一切都会正常工作,但是当我拔下 USB 驱动器(上面转储中的“sdb”)时,grub 报告 /sdc2 不是 LUKS 容器(不是确切的信息,但其要点)。

我相信,当 USB 驱动器断开连接时,包含我的 arch 安装的设备将变成 sdb (每个 id 都会移动一位?)

GRUB_DEFAULT=0
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdc2:cryptroot"

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

#GRUB_SAVEDEFAULT="true"
GRUB_DISABLE_SUBMENU=y

我也尝试过

GRUB_CMDLINE_LINUX="cryptdevice=UUID=fb9a6cc1-592f-46ca-9d26-ccaa6a3d4ea9:cryptroot"

但有同样的问题(下面是blkid的输出)

/dev/sda1: LABEL="Ny diskenhed" UUID="589299B7929999D8" TYPE="ntfs" PARTUUID="a450f178-01"
/dev/sdb1: LABEL="ARCH_201508" UUID="C83D-1650" TYPE="vfat" PARTUUID="0005b309-01"
/dev/sdc2: UUID="fb9a6cc1-592f-46ca-9d26-ccaa6a3d4ea9" TYPE="crypto_LUKS" PARTUUID="0fc4f1e5-02"
/dev/sdd1: LABEL="Reserveret til systemet" UUID="0220B61820B612A1" TYPE="ntfs" PARTUUID="cde3ca74-01"
/dev/sdd2: UUID="A0B8B723B8B6F73E" TYPE="ntfs" PARTUUID="cde3ca74-02"
/dev/sde1: LABEL="Helium" UUID="6E32E1EF32E1BC69" TYPE="ntfs" PARTUUID="fad27ece-01

我跟着本指南用于在 LUKS 上设置 Arch

我怎样才能解决这个问题?

答案1

HalosGhost提供的答案应该是正确的。在这种特殊情况下,您的问题很可能是由于缺少

root=UUID=< 根开发的 UUID >

为后代添加答案。

相关内容