1 |
On Saturday 25 Aug 2012 12:13:41 Florian Philipp wrote: |
2 |
> Hi list! |
3 |
> |
4 |
> I've just completed migrating my system from one hard disk to another. |
5 |
> Although the new disk reports 512 byte blocks just like the old one, I |
6 |
> thought it would be a good idea to re-align the partitions anyway. I've |
7 |
> done it this way: |
8 |
> |
9 |
> 1. Create new partitions with gparted, at least as large as the old ones |
10 |
> (rounded up to full MiB). |
11 |
> |
12 |
> 2. `dd` from the old to the new disk. |
13 |
> |
14 |
> 3. `resize2fs` to match the new sizes. |
15 |
> |
16 |
> 4. Install grub ("root (hd1,4); setup (hd1); setup (hd1,4)") |
17 |
|
18 |
Why did you run setup twice? Once to install to the MBR of the second disk |
19 |
and once to install on the boot record of the 5th partition ... :-/ |
20 |
|
21 |
|
22 |
> 4. Swap disks and reboot. |
23 |
> |
24 |
> Unfortunately, the system failed to find the boot loader. There was no |
25 |
> grub error. The disk was simply skipped, as if it was unformatted. |
26 |
> |
27 |
> The following steps were taken: |
28 |
> |
29 |
> 1. Verified that the `dd`ed partitions were sane. |
30 |
> |
31 |
> 2. Reinstalled grub from live-CD chroots several times. |
32 |
> |
33 |
> 3. Installed grub on a memory stick and booted from that. |
34 |
> |
35 |
> At this point, my partition table looked like this: |
36 |
> |
37 |
> Number Start End Size Type File system Flags |
38 |
> 1 1049kB 316MB 315MB primary ntfs |
39 |
> 2 316MB 750GB 750GB extended |
40 |
> 5 317MB 424MB 107MB logical ext2 boot |
41 |
> 6 425MB 22.4GB 22.0GB logical ext3 |
42 |
> 7 22.4GB 28.9GB 6441MB logical linux-swap(v1) |
43 |
> 8 28.9GB 750GB 721GB logical |
44 |
> |
45 |
> The first logical partition was the boot partition. The first primary |
46 |
> partition was a laptop-specific recovery partition. This setup was |
47 |
> identical to the old one except that I removed a primary partition which |
48 |
> resided /after/ the end of the extended partition. |
49 |
|
50 |
You didn't need to remove it. You could have entered x (extra functionality) |
51 |
and then f (fix partition order). Write the new table and run partprobe to |
52 |
see what the kernel sees the partitions as now. |
53 |
|
54 |
Another thing to check is what grub sees: |
55 |
|
56 |
grub> find /boot/grub/stage1 |
57 |
(hd0,9) |
58 |
|
59 |
The above is from a laptop of mine, where the linux boot partition is on |
60 |
partition 10. |
61 |
|
62 |
> At this point, I've reformatted the first primary partition as ext2 and |
63 |
> moved boot to this partition. This solved my problem. |
64 |
> |
65 |
> Now, my question is: Why does this work and the old solution doesn't? |
66 |
> Why can't grub boot from a logical partition when it's MiB-aligned? I've |
67 |
> changed nothing that should affect the MBR. Then why wasn't at least the |
68 |
> stage 1 detected? |
69 |
|
70 |
I've got at least 4 machines with logical boot partitions and all boot fine. |
71 |
Mind you though, the partition order is correct on all of them. I don't know |
72 |
if that had something to do with it. |
73 |
|
74 |
-- |
75 |
Regards, |
76 |
Mick |