Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The purpose of these notes is to create a second Linux-only EFI partition and leave the tiny 100 MB Windows EFI partition untouched. With two EFI partitions you have the option to set either Windows or Linux-boot-loader as the default boot option in the bios. Also you can reinstall either OS without issue, and delete/recreate/resize the Linux EFI as needed. You can also set the Windows EFI as the default boot option if you don't want to see the Linux grub screen every boot (and still boot Linux by selecting its entry in your BIOS's "Drive Selection" menu during system startup).
- NOTE: At this point in the install i have one functioning EFI partition. It is the first partition of the primary drive and just used by Windows. I have a second EFI partition that is blank right now (created earlier when partitioning drives), it is the last partition of a second drive (it is positioned last for situations where i might need to resize it or recreate/delete it if i decide to install another distro).
- Installing the grub bootloader in the secondary EFI partition (mounted as /boot/efi):
- $ pacman -S grub efibootmgr os-prober
- $ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Arch --removable
- Then i configure grub (my preferences, and i have some nvidia settings here so do what works for you):
- $ vim /etc/default/grub
- GRUB_DEFAULT=0 <-- Change to 2 (0-based) to select the third item in menu, "Windows Boot Manager".
- GRUB_HIDDEN_TIMEOUT=5 <-- Change to 7.
- GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia_drm.modeset=1" <-- For wayland support on Nvidia proprietary drivers add nvidia_drm.modeset=1 (this fixes the issue where all you get is a black screen and a mouse cursor).
- GRUB_CMDLINE_LINUX="" <-- Leave this "" because it applies to both normal AND recovery modes: https://askubuntu.com/questions/575651/what-is-the-difference-between-grub-cmdline-linux-and-grub-cmdline-linux-default
- GRUB_GFXMODE=auto <-- Change "auto" to "1280x720" if you want. If it doesn't work then press 'c' at the grub menu and use the command $ videoinfo to see what resolutions are supported.
- GRUB_COLOR_NORMAL="red/black"
- GRUB_COLOR_HIGHLIGHT="black/red"
- #GRUB_DISABLE_OS_PROBER=false <-- Uncomment last line. This tells grub to use os-prober to detect other bootable partitions.
- Generate the main configuration file:
- $ grub-mkconfig -o /boot/grub/grub.cfg
- NOTE: [$ os-prober] will not return anything. We need to repeat this step after first reboot to detect windows EFI and add Windows to grub menu.
- Exiting chroot and restarting or shutting down machine:
- $ exit or Ctrl+d
- $ umount -lR /mnt/ <-- Unmount all partitions.
- Remove installation media.
- $ reboot
- Boot up:
- Login to arch install.
- $ sudo grub-mkconfig -o /boot/grub/grub.cfg
- Now [$ os-prober] will work and grub-mkconfig output will say "Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi".
- And then do whatever else you need to do to complete the base install, i.e. connect to internet, config pacman etc.
- -----
- Some extra info regarding fstab for this setup:
- How my /etc/fstab looks (note the two mounted EFI partitions):
- # Static information about the filesystems.
- # See fstab(5) for details.
- # NOTE: If a drive is a SSD (that supports TRIM) then for SOME filesystems you can add the 'discard' option which causes discard/TRIM commands to be issued to the block device when blocks are free.
- # WARNING: Users need to be certain that their SSD supports TRIM before attempting to use it. Data loss can occur otherwise! https://wiki.archlinux.org/title/Solid_state_drive#TRIM
- # Instead of 'discard' (continuous TRIM) use in fstab, you can enable the fstrim timer (periodic TRIM) for more efficiency.
- # <file system> <mount point> <type> <options> <dump> <pass>
- UUID=6d3bcf47-8794-4335-b408-7385d219f284 / ext4 defaults,noatime 0 1
- UUID=bb944a3b-86fa-41db-80d8-64b8e51ef575 /home ext4 defaults,noatime 0 2
- UUID=1AF1-9AF7 /boot/efi vfat defaults,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
- UUID=CECF-FFCB /boot/efi-win vfat defaults,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro,nofail,x-systemd.device-timeout=15 0 2
- # Mount your other drives here...
- -----
- fstrim mini-tutorial for SSDs:
- Setting up fstrim timer:
- While you can use the discard option for the swap file on an SSD, using periodic TRIM with fstrim is often recommended to avoid potential performance impacts.
- This ensures that the SSD can efficiently manage unused blocks without the overhead of continuous TRIM commands.
- Check Timer Status:
- sudo systemctl status fstrim.timer
- sudo systemctl list-timers --all
- Enable the Timer:
- sudo systemctl enable fstrim.timer
- sudo systemctl start fstrim.timer
- When the timer runs, it executes the following command:
- fstrim -Av <-- This command trims all mounted filesystems (-A for all) that support trimming, and shows verbose output (-v). You can run this manually to see what drives are trimmed and which are skipped because they don't support trimming.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement