help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to boot a memory stick image of a hard drive?


From: Pascal Hambourg
Subject: Re: How to boot a memory stick image of a hard drive?
Date: Sat, 15 Jul 2017 18:11:11 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Le 15/07/2017 à 12:40, address@hidden a écrit :

Did this go to the list and the right thread??

Yes it did.

I am not really sure how to make sure that is done correctly.

You just have to reply to the proper mail.

    That system uses Grub 0.97.

Oh, I overlooked the fact that you were using this old deprecated version of GRUB, now called "GRUB legacy". I do not remember much how it works.

Swap starts at block 1 [512 byte  blocks].

This is bad.
1) This leaves no room for stage1.5 (GRUB legacy) or embedded core image (GRUB 2), making the boot process less reliable. 2) The swap partition is not aligned on flash write/erase blocks boundaries (typically up to 1 MiB), causing write performance degradation and increased wear.

So I guess that what is in the MBR must find /dev/sda2 /boot/stage1?

No, what is in the MBR *is* stage1. And it looks for stage2 in /boot/grub.

An older version of grub I assume.

Yes.

While the MBR hex is very similar to /boot/grub/Stage1 it is not identical which I would expect.

The MBR also contains the primary DOS partition table.

Next I am planning to try your grub 2.02 method. But what about swap starting at block 1. How big a space does there need to be at the beginning of the hard drive to accomodate grub?

The traditional gap was 31 KiB (62 sectors). This can be too small for for GRUB 2 core image. At least 64 KiB is better.
The modern alignment boundary is 1 MiB. This is plenty enough for GRUB.

What about the root partition alignment on the USB stick ?

So I will have Linux running with the to be activated hard drive also attached as /dev/sdb and the /dev/sda2 image on a memory stick.

I am assuming grub will not move disk partitions to make room for itself? So I guess I have to do that first?

Indeed. Instead of shrinking and moving the swap partition, is is easier to delete and recreate it with proper alignment. Then with mkswap you format it and give it the same UUID as the old one (as found in /etc/fstab).

I will mount /dev/sda2 somewhere convenient and follow what you have written below.

    After that, grub will be upgraded to 2.02 and the disk should boot.

Hmm. How do you intend to upgrade GRUB on the USB stick ?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]