FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 08-25-2012, 11:13 AM
Florian Philipp
 
Default Disk migration boot loader not found

Hi list!

I've just completed migrating my system from one hard disk to another.
Although the new disk reports 512 byte blocks just like the old one, I
thought it would be a good idea to re-align the partitions anyway. I've
done it this way:

1. Create new partitions with gparted, at least as large as the old ones
(rounded up to full MiB).

2. `dd` from the old to the new disk.

3. `resize2fs` to match the new sizes.

4. Install grub ("root (hd1,4); setup (hd1); setup (hd1,4)")

4. Swap disks and reboot.

Unfortunately, the system failed to find the boot loader. There was no
grub error. The disk was simply skipped, as if it was unformatted.

The following steps were taken:

1. Verified that the `dd`ed partitions were sane.

2. Reinstalled grub from live-CD chroots several times.

3. Installed grub on a memory stick and booted from that.

At this point, my partition table looked like this:

Number Start End Size Type File system Flags
1 1049kB 316MB 315MB primary ntfs
2 316MB 750GB 750GB extended
5 317MB 424MB 107MB logical ext2 boot
6 425MB 22.4GB 22.0GB logical ext3
7 22.4GB 28.9GB 6441MB logical linux-swap(v1)
8 28.9GB 750GB 721GB logical

The first logical partition was the boot partition. The first primary
partition was a laptop-specific recovery partition. This setup was
identical to the old one except that I removed a primary partition which
resided /after/ the end of the extended partition.

At this point, I've reformatted the first primary partition as ext2 and
moved boot to this partition. This solved my problem.

Now, my question is: Why does this work and the old solution doesn't?
Why can't grub boot from a logical partition when it's MiB-aligned? I've
changed nothing that should affect the MBR. Then why wasn't at least the
stage 1 detected?

Thanks in advance!
Florian Philipp
 
Old 08-25-2012, 08:29 PM
Mick
 
Default Disk migration boot loader not found

On Saturday 25 Aug 2012 12:13:41 Florian Philipp wrote:
> Hi list!
>
> I've just completed migrating my system from one hard disk to another.
> Although the new disk reports 512 byte blocks just like the old one, I
> thought it would be a good idea to re-align the partitions anyway. I've
> done it this way:
>
> 1. Create new partitions with gparted, at least as large as the old ones
> (rounded up to full MiB).
>
> 2. `dd` from the old to the new disk.
>
> 3. `resize2fs` to match the new sizes.
>
> 4. Install grub ("root (hd1,4); setup (hd1); setup (hd1,4)")

Why did you run setup twice? Once to install to the MBR of the second disk
and once to install on the boot record of the 5th partition ... :-/


> 4. Swap disks and reboot.
>
> Unfortunately, the system failed to find the boot loader. There was no
> grub error. The disk was simply skipped, as if it was unformatted.
>
> The following steps were taken:
>
> 1. Verified that the `dd`ed partitions were sane.
>
> 2. Reinstalled grub from live-CD chroots several times.
>
> 3. Installed grub on a memory stick and booted from that.
>
> At this point, my partition table looked like this:
>
> Number Start End Size Type File system Flags
> 1 1049kB 316MB 315MB primary ntfs
> 2 316MB 750GB 750GB extended
> 5 317MB 424MB 107MB logical ext2 boot
> 6 425MB 22.4GB 22.0GB logical ext3
> 7 22.4GB 28.9GB 6441MB logical linux-swap(v1)
> 8 28.9GB 750GB 721GB logical
>
> The first logical partition was the boot partition. The first primary
> partition was a laptop-specific recovery partition. This setup was
> identical to the old one except that I removed a primary partition which
> resided /after/ the end of the extended partition.

You didn't need to remove it. You could have entered x (extra functionality)
and then f (fix partition order). Write the new table and run partprobe to
see what the kernel sees the partitions as now.

Another thing to check is what grub sees:

grub> find /boot/grub/stage1
(hd0,9)

The above is from a laptop of mine, where the linux boot partition is on
partition 10.

> At this point, I've reformatted the first primary partition as ext2 and
> moved boot to this partition. This solved my problem.
>
> Now, my question is: Why does this work and the old solution doesn't?
> Why can't grub boot from a logical partition when it's MiB-aligned? I've
> changed nothing that should affect the MBR. Then why wasn't at least the
> stage 1 detected?

I've got at least 4 machines with logical boot partitions and all boot fine.
Mind you though, the partition order is correct on all of them. I don't know
if that had something to do with it.

--
Regards,
Mick
 
Old 08-25-2012, 09:07 PM
Florian Philipp
 
Default Disk migration boot loader not found

Am 25.08.2012 22:29, schrieb Mick:
> On Saturday 25 Aug 2012 12:13:41 Florian Philipp wrote:
>> Hi list!
>>
>> I've just completed migrating my system from one hard disk to another.
>> Although the new disk reports 512 byte blocks just like the old one, I
>> thought it would be a good idea to re-align the partitions anyway. I've
>> done it this way:
>>
>> 1. Create new partitions with gparted, at least as large as the old ones
>> (rounded up to full MiB).
>>
>> 2. `dd` from the old to the new disk.
>>
>> 3. `resize2fs` to match the new sizes.
>>
>> 4. Install grub ("root (hd1,4); setup (hd1); setup (hd1,4)")
>
> Why did you run setup twice? Once to install to the MBR of the second disk
> and once to install on the boot record of the 5th partition ... :-/
>

Probably cargo cult. I tried it without this, to no avail.

>
>> 4. Swap disks and reboot.
>>
>> Unfortunately, the system failed to find the boot loader. There was no
>> grub error. The disk was simply skipped, as if it was unformatted.
>>
>> The following steps were taken:
>>
>> 1. Verified that the `dd`ed partitions were sane.
>>
>> 2. Reinstalled grub from live-CD chroots several times.
>>
>> 3. Installed grub on a memory stick and booted from that.
>>
>> At this point, my partition table looked like this:
>>
>> Number Start End Size Type File system Flags
>> 1 1049kB 316MB 315MB primary ntfs
>> 2 316MB 750GB 750GB extended
>> 5 317MB 424MB 107MB logical ext2 boot
>> 6 425MB 22.4GB 22.0GB logical ext3
>> 7 22.4GB 28.9GB 6441MB logical linux-swap(v1)
>> 8 28.9GB 750GB 721GB logical
>>
>> The first logical partition was the boot partition. The first primary
>> partition was a laptop-specific recovery partition. This setup was
>> identical to the old one except that I removed a primary partition which
>> resided /after/ the end of the extended partition.
>
> You didn't need to remove it. You could have entered x (extra functionality)
> and then f (fix partition order). Write the new table and run partprobe to
> see what the kernel sees the partitions as now.
>

I failed to make myself clear: I didn't create a corresponding partition
on the new disk because the content of the old partition was no longer
required. The whole "primary partition after extended one" business was
there just because HP was brain dead enough to format the disk with 4
primary partitions for Windows and recovery. Needless to say, I wasn't
to thrilled when I tried to install Gentoo on it :-/

> Another thing to check is what grub sees:
>
> grub> find /boot/grub/stage1
> (hd0,9)
>
> The above is from a laptop of mine, where the linux boot partition is on
> partition 10.
>

Tried that.

`find /boot/grub/stage1` -> File not found
`find /grub/stage1` -> "(hd0,4)" (which is correct). I understand the
difference arises because I have a separate boot partition and you don't
(or maybe a symlink /boot/boot -> /boot).

>> At this point, I've reformatted the first primary partition as ext2 and
>> moved boot to this partition. This solved my problem.
>>
>> Now, my question is: Why does this work and the old solution doesn't?
>> Why can't grub boot from a logical partition when it's MiB-aligned? I've
>> changed nothing that should affect the MBR. Then why wasn't at least the
>> stage 1 detected?
>
> I've got at least 4 machines with logical boot partitions and all boot fine.
> Mind you though, the partition order is correct on all of them. I don't know
> if that had something to do with it.
>
 
Old 08-25-2012, 09:41 PM
Mick
 
Default Disk migration boot loader not found

On Saturday 25 Aug 2012 22:07:42 Florian Philipp wrote:

> `find /boot/grub/stage1` -> File not found
> `find /grub/stage1` -> "(hd0,4)" (which is correct). I understand the
> difference arises because I have a separate boot partition and you don't
> (or maybe a symlink /boot/boot -> /boot).

No, I do have a separate /boot partition:

# df -h | grep /boot
/dev/sda10 46M 22M 22M 50% /boot


and I also have the symlink:

# ls -la /boot | grep boot
lrwxrwxrwx 1 root root 1 Feb 27 2010 boot -> .

--
Regards,
Mick
 
Old 08-26-2012, 12:32 PM
Florian Philipp
 
Default Disk migration boot loader not found

Am 25.08.2012 13:13, schrieb Florian Philipp:
> Hi list!
>
> I've just completed migrating my system from one hard disk to another.
> Although the new disk reports 512 byte blocks just like the old one, I
> thought it would be a good idea to re-align the partitions anyway. I've
> done it this way:
>
> 1. Create new partitions with gparted, at least as large as the old ones
> (rounded up to full MiB).
>
> 2. `dd` from the old to the new disk.
>
> 3. `resize2fs` to match the new sizes.
>
> 4. Install grub ("root (hd1,4); setup (hd1); setup (hd1,4)")
>
> 4. Swap disks and reboot.
>
> Unfortunately, the system failed to find the boot loader. There was no
> grub error. The disk was simply skipped, as if it was unformatted.
>
> The following steps were taken:
>
> 1. Verified that the `dd`ed partitions were sane.
>
> 2. Reinstalled grub from live-CD chroots several times.
>
> 3. Installed grub on a memory stick and booted from that.
>
> At this point, my partition table looked like this:
>
> Number Start End Size Type File system Flags
> 1 1049kB 316MB 315MB primary ntfs
> 2 316MB 750GB 750GB extended
> 5 317MB 424MB 107MB logical ext2 boot
> 6 425MB 22.4GB 22.0GB logical ext3
> 7 22.4GB 28.9GB 6441MB logical linux-swap(v1)
> 8 28.9GB 750GB 721GB logical
>
> The first logical partition was the boot partition. The first primary
> partition was a laptop-specific recovery partition. This setup was
> identical to the old one except that I removed a primary partition which
> resided /after/ the end of the extended partition.
>
> At this point, I've reformatted the first primary partition as ext2 and
> moved boot to this partition. This solved my problem.
>
> Now, my question is: Why does this work and the old solution doesn't?
> Why can't grub boot from a logical partition when it's MiB-aligned? I've
> changed nothing that should affect the MBR. Then why wasn't at least the
> stage 1 detected?
>
> Thanks in advance!
> Florian Philipp



Turns out, I was wrong in thinking the immediate problem was solved. In
fact, the system just booted of the memory stick without me noticing.
I've now finally solved by re-creating the boot partition without
MiB-alignment, just good old cfdisk. So, the working partition scheme
looks like this:

Number Start End Size Type File system Flags
1 32.3kB 316MB 316MB primary ext2 boot
2 316MB 750GB 750GB extended
5 317MB 424MB 107MB logical ext2
6 425MB 22.4GB 22.0GB logical ext3
7 22.4GB 28.9GB 6441MB logical linux-swap(v1)
8 28.9GB 750GB 721GB logical

Is there an explanation for this?

Regards,
Florian Philipp
 
Old 08-26-2012, 02:32 PM
Hinnerk van Bruinehsen
 
Default Disk migration boot loader not found

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26.08.2012 14:32, Florian Philipp wrote:
> Am 25.08.2012 13:13, schrieb Florian Philipp:
<SNIP>
>> At this point, my partition table looked like this:
>>
>> Number Start End Size Type File system Flags 1
>> 1049kB 316MB 315MB primary ntfs 2 316MB 750GB
>> 750GB extended 5 317MB 424MB 107MB logical ext2
>> boot 6 425MB 22.4GB 22.0GB logical ext3 7 22.4GB
>> 28.9GB 6441MB logical linux-swap(v1) 8 28.9GB 750GB
>> 721GB logical
>>
<SNIP>
> Turns out, I was wrong in thinking the immediate problem was
> solved. In fact, the system just booted of the memory stick without
> me noticing. I've now finally solved by re-creating the boot
> partition without MiB-alignment, just good old cfdisk. So, the
> working partition scheme looks like this:
>
> Number Start End Size Type File system Flags 1
> 32.3kB 316MB 316MB primary ext2 boot 2 316MB
> 750GB 750GB extended 5 317MB 424MB 107MB logical
> ext2 6 425MB 22.4GB 22.0GB logical ext3 7 22.4GB
> 28.9GB 6441MB logical linux-swap(v1) 8 28.9GB 750GB
> 721GB logical
>
> Is there an explanation for this?
>

Hi there,

if my eye-integrated diff doesn't deceive me the problem was, that
your old bootpartition was ntfs. Since grub doesn't support ntfs
that's an easy explanation.
Your boot partition is the first one on the drive, isn't it?

WKR
Hinnerk

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQOjN3AAoJEJwwOFaNFkYclu4IALAP/vyTUTiDolDjGyo2CBAH
T3dWl+9nw482HKdISpHyki9MzwMc/ObMokdpmwY4e1RrReCorHK5jCGxBQTa1wpo
C4l+aTPCsAhnZDMWKcJeL/EMB4dZeKVFEG2JxISJvBxFVrUcyzuv384+Dk/5UehE
/Do6kDALnnmhk3b6X13xlrj9dQOQ6S0S5940Qz6DfN4FtedDnkZ rVr0csCTWwl5q
eWom3D8jpUul4hqvnRzTh6Er89ORWfDCcARBXSYNiAmp6lawUM a7dF8mIO5P6cB/
Viv0qE/myxGnvezlH745NEneGyuPSePEz4G9Qya3e5MYV7zmE4CU2DUcU EiebSw=
=IwzC
-----END PGP SIGNATURE-----
 
Old 08-26-2012, 03:58 PM
Mick
 
Default Disk migration boot loader not found

On Sunday 26 Aug 2012 15:32:23 Hinnerk van Bruinehsen wrote:
> On 26.08.2012 14:32, Florian Philipp wrote:
> > Am 25.08.2012 13:13, schrieb Florian Philipp:
> <SNIP>
>
> >> At this point, my partition table looked like this:
> >>
> >> Number Start End Size Type File system Flags 1
> >> 1049kB 316MB 315MB primary ntfs 2 316MB 750GB
> >> 750GB extended 5 317MB 424MB 107MB logical ext2
> >> boot 6 425MB 22.4GB 22.0GB logical ext3 7 22.4GB
> >> 28.9GB 6441MB logical linux-swap(v1) 8 28.9GB 750GB
> >> 721GB logical
>
> <SNIP>
>
> > Turns out, I was wrong in thinking the immediate problem was
> > solved. In fact, the system just booted of the memory stick without
> > me noticing. I've now finally solved by re-creating the boot
> > partition without MiB-alignment, just good old cfdisk. So, the
> > working partition scheme looks like this:
> >
> > Number Start End Size Type File system Flags 1
> > 32.3kB 316MB 316MB primary ext2 boot 2 316MB
> > 750GB 750GB extended 5 317MB 424MB 107MB logical
> > ext2 6 425MB 22.4GB 22.0GB logical ext3 7 22.4GB
> > 28.9GB 6441MB logical linux-swap(v1) 8 28.9GB 750GB
> > 721GB logical
> >
> > Is there an explanation for this?
>
> Hi there,
>
> if my eye-integrated diff doesn't deceive me the problem was, that
> your old bootpartition was ntfs. Since grub doesn't support ntfs
> that's an easy explanation.
> Your boot partition is the first one on the drive, isn't it?

Originally the boot partition was on /dev/sda5 which was partitioned as ext2.

Was this legacy GRUB Florian? (TBH I'm not sure that it would make a
difference. I can boot here fine from logical non-MiB aligned partitions with
legacy GRUB.)
--
Regards,
Mick
 
Old 08-26-2012, 04:33 PM
Florian Philipp
 
Default Disk migration boot loader not found

Am 26.08.2012 17:58, schrieb Mick:
> On Sunday 26 Aug 2012 15:32:23 Hinnerk van Bruinehsen wrote:
>> On 26.08.2012 14:32, Florian Philipp wrote:
>>> Am 25.08.2012 13:13, schrieb Florian Philipp:
>> <SNIP>
>>
>>>> At this point, my partition table looked like this:
>>>>
>>>> Number Start End Size Type File system Flags 1
>>>> 1049kB 316MB 315MB primary ntfs 2 316MB 750GB
>>>> 750GB extended 5 317MB 424MB 107MB logical ext2
>>>> boot 6 425MB 22.4GB 22.0GB logical ext3 7 22.4GB
>>>> 28.9GB 6441MB logical linux-swap(v1) 8 28.9GB 750GB
>>>> 721GB logical
>>
>> <SNIP>
>>
>>> Turns out, I was wrong in thinking the immediate problem was
>>> solved. In fact, the system just booted of the memory stick without
>>> me noticing. I've now finally solved by re-creating the boot
>>> partition without MiB-alignment, just good old cfdisk. So, the
>>> working partition scheme looks like this:
>>>
>>> Number Start End Size Type File system Flags 1
>>> 32.3kB 316MB 316MB primary ext2 boot 2 316MB
>>> 750GB 750GB extended 5 317MB 424MB 107MB logical
>>> ext2 6 425MB 22.4GB 22.0GB logical ext3 7 22.4GB
>>> 28.9GB 6441MB logical linux-swap(v1) 8 28.9GB 750GB
>>> 721GB logical
>>>
>>> Is there an explanation for this?
>>
>> Hi there,
>>
>> if my eye-integrated diff doesn't deceive me the problem was, that
>> your old bootpartition was ntfs. Since grub doesn't support ntfs
>> that's an easy explanation.
>> Your boot partition is the first one on the drive, isn't it?
>
> Originally the boot partition was on /dev/sda5 which was partitioned as ext2.
>

Right.

> Was this legacy GRUB Florian? (TBH I'm not sure that it would make a
> difference. I can boot here fine from logical non-MiB aligned partitions with
> legacy GRUB.)

Right again.

Regards,
Florian Philipp
 

Thread Tools




All times are GMT. The time now is 07:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org