grub2 installation new disk

My main problem is that I can’t get Windows to load. I have sda and sdb. sda had triple boot with windows,opensuse 12.1,ubuntu 12.04. I bought a new drive (because the first one was failing) and setup a ntfs drive at the first partition of sdb.(my opensuse 12.2 is installed on sdb6) There I used dd to copy the whole windows partition on sda over to sdb1 since I don’t want to reinstall everything. So I thought it worked. Grub 2 found windows on /dev/sdb1 and it loaded when I selected it. Then I wiped the partition on sda. Now Windows doesn’t load. I think the reason is because windows was actually booting the first partition of the first disk- sda not sdb.

So…I tried making a 40-custom entry with

drivemap -s hd0 hd1

Well that didn’t work. So then I tried disconnecting sda. Well, grub2 is only installed on sda so I got a system that wouldn’t boot. So then I tried installing grub2 on my sdb drive. Then I found out

grub-install /dev/sdb

doesn’t work. so I then did

grub-install.unsupported /dev/sdb

Well this works, but when I reboot I am only presented with a grub prompt.

So I would like to know how to get grub2 menus working off of /dev/sdb .
But more importantly I would like to get my windows vista loaded.

Thanks for your time.
I’m running opensuse 12.2 rc1 32-bit

oh and I tried using yast of course, but it wouldn’t let me choose which drive to install grub2 on. If grub-install isn’t going to work then yast2 bootloader needs some polishing. :slight_smile:

okay, nevermind about the grub-install its grub2-install. Worked fine. I must sound stupid. :slight_smile:
anyway, but now I actually get an error from grub when loading windows. it says
“invalid signature”.
I dont’ know if this matters but

fdisk -l

results in this

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x45399c46

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   147707903    73852928    7  HPFS/NTFS/exFAT
/dev/sda2       147707904   188747775    20519936    7  HPFS/NTFS/exFAT
/dev/sda3       188749822  1953523711   882386945    f  W95 Ext'd (LBA)
/dev/sda5       188749824   209713151    10481664   82  Linux swap / Solaris
/dev/sda6       209715200   314568703    52426752   83  Linux
/dev/sda7       314570752   733992959   209711104   83  Linux
/dev/sda8       733995008   812120007    39062500   83  Linux
/dev/sda9       812120064  1007431679    97655808   83  Linux
/dev/sda10     1007433728  1953523711   473044992   83  Linux

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000c51e9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   419424255   209711104   83  Linux
/dev/sdb2       419424256  3907028991  1743802368    f  W95 Ext'd (LBA)
/dev/sdb5       419426304   461371391    20972544   82  Linux swap / Solaris
/dev/sdb6       461373440   671082495   104854528   83  Linux
/dev/sdb7       671084544  1719662591   524289024   83  Linux
/dev/sdb8      1719664640  3907008511  1093671936   83  Linux

note on sdb1 it says id=83 and system=linux
I originally had that first partition as a ext4 filesystem since opensuse installation partitioner only allows a limited selection of filesystems.
gparted though recognizes the drive as a ntfs. and I had to add the boot flag to it.

okay the problems seem to be worse and worse. I just noticed that my 200GB partition sdb1 is only reported as 75GB by df(diskfree). and gparted is reporting it as 200GB but 177GB used. It should be reporting the size to be 200GB and the used portion to be around 50GB. I’m starting to think using dd is a bad idea.

I had used the emergency windows disk and it didn’t notice my windows vista installation.
Then I swapped the sata data cables so hd0,1 was sdb1 instead of hd1,1=sdb1. windows emergency disk found my windows installation, but it reported the partition size as 0. I tried bootrec.exe /FixBoot but it gave an error.

So I do not know what is wrong but here is a few things that might help. Here is the Windows 7 entry in my grub2 menu:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-274709BF653FCD05' {
    insmod part_msdos
    insmod ntfs
    set root='hd1,msdos1'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  274709BF653FCD05
    else
      search --no-floppy --fs-uuid --set=root 274709BF653FCD05
    fi
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

Here is a bash script that includes all of the grub2 commands:

GNU Grub2 Command Help/Config Editor - Version: 1.60 - Blogs - openSUSE Forums

Here is a bash script that can fast reboot your grub2 menu and includes a menu editor as well.

FastBoot for Grub 2 or Grub Legacy Menu using Kexec - Version 2.13 - Blogs - openSUSE Forums

Thank You,

thank you for the info. I ended up just reinstalling everything. Actually it was more complicated than that, and I ended up using my oem install from my laptop and had to disconnect the old drive for it to work. I guess making an image of your hard drive is pointless.

When one says hard disk image, it may not be a clone if it only copies the partition data. The MBR contents and active disk partitions also complete the picture. There are some Windows disk clones out there, but it is a more manual operation with Linux. In any event and no matter how you got there, at least you found a solution.

Thank You,

@cw9000

Don’t think in terms of sda, sdb … or think twice before using device names (for example with dd). device.map will help you to get Grub installed on the right disk (assuming you know which one is the right disk) but it doesn’t have influence on the device names given by udev to your hard disks. It’s not rare that these names will be different during setup - with the installation kernel - and when you reboot with the installed kernel. Maybe that’s what confused you here. Someone reported similar issues with 12.2 RC1.