hasemsupplies.blogg.se

Grub on usb to boot hard drive
Grub on usb to boot hard drive





grub on usb to boot hard drive
  1. #Grub on usb to boot hard drive how to#
  2. #Grub on usb to boot hard drive install#

We create this directory and copy the bootloader parts into it, most easily from our development system’s hard drive – which hopefully also boots with GRUB: mkdir -p cp /boot/grub/*stage* /mnt/boot/grub Grub is stored in the directory /boot/grub. First we mount the new partition after /mnt: mount /dev/sda1 /mnt

#Grub on usb to boot hard drive install#

Now we prepare a directory structure for GRUB and install it on the USB stick. of type ext2: mkfs.ext2 /dev/sda1 Install GRUB On this partition we create a file system, e.g. Important: For the kernel to really interpret the new partition table correctly, it may be necessary to unplug and re-plug the USB stick once. This can be done with fdisk /dev/sda or cfdisk /dev/sda, for example. Now we create a partition table with one partition and activate it (bootable flag). In the following we assume that /dev/sda is the same as the USB key.Īttention: the following command irretrievably deletes all data on this device! Make sure beforehand which device file your USB stick really addresses! cat /dev/zero > /dev/sdaĬat: write error: No space left on device If there are no SCSI, SATA or other USB storage devices connected to the system, the device used for the USB stick is usually /dev/sda.

#Grub on usb to boot hard drive how to#

The following procedure illustrates how to install a working bootloader on a USB stick:įirst we overwrite the complete stick with zero bytes. You want to boot a Linux system from a USB stick.







Grub on usb to boot hard drive