IT이야기2023. 12. 27. 07:35

대체로 리눅스로만 쓰는데 윈도우를 쓸일이 가끔 있고, 같은 프로그램이라도 윈도우 드라이버가 더 안정적이거나 다 빠른 경우가 있어서 윈도우에 대한 요구가 생기기도 합니다.

1. 처음부터 설치한다면, 윈도우 설치하고 리눅스를 설치하면 grub으로 부팅되면서 grub list에 마지막에 윈도우 옵션도 나오게 됩니다. 이러면 깔끔하게 정리되는데...

2. 리눅스가 설치되어 있는 서버에 윈도우를 설치했더니 손이 좀 많이 갑니다. Windows OS Bootloader가 grub을 업퍼버려서 그냥 윈도우로만 부팅됩니다. 물론 리눅스로 부팅하려면 F12를 눌러 부팅옵션으로 가고 리눅스가 설치된 디스크를 고르면 리눅스로 부팅도 가능합니다. 자주 쓰다보니 grub으로 부팅해야 겠다 생각이 들어서 찾아봤더니 좀 손이 많이 갑니다.

Ubuntu Live CD로 부팅후

Mount Ubuntu Partition

  • sudo mkdir /mnt/ubuntu
  • sudo mount /dev/sda1 /mnt/ubuntu

Chroot into Ubuntu Environment

  • sudo mount --bind /dev /mnt/ubuntu/dev
  • sudo mount --bind /proc /mnt/ubuntu/proc
  • sudo mount --bind /sys /mnt/ubuntu/sys
  • sudo chroot /mnt/ubuntu

Install GRUB

  • For BIOS systems: grub-install /dev/sda (replace with your actual disk)
  • For UEFI systems: grub-install --target=x86_64-efi --efi-directory=/boot/efi

update-grub

Exit Chroot and Reboot:

  • Exit the chroot environment: exit
  • Unmount partitions:
    • sudo umount /mnt/ubuntu/dev
    • sudo umount /mnt/ubuntu/proc
    • sudo umount /mnt/ubuntu/sys
    • sudo umount /mnt/ubuntu
  • Reboot your system: sudo reboot

Boot into Ubuntu

  • sudo vi /etc/default/grub
    • add GRUB_DISABLE_OS_PROBER=false
  • sudo update-grub
  • sudo reboot
  • sudo os-prober
  • sudo update-grub

 

Troubleshooting:

  • Incorrect Partition: Double-check the partition where Windows is installed using lsblk or other tools.
  • Windows Boot Manager Overwriting: Use efibootmgr to ensure GRUB is the default boot manager for UEFI systems.
  • Fast Boot: Disable Fast Boot in Windows to avoid potential conflicts.
  • Boot Repair: If issues persist, consider using the Boot Repair tool from an Ubuntu Live USB or CD.

'IT이야기' 카테고리의 다른 글

Python AI programming helper  (0) 2024.01.03
일론 머스크 2023년 최악의 CEO 10인에 선정  (0) 2023.12.30
AI Powered Video editor  (0) 2023.12.06
2023 슈퍼컴퓨터 순위 top500  (0) 2023.11.15
Fonts for coding 폰트  (0) 2023.11.14
Posted by 쁘레드