ubuntu引导配置文件grub.cfg真是越来越难看懂了:启动菜单里找不到类似root=/dev/sda这种存放根文件系统的块设备名,取而代之的是一堆让人摸不着头脑的UUID:
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-79b9d565-3541-424b-9772-66551edc4e22' {
linux /boot/vmlinuz-3.13.0-32-generic root=UUID=79b9d565-3541-424b-9772-66551edc4e22 ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
initrd /boot/initrd.img-3.13.0-32-generic
上网搜索了一下,找到了通过UUID反向找到对应块设备的命令,以上面root=UUID=79b9d565-3541-424b-9772-66551edc4e22为例:
eugen@ubuntu:~$ sudo blkid -U 79b9d565-3541-424b-9772-66551edc4e22
/dev/sda1
原来这串UUID是/dev/sda1的设备号。
反过来,这个命令也可以查看块设备的UUID/Label
eugen@ubuntu:~$ sudo blkid /dev/sda1
/dev/sda1: UUID="79b9d565-3541-424b-9772-66551edc4e22" TYPE="ext4"
eugen@ubuntu:~$ sudo blkid
/dev/sda1: UUID="79b9d565-3541-424b-9772-66551edc4e22" TYPE="ext4"
/dev/sda5: UUID="3d9f9416-f8c7-4b88-a7c5-77f023560756" TYPE="swap"
参考:
Persistent block device naming
标签:blkid,UUID,grub,cfg,66551edc4e22,dev,79b9d565,424b,9772 From: https://blog.51cto.com/u_13927568/5831328