====== Linux Grub ====== * [[https://help.ubuntu.com/community/Grub2|Ubuntu Grub2]] * [[https://help.ubuntu.com/community/Grub2/Setup|Grub2/Setup - Community Help Wiki]] * [[https://help.ubuntu.com/community/StartUpManager|StartUpManager]] : Grub2 관리를 편리하게. 기본 부팅 OS 변경, 선택 시간 변경 등의 작업이 가능함. * https://help.ubuntu.com/community/Grub2/ * https://help.ubuntu.com/community/Grub2/Installing * [[linux:uefi|Linux UEFI]] ===== Group Customizer ===== [[linux:ubuntu:22.04|Ubuntu Linux 22.04 Jammy Jellyfish]]에서 기본 패키지에서 제거됨. sudo add-apt-repository ppa:danielrichter2007/grub-customizer 그 이전 버전에는 기본으로 있음. ===== Grub 자체가 노출이 안 될때 ===== * 일부 상황에서 grub 이 화면에 안나오고 곧 바로 부팅되는 현상이 발생하는 경우가 있었음. * [[https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1863434|Bug #1863434 “20.04 grub menu not visible” : Bugs : grub2 package : Ubuntu]] * ''2.06'' 버전에서 해결됨. * ''/etc/default/grub'' 파일에서 GRUB_TIMEOUT=5 # 적당한 값으로 GRUB_TIMEOUT_STYLE="hidden" # 이 부분이 핵심이었음. 그렇지만 이렇게 하면 그래픽 테마를 적용할 수 없는 듯. GRUB_TERMINAL=console * 이제 ''grub'' 설정 변경 사항 적용. sudo update-grub ===== 부팅화면에 바탕이미지 깔기 ===== * http://www.ubuntu.or.kr/viewtopic.php?f=4&t=24338 ===== 해상도 Screen Resolution 변경 ===== * [[https://askubuntu.com/questions/54067/how-to-safely-change-grub2-screen-resolution|How to safely change grub2 screen resolution? - Ask Ubuntu]] * 먼저 부팅시의 ''grub'' 화면에서 ''c'' 를 눌러 ''videoinfo'' 명령을 실행한다. 그 결과중에 원하는 해상도가 있는지 확인한다. 보통은 ''1920x1080x32'' 가 있을 것이다. * ''/etc/default/grub'' 파일에서 해상도 정보 넣기 # videoinfo 명령에서 나온 결과중에 원하는 해상도 지정 GRUB_GFXMODE="1920x1080x32" # 테마도 해상도에 맞게 지정한다. GRUB_THEME="/boot/grub/themes/tela-1k/theme.txt" * ''sudo update-grub'' 실행하고 재부팅 ===== themes ===== * [[https://github.com/vinceliuice/grub2-themes|grub2-themes]] 몇몇 테마를 자동으로 깔아준다. 2k, 4k 등도 지원. * [[https://www.gnome-look.org/browse/cat/109/order/latest/|gnome-look grub 2 themes]] * ''theme.txt'' 가 있는 폴더를 통으로(상위 디렉토리 빼고) 압축해서 ''grub-customizer''에서 install 해주면 된다. * ''grub-customizer''는 ''/boot/grub/themes/'' 에 있는 테마만을 찾는데, 실제로 표준 경로는 ''/usr/share/grub/themes''라서 ''/etc/defualt/grub'' 파일에서 ''GRUB_THEME'' 항목을 직접 수정해줘야 한다. * [[https://www.gnome-look.org/p/1307852/|Tela grub theme - Gnome-look.org]] : 4k 지원 * [[https://github.com/AdisonCavani/distro-grub-themes|distro-grub-themes]] 각 배포판별 Grub theme * 그외 기본 grub 테마들의 경우 사용자정의상태의 한글글꼴과 테마의 글꼴 크기(''theme.txt''에 보면 나옴)를 잘 맞춰 줘야 함. sudo apt-get install grub2-themes-ubuntu-mate \ grub2-themes-ubuntustudio ===== Font 등 변경 ===== * [[https://m.blog.naver.com/PostView.nhn?blogId=any9122&logNo=220967365222&proxyReferer=https:%2F%2Fwww.google.com%2F|grub2 메뉴의 폰트, 대기시간, 해상도 수정하기 : 네이버 블로그]] * [[http://blog.wxm.be/2014/08/29/increase-font-in-grub-for-high-dpi.html|Increase Font in GRUB for High DPI Screens | blog]] ==== 배민 연성체 32 로 지정해보기 ==== sudo grub-mkfont --output=/boot/grub/fonts/BMHANNA_11yrs32.pf2 \ --size=32 ./BMHANNA_11yrs_ttf.ttf * ''/etc/default/grub'' 여기까지 하면 매칭 안되는 글씨(보통 한글)가 나올 때 ''GRUB_FONT''의 값을 사용함. GRUB_FONT="/boot/grub/fonts/BMHANNA_11yrs32.pf2" * 사용중인 테마의 ''theme.txt'' 에서 글꼴을 ''BM YEONSUNG Regular''로 변경 item_font = "BM HANNA 11yrs old Regular 32" font = "BM HANNA 11yrs old Regular 32" * ''update-grub'' sudo update-grub ===== 파일 자동 탐색 ===== - ''/boot/grub'' 에 이미지 파일을 복사한다. - ''/etc/default/grub'' 파일에 화면 해상도를 지정한다. GRUB_GFXMODE=1920x1080 - ''update-grub'' ===== 파일 명시 ===== - ''/etc/default/grub''에 이미지 파일 명시 GRUB_BACKGROUND="/path/to/image.png" - ''update-grub'' ===== AMD 그래픽 카드 계열에서 절전 모드 깨어나지 못하는 문제 ===== 최신 버전에서는 무관할 수 있음. http://ubuntu.or.kr/viewtopic.php?p=103499#p103499 sudo nano /etc/default/grub GRUB_CMDLINE_LINUX="radeon.modeset=0" sudo update-grub ===== Boot Repair ===== - Live USB로 다시 부팅하여 [[https://help.ubuntu.com/community/Boot-Repair|Boot-Repair]]를 설치하고,(리눅스 설치 후 BIOS에서 부팅 순서가 바뀌었을 수 있으므로 USB 부팅이 안되면 부팅순서 재확인) - ''boot-repair'' 실행 - ''Recommended Repair'' 클릭. 작업 끝난 후 나온 URL을 적어두고, 재부팅 후에도 작동하지 않으면 해당 URL을 설명에 나온 이메일로 보내서 문의. - [[https://wnw1005.tistory.com/481|씨실과 날실 - IT :: 우분투에서 부트로더(boot loader) GNU GRUB 복구]] - [[https://wnw1005.tistory.com/480|씨실과 날실 - IT :: 리눅스 필수 설치 패키지 - boot-repair]] ==== boot-repair PPA 설치 ==== sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install -y boot-repair && boot-repair ===== EFI 파티션일 때 Repair ===== * EFI 파티션이 있는 상태인데, ''BootRepair'' 가 잘 안되고''grub-efi''를 복구하고자 할때 # EFI 모드인지 확인하기 [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD" # 결과가 EFI boot on HDD 로 출력돼야 한다. * [[https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition|boot - How can I reinstall GRUB to the EFI partition? - Ask Ubuntu]] * Ubuntu Live Media 로 **UEFI-mode**로 부팅해서 작업한다. sudo mkdir /mnt/ubuntu sudo mount /dev/sdXY /mnt/ubuntu sudo mount /dev/sdXX /mnt/ubuntu/boot/efi for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt/ubuntu$i; done sudo chroot /mnt/ubuntu grub-install /dev/sdX update-grub * ''sdX'' : 리눅스 파티션이 있는 디스크 * ''sdXX'' : EFI 파티션 * ''sdXY'' : 리눅스 파티션 * [[https://wiki.debian.org/GrubEFIReinstall|GrubEFIReinstall - Debian Wiki]] 함께 참조 ===== 참조 문서 ===== * [[http://www.binarytides.com/ubuntu-fix-nvidia-graphics/|Fix low resolution grub and splash screen with Nvidia drivers on Ubuntu 14.04]]