GRUB for USB
Go to file
Alexander Zhirov e4fe19450b fix umount 2024-10-14 14:57:45 +03:00
grub themes 2024-10-06 22:47:09 +03:00
README.md themes 2024-10-06 22:47:09 +03:00
install.sh fix umount 2024-10-14 14:57:45 +03:00

README.md

GRUB for USB

#!/bin/bash

disk="${1}"

parted ${disk} -s mklabel gpt
parted ${disk} -s -- mkpart primary 2048s 2099199s
parted ${disk} -s -- mkpart primary 2099200s 40G
parted ${disk} -s -- mkpart primary 40G 100%

parted ${disk} -s set 1 boot on

mkfs.fat -F32 ${disk}1
mkfs.ext4 -F ${disk}2

mount -v -o umask=000 ${disk}1 /mnt

grub-install --removable --boot-directory=/mnt/boot --efi-directory=/mnt --target=x86_64-efi ${disk}
grub-install --removable --boot-directory=/mnt/boot --efi-directory=/mnt --target=i386-efi ${disk}

touch /mnt/boot/grub/grub.cfg

umount -v ${disk}1
NAME        FSTYPE FSVER LABEL
sda
├─sda1      vfat   FAT32
├─sda2      ext4   1.0   unix
├─sda3      ntfs         win10lite
├─sda4      ntfs         win11
└─sda5      ntfs         win10