Windows XP not Booting from Slave HD?
I have looked into this for the past 4 hours and I can't work it out so some help would be very welcome. I installed windows xp on my slave hard drive D: (this seemed to make the boot files for windows get created on the primary drive C:) I then installed Ubuntu on C: (I manually Partitioned so that the windows boot files were untouched on C:) Ubuntu boots and works perfectly fine (Apart from hedgewars and warsow games not working) but windows won't boot when I select it from the grub boot options it says: "a disk read error occurred. Press CTRL+ALT+DEL to restart", now I am guessing (and hoping) that this is a simple rewrite of the boot file or something similar? I ran fdisk as this might help you help me:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8a558a55
Device Boot Start End Blocks Id System
/dev/sda1 * 1 608 4882812+ 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 608 9730 73266177 5 Extended
/dev/sda5 608 9119 68359168 83 Linux
/dev/sda6 9119 9730 4905984 82 Linux swap / Solaris
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2e5cf1c5
Device Boot Start End Blocks Id System
/dev/sdb1 1 38912 312560608+ 7 HPFS/NTFS
Please help me some one. Thank You.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu grub2 Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
C: and D: are windows constructs and don't apply here at all. There are disks with partitions. Windows incorrectly names partitions as drives and confuses new users when thet transfer to an OS which correctly names partitions and disks. You didn't install Linux to "D:" at all, you resized the current partition which occupied 100% of the disk space and made some partitions to install Ubuntu to.
If you start messing with partitions and resizing them, you may damage the data and backups should be checked to see if they are sufficient before undertaking the task.
All I can suggest is you make a bartPE disk (or maybe install ntfsprogs in Ubuntu) and check the ntfs partition is healthy. You may have to boot to your windows disk, reinstate the boot loader then boot to ubuntu liveCD and reinstall grub to the mbr
Revision history for this message
|
#2 |
Okay well the disks are fine and I installed Linux to the master HD and windows is on the slave. If I need to reinstate the boot loader for windows how do I do this, When I boot from windows CD the only option I get is to Partition and install windows I don't get a recovery option? can the grub boot option be changed from root (hd0,1) to root (hd1,0) or vice versa or something like that?
Revision history for this message
|
#3 |
Boot to the windows CD:
http://
Revision history for this message
|
#4 |
I don't get that recovery screen though It goes straight to the partitioning and install bit?
Revision history for this message
|
#5 |
try the following command, it will rebuild the grub boot list
# sudo update-grub
good luck!!
Revision history for this message
|
#6 |
In previous message from sibikul, "#" is a prompt so don't type it.
As you have XP in Grub menu, I'm afraid update-grub will not improve situation (but try it).
1) Could you provide the part in /boot/grub/grub.cfg which manages XP boot (perhaps XP disk is not swapped as 1st disk).
2) Check NTFS partition: System-
3) Perhaps the boot sectors of NTFS partition are corrupted. In this case, you need XP recovery CD, to type "bootrec /fixboot". I don't know it it works with XP in second disk. Have a look at
http://
Revision history for this message
|
#7 |
Heres the grub.cfg:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 17581748-
if loadfont /usr/share/
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 17581748-
set locale_
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.
### BEGIN /etc/grub.
set menu_color_
set menu_color_
### END /etc/grub.
### BEGIN /etc/grub.
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 17581748-
linux /boot/vmlinuz-
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 17581748-
echo 'Loading Linux 2.6.32-24-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
### END /etc/grub.
### BEGIN /etc/grub.
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 17581748-
linux16 /boot/memtest86
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 17581748-
linux16 /boot/memtest86
}
### END /etc/grub.
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 62d0a3fcd0a3d517
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.
### BEGIN /etc/grub.
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.
Revision history for this message
|
#8 |
GParted 0.5.1
Libparted 2.2
(THIS IS THE PARTITION THAT WINDOWS IS INSTALLED ON HARD-DRIVE 2)
Check and repair file system (ntfs) on /dev/sdb1 00:00:03 ( SUCCESS )
calibrate /dev/sdb1 00:00:00 ( SUCCESS )
path: /dev/sdb1
start: 63
end: 625121279
size: 625121217 (298.08 GiB)
check file system on /dev/sdb1 for errors and (if possible) fix them 00:00:02 ( SUCCESS )
ntfsresize -P -i -f -v /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 320062063104 bytes (320063 MB)
Current device size: 320062063104 bytes (320063 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 6709 MB (2.1%)
Collecting resizing constraints ...
Estimating smallest shrunken size supported ...
File feature Last used at By inode
$MFT : 3248 MB 0
Multi-Record : 48923 MB 24865
$MFTMirr : 160032 MB 1
Compressed : 48535 MB 23803
Sparse : 48801 MB 23277
Ordinary : 160041 MB 10
You might resize at 6708609024 bytes or 6709 MB (freeing 313354 MB).
Please make a test run using both the -n and -s options before real resizing!
grow file system to fill the partition 00:00:01 ( SUCCESS )
run simulation 00:00:00 ( SUCCESS )
ntfsresize -P --force /dev/sdb1 --no-action
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 320062063104 bytes (320063 MB)
Current device size: 320062063104 bytes (320063 MB)
New volume size : 320062059008 bytes (320063 MB)
Nothing to do: NTFS volume size is already OK.
real resize 00:00:01 ( SUCCESS )
ntfsresize -P --force /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 320062063104 bytes (320063 MB)
Current device size: 320062063104 bytes (320063 MB)
New volume size : 320062059008 bytes (320063 MB)
Nothing to do: NTFS volume size is already OK.
=======
(THIS IS THE PARTITION THAT HAS THE WINDOWS BOOT FILES IN IT ON HARD-DRIVE 1)
Check and repair file system (ntfs) on /dev/sda1 00:00:00 ( SUCCESS )
calibrate /dev/sda1 00:00:00 ( SUCCESS )
path: /dev/sda1
start: 63
end: 9765687
size: 9765625 (4.66 GiB)
check file system on /dev/sda1 for errors and (if possible) fix them 00:00:00 ( SUCCESS )
ntfsresize -P -i -f -v /dev/sda1
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 4999995904 bytes (5000 MB)
Current device size: 5000000000 bytes (5000 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 69 MB (1.4%)
Collecting resizing constraints ...
Estimating smallest shrunken size supported ...
File feature Last used at By inode
$MFT : 3222 MB 0
$MFTMirr : 2500 MB 1
Sparse : 11 MB 46
Ordinary : 3222 MB 4
You might resize at 3221278720 bytes or 3222 MB (freeing 1778 MB).
Please make a test run using both the -n and -s options before real resizing!
grow file system to fill the partition 00:00:00 ( SUCCESS )
run simulation 00:00:00 ( SUCCESS )
ntfsresize -P --force /dev/sda1 --no-action
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 4999995904 bytes (5000 MB)
Current device size: 5000000000 bytes (5000 MB)
New volume size : 4999995904 bytes (5000 MB)
Nothing to do: NTFS volume size is already OK.
real resize 00:00:00 ( SUCCESS )
ntfsresize -P --force /dev/sda1
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 4999995904 bytes (5000 MB)
Current device size: 5000000000 bytes (5000 MB)
New volume size : 4999995904 bytes (5000 MB)
Nothing to do: NTFS volume size is already OK.
=======
Revision history for this message
|
#9 |
Don't know if this helps but when I get to the Grub screen to choose which OS to boot this is what it says when I go down to "Microsoft Windows XP Professional (on /dev/sda1)" and press "e to edit commands"
insmod ntfs
set root ='(hd0,1)'
search --no-floppy --fs-uuid --set 62d0a3fcd0a3d517
drivemap -s (hd0) ${root}
chainloader +1
Thanks Guys
Revision history for this message
|
#10 |
In a virtual machine with same configuration, I have:
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set eee0f04ce0f01c91
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.
In your configuration, Windows is in 1st disk, edit your grub.cfg file to put it in 2nd disk:
/dev/sda1 -> /dev/sdb1
set root='(hd0,1)' -> set root='(hd1,1)'
Run also command
sudo blkid
to check UUID of 2nd disk against value in grub.cfg
Revision history for this message
|
#11 |
how do you edit the grub.cfg file as it keeps just opening in read only mode, do I have to do it from the edit command bit on the boot os selection screen?
Revision history for this message
|
#12 |
sudo gedit /boot/grub/grub.cfg
N.B.: if solution works, don't mark question solved, we will have some additional work to do
Revision history for this message
|
#13 |
grub.cfg now reads:
### BEGIN /etc/grub.
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 62d0a3fcd0a3d517
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.
sudo blkid reads:
/dev/sda1: UUID="62D0A3FCD
/dev/sda5: UUID="17581748-
/dev/sda6: UUID="05c8287e-
/dev/sdb1: UUID="722411182
so does this mean i need to change the set in the grub.cfg from: --set 62d0a3fcd0a3d517 to: --set 722411182410E141
?
Cheers (Think I'm learning :-))
Revision history for this message
|
#14 |
Yes, it's that!
But grub.cfg is a generated file. If it works, we will have to update a file in /etc/grub.d to make change definitive.
Revision history for this message
|
#15 |
okay tried all that but windows still wont start, now it is saying after I select it from the grub boot selection:
NTLDR is missing
press CTRL+ALT+DEL to restart.
Now what?
Thank You.
Revision history for this message
|
#16 |
NTLDR is missing => 1st boot sector of disk and two 1st boot sectors of NTFS are OK.
So there are many explanations:
1) XP is on 1st disk and not 2nd one
2) NTFS partition on 2nd disk is corrupted
3) NTFS file is in 1st disk and download XP from 2nd disk
As NTFS partition of 1st disk is bootable and not the NTFS partition of 2nd disk not, I opt for (3).
Could you explain me what is you Windows configuration ?
Revision history for this message
|
#17 |
I have done disc checks on all partitions and they all come up as being fine.
Do you mean where did I install windows?
When I originally installed windows and then ubuntu here's what I did:
1. have two hard drives the master has 80gb the slave has 320gb
2. formatted both hard drives
3. installed windows on the 320gb slave
4. windows boots fine and works correctly, installed all the updates and afew programs, rebooted afew times and it booted fine.
5. installed ubuntu, when doing this I found that on the 80gb master windows had put some of it's files there so I manually did the partitioning so I created a 5gb partition on the master not to be used by ubuntu that has the windows files in (Recycler folder, System Volume Information folder, AUTOEXEC.bat, boot.ini, config.sys, IO.sys, msdos.sys, ntdetect.com, ntldr)
6. then created the Partitions for ubuntu and installed
7. Ubuntu boots fine but windows does not.
there is no: AUTOEXEC.bat, boot.ini, config.sys, IO.sys, msdos.sys, ntdetect.com, ntldr in the root of the 320gb drive there is: 5de16d1eb121517
don't know if this is any of what you mean, thank you for your help, hope we are getting there :-)
Revision history for this message
|
#18 |
So NTLDR is on first disk, and Grub must chainload on 1st disk and not second.
Your previous configuration was right, it's sda1/hd0,1.
Sorry, but you will have to restore grub.cfg file in its previous state.
We have the choice between:
1) trying to fix current problem
2) reinstalling again Windows and Ubuntu in a safer way (but data will be erased).
Revision history for this message
|
#19 |
yeah well I was thinking of changing the jumper on the hard drives so the 320gb is master and the 80gb is slave then installing windows on the master and ubuntu on the slave that would work then wouldn't it? I meant to do that in the first place but it was late at night and I was tired and forgot to change the jumper over.
Is there a way of backing up the packages on ubuntu so when I reinstall it I can just restore the packages?
Revision history for this message
|
#20 |
For installation, one solution is:
1) plug only windows disk as master and install XP
2) unplug WIndows disk and plug it as slave
plug Ubuntu disk as master
install Ubuntu
During installation, Grub will detect XP disk, and add it in menu.
If you choose WIndows in menu, it will switch disk by software, so XP will boot with any problem.
Sorry, I don't know how to backup packages.
Revision history for this message
|
#21 |
cool thank you for all your help I shall give that a go.
Revision history for this message
|
#22 |
I just tried that but once Ubuntu installed and the system restarted windows started straight away I am not getting the grub OS selection screen during boot up so can't boot Ubuntu now?
Revision history for this message
|
#23 |
I have now got grub back and Ubuntu and windows XP are both there to select, Ubuntu is booting and working fine but windows will only load in safe mode?
Revision history for this message
|
#24 |
Sorry, but if Windows is able to boot, understanding why it does it only in safe mode becomes a Windows issue. After a first boot in safe mode, it should repair itself and boot after in usual mode.
Perhaps a remaining Grub issue. Could post part of file /boot/grub/grub.cfg where Windows XP is booted ?
Can you help with this problem?
Provide an answer of your own, or ask Mike for more information if necessary.