[Top][All Lists]

[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: jmh6
Subject: Re: How to boot a memory stick image of a hard drive?
Date: Sat, 15 Jul 2017 12:01:00 -0400 (EDT)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

Hi Pascal,

    Thanks again !!

    I downloaded the latest grub CD.

I notice that when I partition using fdisk is usually leaves some blocks at the beginning. I guess this is for grub?

In any case I 'should' be able to prepare the disk using fdisk and then load my /dev/sda2 image where is should be. Make the swap space and run grub-install.

I now have a running disk. So I will try moving the beginning of partition 1 and reformating it as swap and see if grub 2.02 will just work.

Does grub document how much space it needs? I guess there really ought to be a special grub partition.

I made two memory stick versions. One with just /dev/sda2 and one with the whole hard drive image. I think I can now get the /dev/sda2 image running and also update grub at the same time.

    Thanks to you, I think I am beginning to understand grub.


On Sat, 15 Jul 2017, Pascal Hambourg wrote:

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.


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 ?

Help-grub mailing list

reply via email to

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