커널 라인에서 grub 구성 파일 "/boot/grub/grub.cfg"를 사용하려고 합니다. "root=/dev/" 대신 "root=UUID="를 설정합니다.
예를 들어 다음을 실행할 때:
grub-mkconfig -o /boot/grub/grub.cfg
/boot/grub/grub.cfg 파일에는 다음이 포함됩니다.
menuentry 'Slackware-14.2 GNU/Linux' --class slackware-14.2 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1c07b419-4a08-4326-b4c4-fd9ac9cce46e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 59774ae4-7b95-4aee-a16f-40e9adc3c4db
else
search --no-floppy --fs-uuid --set=root 59774ae4-7b95-4aee-a16f-40e9adc3c4db
fi
echo 'Loading Linux 4.4.111 ...'
linux /vmlinuz-huge-4.4.111 root=/dev/sda3 ro splash quiet nomodeset video=uvesafb:mode_option=1024x768-24,mtrr=3,scroll=ywrap
}
/boot/grub/grub.cfg에 생성된 grub-mkconfig를 시도 중입니다. 다음이 포함되어 있습니다(root=/dev/sda3을 root=UUID=로 변경하면 됩니다).
menuentry 'Slackware-14.2 GNU/Linux' --class slackware-14.2 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1c07b419-4a08-4326-b4c4-fd9ac9cce46e' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 59774ae4-7b95-4aee-a16f-40e9adc3c4db
else
search --no-floppy --fs-uuid --set=root 59774ae4-7b95-4aee-a16f-40e9adc3c4db
fi
echo 'Loading Linux 4.4.111 ...'
linux /vmlinuz-huge-4.4.111 root=UUID=1c07b419-4a08-4326-b4c4-fd9ac9cce46e ro splash quiet nomodeset video=uvesafb:mode_option=1024x768-24,mtrr=3,scroll=ywrap
}
blkid에서 정보를 얻었습니다
blkid | grep sda3
/dev/sda3: LABEL="2Slackware64" UUID="1c07b419-4a08-4326-b4c4-fd9ac9cce46e" UUID_SUB="3ec2cd19-212c-42e4-9630-8c5c2baa3250" TYPE="btrfs" PARTUUID="000cb1e8-03"
파일을 수정하려고 합니다.
/etc/grub.d/10_linux
/usr/share/grub/grub-mkconfig_lib
/etc/default/grub
하지만 grub-mkconfig 도구를 사용하여 /boot/grub/grub.cfg를 생성할 때 기본 생성을 설정하는 방법을 찾을 수 없습니다.
답변1
내 파일 /etc/default/grub의 내용:
# If you change this file, run grub-mkconfig -o /boot/grub/grub.cfg
# afterwards to update /boot/grub/grub.cfg.
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=15
GRUB_DISTRIBUTOR=$( sed 's/Slackware /Slackware-/' /etc/slackware-version )
GRUB_CMDLINE_LINUX_DEFAULT="video=uvesafb:mode_option=1024x768-24"
GRUB_CMDLINE_LINUX="quiet"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=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=1024x768x32
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_BACKGROUND="/boot/images/tux.png"
# Font used on the graphical terminal:
GRUB_FONT=/usr/share/grub/dejavusansmono.pf2
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"