GNU GRUB Installation

GNU GRUB is a Multiboot boot loader: a boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel software .

Documentation:

(1) Install grub

grub-install /dev/sda --boot-directory /boot

## example which load OS from floppy disk
mke2fs /dev/fd0
mount -t ext2 /dev/fd0 /mnt
mkdir /mnt/boot
grub-install --boot-directory=/mnt/boot /dev/fd0
umount /mnt

###losetup: Set up and control loop devices
losetup /dev/loop0 /dev/sdb1
mount /dev/loop0 /mnt/usb
grub-install --boot-directory=/mnt/usb/bugbios --force --allow-flopy /dev/fd0


-----------
## On EFI system have to install efi partition
grub-install --efi-directory=/mnt/efi

-----------
## For removable 
grub-install -efi-directory=/mnt/efi --boot-directory=/mng/usb/boot --removable


 Make a rescue CD-Rom

grub-mkrescue -o grub.iso

-----------
Include other files in the images
mkdir iso
mkdir -p /iso/boot/grub
grub-mkrescue -o grub.iso iso

If device map file exist, grub-probe read it into map BIOS drives to OS devices.  The device map file consist of :

(device)  file  

 

BIOS knowledge:

MBR:  used on PC BIOS platform, called Master Boot Record. This format allows up to four primary partitions and additional logical parititions;

           There are two ways to install grub: (1) install grub between MBR and first partition; (2)core image installed in filesystem and the list of block 

           stored in the first sector of the partition;

GTP: GUID Partition Table format, as specified in the Extensible Firmware Interface; Use this format can reserve a whole parition for GRUB, Called 

         BIOS Boot Partition

### parted for grub 
parted /dev/disk set partition-number bios_grub on

### If use gdisk, set partition type to "0xEF02"

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值