![put just grub on usb put just grub on usb](https://1.bp.blogspot.com/-aVBiMGPUpiI/XY0L53BruzI/AAAAAAABzMI/_4h4aWXYObYKsVaLmEiBfoGO4WzjcnHnwCLcBGAsYHQ/s1600/20190911_214141.jpg)
Sfdisk -no-reread /dev/sdc /media/boot/boot/grub/grub.cfg <
![put just grub on usb put just grub on usb](https://www.pendrivelinux.com/wp-content/uploads/Ubuntu-20.04.jpg)
We need a GPT scheme with a big data partition, a small EFI system partition (~100 megaoctets usually recommended, less than on required for GRUB) and a tiny BIOS boot partition (necessary to install MBR GRUB). Just wipe the areas outside the main partitions.ĭd bs=512 if=/dev/zero seek=0 count=2048 of=/dev/sdcĭd bs=512 if=/dev/zero seek=15767552 count=2048 of=/dev/sdcĬreate the partitions. Device path:įirst, let us wipe the device, so that traces of previous partitions and attemps do not interfer. Note that sfdisk is probably not in the default path. We assume we have read and write permissions on the device and use pmount to mount partitions, but otherwise we do not need root privileges. The size can be obtained from /proc/partitions (un units of 1024, so need to multiply by 2) or using /sbin/blockdev -getsz. This is written as a script, to have it compute the partitions positions and sizes automatically based on the size of the USB stick. It is a complement to this article about using GRUB to boot a live image written as a file rather than an image.Īfter this, the device has a little wasted space and a directory named boot, but is otherwise completely usable for other tasks.
#Put just grub on usb how to
The purpose of this article is to explain how to install GRUB on an USB stick, or any other kind of USB mass-storage device, to make it bootable in either legacy BIOS or UEFI mode and allow to load live images installed in a directory. Installing GRUB on an hybrid BIOS/UEFI stick