LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (http://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   Dual boot with separated disks and Windows 7 (http://www.linuxquestions.org/questions/slackware-installation-40/dual-boot-with-separated-disks-and-windows-7-a-4175460419/)

cbastos 05-02-2013 07:03 AM

Dual boot with separated disks and Windows 7
 
Hi there.

I'm stuck with a new installation of Slackware 14.0. I got Windows 7 installed and didn't wanted to mess the disk with Partition Magic, so I installed a second disc on my box. I did the install of Slackware and configured the lilo to boot both windows and Linux.

I rebooted the machine and checked Linux was booting ok, so I decided to check the boot for windows and I got a not nice surprise, I couldn't boot my windows anymore. Ouch... I have lots of documentation under this SO.

I booted into Linux once again and could see the windows C: drive is not the first partition, there is a reserved partition at /dev/sda1

Code:

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848  1024002047  511897600    7  HPFS/NTFS/exFAT

So I edited the lilo.conf file and changed the windows settings to:

Code:

# Windows bootable partition config begins
other = /dev/sda2
label = win
table = /dev/sda

The fist time I tried to run the lilo command I got this warnings:

Code:

Warning: The boot sector and map file are on different disks.
Warning: Device 0x0800: Inconsistent partition table, 1st entry
  CHS address in PT:  0:32:33  -->  LBA (640)
  LBA address in PT:  2048  -->  CHS (0:107:16)
Fatal: Either FIX-TABLE or IGNORE-TABLE must be specified
If not sure, first try IGNORE-TABLE (-P ignore)

I installed the MBR once again using the -P ignore option of lilo command ant tried to boot. It still not boot the windows, so I used fdisk to make the second partition of the first disk bootable instead of the first one. New lilo install and boot and nothing changed.

I changed back all the settings and restored the MBR so I can boot into windows again.

This is the content of my lilo.conf

Code:

boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255

append=" vt.default_utf8=0"
prompt
timeout = 50
vga = 791

other = /dev/sda1
label = win
table = /dev/sda

image = /boot/vmlinuz
root = /dev/sdb1
label = linux


Now I have a Slackware installation that can only be accessed using the DVD to boot and mount /dev/sdb1 as root partition.

Please, how can I fix this issue? I already used the liloconfig once again to configure lilo with no success.

Regards,
Carlos

Erik_FL 05-02-2013 11:33 PM

To fix your problems with LILO you need to add the "lba32" option to "lilo.conf" so that LILO will use Logical Block Addressing instead of the incorrect Cylinder/Head/Sector addresses. You should always include the "lba32" option in "lilo.conf"

Your first partition on the first hard disk has the Windows "bootmgr". That is the partition that must have the "boot" flag set. In "lilo.conf" You want to use "/dev/sda1" to boot Windows.

Code:

lba32
boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255

append=" vt.default_utf8=0"
prompt
timeout = 50
vga = 791

other = /dev/sda1
label = win
table = /dev/sda

image = /boot/vmlinuz
root = /dev/sdb1
label = linux

Remember to run the "lilo" command after changing "lilo.conf".

When you install LILO to the MBR it may be writing over the disk signature used by Windows 7. That prevents Windows from booting.

If Windows does not boot after you install LILO, you can repair Windows booting. Boot the Windows 7 Setup disk and then press Shift + F10 to get a Windows command prompt. Type in these commands to repair your boot configuration.

Code:

bootrec /rebuildbcd
Another way to avoid the problem is to install LILO to the second hard disk. That way, you will not break Windows booting when installing LILO. Then add the LILO boot sector to the Windows boot menu.

To install LILO to the second hard disk here is what you would put in the LILO configuration file.

Code:

lba32
boot = /dev/sdb
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255

append=" vt.default_utf8=0"
prompt
timeout = 50
vga = 791

mage = /boot/vmlinuz
root = /dev/sdb1
label = linux

After installing LILO you have to create a copy of the boot sector in a file. For example:

Code:

dd if=/dev/sdb of=/tmp/linux.bin bs=512 count=1
You need to copy the boot sector file to the Windows partition (the second partition of the first hard disk). Using Linux you will probably have to temporarily copy the "linux.bin" file to a thumb drive or floppy disk. Boot Windows and copy the "linux.bin" file from the thumb drive or floppy disk to the Windows partition.

Here is a good explanation of how to add a boot sector file to the Windows boot menu.

Adding Linux to the Windows7 boot menu

cbastos 05-22-2013 12:36 PM

Hi Erik.

Tank you very much for your help.

Quote:

Originally Posted by Erik_FL (Post 4943816)
To fix your problems with LILO you need to add the "lba32" option to "lilo.conf" so that LILO will use Logical Block Addressing instead of the incorrect Cylinder/Head/Sector addresses. You should always include the "lba32" option in "lilo.conf"

I had "lba32" added to my lilo.conf, I just missed it when copying the file content.


Quote:

Originally Posted by Erik_FL (Post 4943816)
When you install LILO to the MBR it may be writing over the disk signature used by Windows 7. That prevents Windows from booting.

If Windows does not boot after you install LILO, you can repair Windows booting. Boot the Windows 7 Setup disk and then press Shift + F10 to get a Windows command prompt. Type in these commands to repair your boot configuration.

Code:

bootrec /rebuildbcd

I tryed the suggestion above and although Windows replied the fix was done, the box kept not booting into Windows.

So I'll try the procedure of adding the LILO boot sector to the Windows boot menu when I have time to do.

Keith Hedger 06-03-2013 06:37 AM

Thanks Erik! I have just done an install while keeping windoze ( for the wife I hasten to add I wouldn't touch it with a 10' battle lance! ) and the auto lilo install seemed to work but windoze booted into the recovery partition, now that the correct partition is set both boot fine.

cbastos 06-03-2013 09:17 AM

Hi.

Finaly I got the time to try the bcdedit solution, but unfortunately this did not solved the boot issue.
I followed the steps and when I tryed to boot into Linux it could not be found.

Here its what was configured on the Windows boot loader.

Code:

C:\Windows\system32>bcdedit /enum

Gerenciador de Inicialização do Windows
--------------------
identificador          {bootmgr}
device                  partition=\Device\HarddiskVolume1
description            Windows Boot Manager
locale                  pt-BR
inherit                {globalsettings}
default                {current}
resumeobject            {a436e354-1c78-11e2-a55f-9c8737630332}
displayorder            {current}
                        {a436e358-1c78-11e2-a55f-9c8737630332}
toolsdisplayorder      {memdiag}
timeout                10

Carregador de Inicialização do Windows
-------------------
identificador          {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description            Windows 7
locale                  pt-BR
inherit                {bootloadersettings}
recoverysequence        {a436e356-1c78-11e2-a55f-9c8737630332}
recoveryenabled        Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {a436e354-1c78-11e2-a55f-9c8737630332}
nx                      OptIn

Setor de Inicialização em Modo Real
---------------------
identificador          {a436e358-1c78-11e2-a55f-9c8737630332}
device                  partition=C:
path                    \linux.bin
description            Linux

C:\Windows\system32>


Erik_FL 06-03-2013 08:04 PM

Quote:

Originally Posted by cbastos (Post 4964591)
Hi.

Finaly I got the time to try the bcdedit solution, but unfortunately this did not solved the boot issue.
I followed the steps and when I tryed to boot into Linux it could not be found.

Here its what was configured on the Windows boot loader.

Code:

C:\Windows\system32>bcdedit /enum

Gerenciador de Inicialização do Windows
--------------------
identificador          {bootmgr}
device                  partition=\Device\HarddiskVolume1
description            Windows Boot Manager
locale                  pt-BR
inherit                {globalsettings}
default                {current}
resumeobject            {a436e354-1c78-11e2-a55f-9c8737630332}
displayorder            {current}
                        {a436e358-1c78-11e2-a55f-9c8737630332}
toolsdisplayorder      {memdiag}
timeout                10

Carregador de Inicialização do Windows
-------------------
identificador          {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description            Windows 7
locale                  pt-BR
inherit                {bootloadersettings}
recoverysequence        {a436e356-1c78-11e2-a55f-9c8737630332}
recoveryenabled        Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {a436e354-1c78-11e2-a55f-9c8737630332}
nx                      OptIn

Setor de Inicialização em Modo Real
---------------------
identificador          {a436e358-1c78-11e2-a55f-9c8737630332}
device                  partition=C:
path                    \linux.bin
description            Linux

C:\Windows\system32>


The Windows boot loader configuration looks correct.

Please post the contents of your "lilo.conf" file and the contents of the "linux.bin" file. You can use this command in Linux to save the contents of "linux.bin" as a text file.

Code:

hexdump -C linux.bin > linux.txt
What error message do you see when you try to boot Linux?

MCDewy 07-02-2013 11:34 PM

Not sure if this will help.

I have a 2TB windows Sata drive. I installed a 160gb sata drive for Slackware.

Installing slackware, I let it configure lilo for me. When I boot, it shows Windows as the primary option and linux as the second option. My lilo.conf file:
Code:

# Windows bootable partition config begins
other = /dev/sda1
  label = Windows
  table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sdb2
  label = Linux
  read-only
# Linux bootable partition config ends



All times are GMT -5. The time now is 11:30 AM.