문서 보기이전 판역링크책에 추가PDF로 내보내기Fold/unfold allODT 내보내기맨 위로 이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요. == GRUB에서 ISO이미지로 부팅 === 비상 상황에서 유용합니다. 아래의 링크에 확인하면 라이브ISO 이미지 업데이트 하는 스크립트도 같이 있습니다. https://forums.gentoo.org/viewtopic-t-1167284-start-0.html /etc/grub.d/41_custom <codeprism lang=bash> #!/bin/sh cat <<EOF if [ -f \${config_directory}/custom.cfg ]; then source \${config_directory}/custom.cfg elif [ -z "\${config_directory}" -a -f \$prefix/custom.cfg ]; then source \$prefix/custom.cfg fi EOF ADD_CMND_LINE="iso-scan/filename" ISO_DIR="/boot/grub/iso-images" ISO_REAL_DIR="/boot/grub/iso-images" # If the ISO files are on the root filesystem (`/`), then ISO_REAL_DIR equals ISO_DIR. # Otherwise, ISO_REAL_DIR must reflect the path relative to the root of the partition returned by `grub-probe`. ISO_MNT_DIR="/media" FS_UUID=$(grub-probe --target=fs_uuid $ISO_DIR) n=1; nn=1 IFS_OLD=$IFS IFS=$'\n' for iso in $ISO_DIR/*.iso; do [ "$iso" = "$ISO_DIR/*.iso" ] && break mount -o loop,ro $iso $ISO_MNT_DIR for cmnd in $(grep -E '^menuentry|/boot/' $ISO_MNT_DIR/boot/grub/grub.cfg); do if echo $cmnd | grep -q "^menuentry"; then MENUENTRY[n]="$cmnd"; fi if echo $cmnd | grep -q "linux /"; then ISO_IMAGE[n]=$(basename ${iso}) LINUX[n]="$cmnd ${ADD_CMND_LINE}=${ISO_REAL_DIR}/${ISO_IMAGE[n]}" fi if echo $cmnd | grep -q "initrd"; then INITRD[n]="$cmnd"; n=$((n+1)); fi done umount $ISO_MNT_DIR done SUB="" MENU="${ISO_IMAGE[nn]}" while [ "$nn" != "$n" ] do [ "$iso" = "$ISO_DIR/*.iso" ] && break if [ "$MENU" != "${ISO_IMAGE[nn]}" ]; then SUB="" echo "}" fi if [ -z "$SUB" ]; then echo "submenu '${ISO_IMAGE[nn]}' {" SUB="1" MENU="${ISO_IMAGE[nn]}" fi echo -e "\t${MENUENTRY[nn]}" echo -e "\t\tsearch --fs-uuid --set=root $FS_UUID" echo -e "\t\tloopback loop ${ISO_REAL_DIR}/${ISO_IMAGE[nn]}" echo -e "\t\tset root=(loop)" echo -e "\t${LINUX[nn]}" echo -e "\t${INITRD[nn]}" echo -e "\t}" nn=$((nn+1)) done [ "$iso" != "$ISO_DIR/*.iso" ] && echo "}" IFS=$IFS_OLD </codeprism> grub-mkconfig -o /boot/grub/grub.cfg /boot/grub/grub.cfg <codeprism bash> ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then load_env ...... ...... ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg fi submenu 'livegui-rescue-2026.iso' { menuentry 'Boot LiveCD (kernel: gentoo)' --class gnu-linux --class os { search --fs-uuid --set=root b652a7f5-3763-4ebd-a411-d348b2bf33e6 loopback loop /boot/grub/iso-images/livegui-rescue-2026.iso set root=(loop) linux /boot/gentoo nodhcp secureconsole root=live:CDLABEL=gentoo-amd64-livegui rd.live.dir=/ rd.live.squashimg=image.squashfs cdroot iso-scan/filename=/boot/grub/iso-images/livegui-rescue-2026.iso initrd /boot/gentoo.igz } menuentry 'Boot LiveCD (kernel: gentoo) (cached)' --class gnu-linux --class os { search --fs-uuid --set=root b652a7f5-3763-4ebd-a411-d348b2bf33e6 loopback loop /boot/grub/iso-images/livegui-rescue-2026.iso set root=(loop) linux /boot/gentoo nodhcp secureconsole root=live:CDLABEL=gentoo-amd64-livegui rd.live.dir=/ rd.live.squashimg=image.squashfs cdroot rd.live.ram=1 iso-scan/filename=/boot/grub/iso-images/livegui-rescue-2026.iso initrd /boot/gentoo.igz } } ### END /etc/grub.d/41_custom ### </codeprism> 부팅하고 정상 작동 여부 확인. gentoo/trouble/03-direct_iso_boot_use_grub.txt 마지막으로 수정됨: 2026/01/09 23:28저자 baecy