LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Dual boot setup of Slackware64 13.37 / Windows 7 - Windows does not boot (http://www.linuxquestions.org/questions/slackware-14/dual-boot-setup-of-slackware64-13-37-windows-7-windows-does-not-boot-4175411840/)

nyar 06-16-2012 04:50 PM

Dual boot setup of Slackware64 13.37 / Windows 7 - Windows does not boot
 
Hello all, I just did an installation of Slackware onto my Windows 7 laptop, which seemed to work fine. The system boots into Slackware and run without any complaints. However, if I try to boot into Windows, it goes to the 'starting windows' screen, thinks for a bit, and dumps back to the select OS menu.

I'll allow that repartitioning drives isn't my strongest point, so I think this may be where I broke something. The system shipped out with a recovery partition, a 250GB windows partition, and another 250 GB logical partition. I used Easeus Partition Master to shrink down the size of the Windows partition, rebooted, and then ran the Slackware installation.

Right now, CFDisk is showing me 4 partitions on the machine:
sda1 - primary - vfat - [recovery] - 17898 MB
sda2 - Boot - Primary - NTFS - [OS] - 209761 MB
sda3 - Boot - Primary - ext4 - 270447 MB
sda4 - Primary - swap - 2001 MB

Just to be sure, I redid the slackware installation, and didn't see any errors when setting up Lilo and installing it to the master boot record.
Any suggestions would be much appreciated.

-n

caduqued 06-16-2012 05:36 PM

Hi Nyar,

I am not an expert, but will try to help out a bit.

I have a (somehow) similar installation. I see you have marked both partitions with flag "Boot". This is not necessary, as lilo in the MBR will be the one providing the option to select OS. In my case I have only marked as bootable the NTFS partition. I would change the Boot flag to your ext4 partition (for instance, using Cfdisk, as root of course), check the lilo.conf, re-run /sbin/lilo (making sure it is installed in the MBR) and I reckon that would do the trick.

However, I am assuming that your system is fairly new, then no big trouble if this bit does not work, forcing you to re-install both OS. If that is not the case (i.e. if you have critical data), first save your data before trying anything "daredevil" ;)

Cheers,

slackass 06-16-2012 05:39 PM

You didn't mention defraging windows.
If you did not defrag before shrinking windows then it may be broke and you may have to reinstall.

comet.berkeley 06-16-2012 09:28 PM

Quote:

Originally Posted by slackass (Post 4705139)
You didn't mention defraging windows.
If you did not defrag before shrinking windows then it may be broke and you may have to reinstall.

Before reinstalling, get a friend with a good version of Windows 7 to create a recovery disk and then try to repair the system.

http://windows.microsoft.com/en-US/w...em-repair-disc

Erik_FL 06-16-2012 09:40 PM

The Windows boot configuration database stores information about the hard disk including the disk ID. It also stores information about the partitions containing BOOTMGR and the Windows directory. Windows might have a problem finding either one of those after you install something to the MBR.

Since you got as far as the OS menu it sounds like "BOOTMGR" was found and loaded correctly. If you also saw the Starting Windows screen then at least part of the Windows loading is being done.

The first thing I recommend is to use a Windows 7 boot DVD and use the CHKDSK command. Re-sizing the Windows NTFS partition may have left it in an un-mountable state that prevents Windows from mounting it during booting.

If you don't have a Windows 7 boot DVD you can legally download one from the Digital River site. You will be able to use it to repair Windows. You can also use it to install Windows if you have a valid CD key. You should have received a valid CD key with your pre-installed Windows system on your computer.

Here's a link to a site that mentions the Digital River downloads for Windows. http://www.mydigitallife.info/offici...digital-river/

You can press Shift with F10 to start a Windows command prompt from the boot DVD. Use this command to check the disk. NOTE: It is a different command than "chkdsk" from a normal Windows command prompt. The "/p" option only works on the boot DVD version.

Code:

chkdsk c: /p
If that does not solve the problem then the next thing to try is to repair the Windows boot configuration using the boot DVD. You can also use the "BCDEDIT" command to manually repair boot information. There are quite a few tutorials about "BCDEDIT" on-line. Use "BCDEDIT /enum all" or "BCDEDIT /enum all /v" to list out the current boot configuration.

The exact BCDEDIT commands to repair Windows depend on the problem, but these commands are examples of what you usually have to do.

Code:

bcdedit /set {bootmgr} device partition=C:
bcdedit /set {current} device partition=C:
bcdedit /set {current} osdevice partition=C:

For the first line replace the drive letter "C" with the letter of the drive where the Windows boot DVD sees the "BOOTMGR". In the other two lines replace "C" with the letter of the drive where the Windows boot DVD sees the "WINDOWS" folder. The drive letter should be based on where the boot DVD sees those, not where the normal Windows system will see them.

If none of those things help then your partition resizing program may have corrupted the NTFS partition. That is sometimes not possible to repair. In that case, copy all your important files from the partition first, then reinstall Windows.

bassplayer69 06-16-2012 09:46 PM

Windows 7 has it's own utilities to shrink or extend a partition (see Disk Management, right click on a partition). I also have a windows 7/Slackware 64 13.37 dual boot machine. I had Windows 7 Ultimate installed and then shrank the C: drive for Slackware. Disk Management will only allow you to shrink free space. If there are non-movable files then you are limited up to the first non-movable file.

As stated above, only one partition needs to be marked as Boot. I also did the standard LILO installation during the Slackware install to the MBR and I can boot between the two, no issues.

nyar 06-16-2012 11:08 PM

caduqued: I set only the NTFS partition to boot, but that didn't resolve the problem. I checked out the lilo.config file, and it looked OK to me, although it had an entry in the Windows portion for table=/dev/sda

slackass: I didn't think to defrag the thing after repartitioning, so that one's on me. In my defense, it was out of the box and running for all of about 20 minutes before I started this process. Lesson learned.

comet.berkeley: That's the one thing I did in Windows before starting the Slack install. ;) The repair disks are reformatting the bejesus out of everything at the moment, so I'll get another crack at installing slack today.

Erik_FL: I'm downloading that Win 7 boot disk at the moment, thanks for the link. That seems to be the more elegant solution here, but my internets connection isn't all that hot, so I decided to try the repair install first.

Thanks for the help and suggestions, you guys are awesome. On the upside, the time it's taking windows to get it's act together is giving me more time to read through the slack documentation on setting up networking and such.

-n

slackass 06-17-2012 09:42 AM

Quote:

Originally Posted by nyar (Post 4705220)
caduqued:

slackass: I didn't think to defrag the thing after repartitioning, so that one's on me. In my defense, it was out of the box and running for all of about 20 minutes before I started this process. Lesson learned.


-n

If Windows was that fresh then not defragging before resizing had nothing to do with it.

I f you decide to reinstall everything you might consider installing Windows as a guest using VirtualBox. That way you can run windows from Slack without rebooting.
https://www.virtualbox.org/

nyar 06-17-2012 12:13 PM

So, I re-installed windows using the bootable disk, re-installed slackware, and then selecting Windows from the boot screen was just giving the plain text "Loading Windows" and stalling out.

Re-installed windows to it's partition, and that worked fine. Windows boots up and is happy. Checked the file system from the windows file browser, and it's not showing the other partition with linux on it, which is pretty much what I expect to see. Rebooted again to make sure, and windows comes right up.
So, I reinstalled slackware again on it's partition. No errors or anything that seems out of place. Now Windows doesn't load, and I get
"Loading Windows
LLoading Windows" in plain text if I try to boot Windows, and everything stalls there.

lilo.conf is showing this for the Windows bootable partition:

Other = /dev/sda1
label - Windows
table - /dev/sda

When I installed slack, the linux and linux swap partitions were already there, and i didn't move, delete, or change anything with the partitions, so I don't think that would blow things up. I'm going to do some more digging with bcdedit and see what that turns up.

Erik_FL 06-17-2012 01:22 PM

Here are some other suggestions that may help if you still have problems getting Windows to boot.

Do another clean installation of Windows (I know - rolls eyes). Use "BCDEDIT /enum all" and "BCDEDIT /enum all /v" to dump the boot configuration before making changes. You may also want to use "dd" in Linux and dump the first block of "/dev/sda" to a file. That's the Master Boot Record. Look at the partition table configuration before changing it. The important things to note are which partition has the "Boot" flag set, and the partition types. The first (OEM restore) partition may have a non-standard partition type. It is often "VFAT" with an extra bit set.

Install the LILO boot sector to the Linux partition rather than the MBR. You can still (in theory) set the "Boot" flag for the "Linux" partition and clear the other "Boot" flags to make LILO boot first. That will avoid changing the MBR.

The Windows boot database usually identifies a partition by the disk ID and partition number. You can sometimes avoid boot problems by using the BIOS boot device to identify the partitions for Windows.

bcdedit /set {bootmgr} device partition=boot
bcdedit /set {current} device partition=boot
bcdedit /set {current} osdevice partition=boot

Right click the "Command Prompt" in the Start Menu" and then click "Run as Administrator" in the menu. Then you can use the "BCDEDIT" command. You have to make the above changes before installing Linux. Make sure that Windows still boots before you install Linux.

If you do install LILO to the MBR, you may have to edit the MBR afterward and put back the correct disk signature. Dump the MBR before installing Linux. Here is link with good information about the Windows disk signature and MBR.

http://thestarman.pcministry.com/asm/mbr/W7MBR.htm

The OEM restore partition or BIOS may have software that assumes there is a Windows MBR. In that case you may not be able to install LILO to the MBR. Or, you may have to set the BIOS to NOT use the OEM restore feature, or remove/disable the OEM partition. Unfortunately every manufacturer has different restore partitions, and sometimes they are different on each model.

slackass 06-17-2012 01:54 PM

Or.
If it's broke and your looking at a hose & reload anyhow something as simple as installing grub from /extra (32 bit version) may fix it.
I always install grub to a small separate partition.
note:
The 32 bit version will work on 64 bit if you install it to a separate partition.

Edit:
On second thought, the 32 bit may work on 64 system. I remember I had some sort of problem when I went from Slamd64 to Slack64 when it first came out. Maybe it was the ext3 / ext4 change.

nyar 06-17-2012 07:32 PM

So, since my basement decided to flood today, I decided to try a quick & dirty solution rather than doing the correct thing and figuring out what was getting broken in the MBR entries.
The current setup is: windows recovery partition installed by the OEM on sda1. In my case, this is kind of a joke, as it's a refurbished laptop and the included documentation ensures me that the recovery partition is little more than a clever way to waste my hard drive space.
Win 7 got installed on sda2 next, followed by Slack on the 3rd and 4th partitions. When I was installing Slack, I stuck Lilo on the Linux partition, rather than on the MBR.
After that, I rebooted into Win 7, installed EasyBCD and added the Linux partition to the MBR entries, and everything is peachy. Windows is booting fine, Slackware is coming up fine, and when I'm a little more comfortable with hacking around in the MBR files, I'm going to see if I can get Lilo to play nice when it's installed to the MBR.
Thanks again for the advice and helpful links everyone.

-n


All times are GMT -5. The time now is 11:45 PM.