LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-21-2005, 01:09 AM   #31
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15

Quote:
Originally posted by kornerr
1) why don't you recreate Partition Table if it might be errorous?
2) is your GRUB setup properly?
I suspect Windows' "boot.ini" is placed at /dev/hda1. So you should load /dev/hda1 instead /dev/hda2.
boot.ini is actually in hda2.


Quote:
[i]Originally posted by kornerr
Make sure your GRUB is properly installed. I'd make "upgrade" from MDV Install CD (it'd reinstall GRUB properly). [/B]
I did a rescue using kubuntu's CD and then grub--install. Was that ok?
 
Old 08-21-2005, 01:30 AM   #32
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
fdisk is reliable, I have the same version.
And I have 255 heads too, do you sure it's a problem?
The last thing I'd look to is c:\boot.ini
Here's mine:
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(7)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(7)\WINDOWS="XP" /fastdetec
xp is at /dev/hda9 (but it thinks it's at the 7th).
Make sure your boot.ini is right.

My LILO boots /dev/hda1, then winloader looks for boot.ini and loads xp.
 
Old 08-21-2005, 02:07 AM   #33
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Quote:
boot.ini is actually in hda2
How can it be? Windows _can't_ work without the beginning of the disk, because it stores its boot files _there_
Can you "ls -l /path/to/hda1" and "ls -l /path/to/hda2"?
And "cat" c:\boot.ini and d:\boot.ini
Quote:
I did a rescue using kubuntu's CD and then grub--install
I'd recommend reinstall GRUB using MDV Install CD. Instead of "Install" option you choose "Upgrade", MDV then checks all dependencies and will offer you to reinstall GRUB (LILO?).

If you somehow got Windows boot files at /dev/hda2 copy them to /dev/hda1 and check /dev/hda1/boot.ini.
If your Windows' at /dev/hda2 primary then your c:\boot.ini should look like
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP" /fastdetect
 
Old 08-21-2005, 03:56 AM   #34
igu
Member
 
Registered: Jan 2003
Distribution: Fedora, Gentoo, SUSE, Mandriva
Posts: 127

Rep: Reputation: 15
Quote:
Originally posted by jaristr
It didn't work, but now when I check the head count using fdisk it appears still to be 255 so either fdisk couldn't change it or it was reset?

This is what xxd displays:

0000000: eb52 904e 5446 5320 2020 2000 0208 0000 .R.NTFS .....
0000010: 0000 0000 00f8 0000 3f00 f000 e00b 7d00 ........?.....}.

Btw, any one know where to get the latest fdisk? I have v2.12p in kubuntu and even older in mandrake.
If the disk was in use during fdisk then the changes take place only after reboot. Did you reboot? It's also possible that you didn't write out the partition table with the 'w' command. Changing the head count isn't enough, you also must explicitely write out the new partition table to the disk.

From the hex dump: your ntfs partition MUST start at sector 8195040 and MUST have head value of 240. Don't even try anything utill you get these right.

I'm also puzzled because the partiton start was the correct 8195040 when you run ntfsresize -fi and the ntfs consistency check indeed worked fine as it was expected. Later you wrote that the partition starts at 8209215 and that one definitely is broken. Following that you sent the above hex dump which is again correct, it's indeed the partition start but it can't be because somewhere you made the partition start to be the incorrect 8209215. Well unless you noticed and fixed it again.

fdisk is in util-linux but I doubt you need a newer one. fdisk should just work. You didn't write if there was any error or warning message. Fdisk does warn that the changes may take place only after reboot. So you probably didn't save the modifications.
 
Old 08-21-2005, 04:19 AM   #35
igu
Member
 
Registered: Jan 2003
Distribution: Fedora, Gentoo, SUSE, Mandriva
Posts: 127

Rep: Reputation: 15
Quote:
Originally posted by jaristr
Hmm, well SmartBootmanager booted the hda1 partition when I selected the only HD from the list to be booted. hda1 has the windows installation files and the filesystem is FAT32. And even hda2 has the bootable flag the SBM still boots using hda1.

I will try and change the head count now.
SMB can boot one partition marked as bootable if booted via the disk option OR it can boot individual partitions directly. What you say is impossible, hda1 is not marked bootable so you couldn't boot from the disk but directly from the partition. See here a screenshot e.g.: http://btmgr.sourceforge.net/scrshots/sbm1.gif 'HD1 0' is hdb (disk), 'HD1 1' is hdb1 (partition 1), 'HD1 2' is hdb2 (partition 2).

But you didn't answer my question. Is Windows running fine if you boot from hda1? If yes then your Windows boot partition is hda1 and you must configure that also correctly with grub.

I also don't understand if your installation is on hda1 then how hda2 can hav also boot.ini :-o It makes no sense.
 
Old 08-22-2005, 05:44 AM   #36
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by kornerr
How can it be? Windows _can't_ work without the beginning of the disk, because it stores its boot files _there_
Can you "ls -l /path/to/hda1" and "ls -l /path/to/hda2"?
And "cat" c:\boot.ini and d:\boot.ini

I'd recommend reinstall GRUB using MDV Install CD. Instead of "Install" option you choose "Upgrade", MDV then checks all dependencies and will offer you to reinstall GRUB (LILO?).

If you somehow got Windows boot files at /dev/hda2 copy them to /dev/hda1 and check /dev/hda1/boot.ini.
If your Windows' at /dev/hda2 primary then your c:\boot.ini should look like
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP" /fastdetect
You are right the /dev/hda1 does have boot.ini, they both have
Here they are:

/dev/hda1 (FAT32 that has the windows installation files)

[boot loader]
timeout=0
default=C:\CMDCONS\BOOTSECT.DAT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons


/dev/hda2 (NTFS, the one with windows XP - installed)

[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS

[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows XP:n palautuskonsoli" /cmdcons
 
Old 08-22-2005, 05:53 AM   #37
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by igu
If the disk was in use during fdisk then the changes take place only after reboot. Did you reboot? It's also possible that you didn't write out the partition table with the 'w' command. Changing the head count isn't enough, you also must explicitely write out the new partition table to the disk.
I know and I tried again but it just doesn't stay at 240. After boot it's back in 255.

Quote:
Originally posted by igu
From the hex dump: your ntfs partition MUST start at sector 8195040 and MUST have head value of 240. Don't even try anything utill you get these right.

I'm also puzzled because the partiton start was the correct 8195040 when you run ntfsresize -fi and the ntfs consistency check indeed worked fine as it was expected. Later you wrote that the partition starts at 8209215 and that one definitely is broken. Following that you sent the above hex dump which is again correct, it's indeed the partition start but it can't be because somewhere you made the partition start to be the incorrect 8209215. Well unless you noticed and fixed it again.
Sorry about that, I tried using differend starting points couple times and forgot it to wrong value for a while. It currently has the correct value.
 
Old 08-22-2005, 05:59 AM   #38
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by igu
SMB can boot one partition marked as bootable if booted via the disk option OR it can boot individual partitions directly. What you say is impossible, hda1 is not marked bootable so you couldn't boot from the disk but directly from the partition. See here a screenshot e.g.: http://btmgr.sourceforge.net/scrshots/sbm1.gif 'HD1 0' is hdb (disk), 'HD1 1' is hdb1 (partition 1), 'HD1 2' is hdb2 (partition 2).
that's strange because the /dev/hda2 (NTFS) has the bootable flag but the dev/hda1 (FAT32) is the only showing in SMB list.

Quote:
Originally posted by igu

But you didn't answer my question. Is Windows running fine if you boot from hda1? If yes then your Windows boot partition is hda1 and you must configure that also correctly with grub.

I also don't understand if your installation is on hda1 then how hda2 can hav also boot.ini :-o It makes no sense.
The /dev/hda1 partition boots just fine but it's actually a windows installation partition. See when I bouth this PC they didn't give me a windows CD but instead the installation files are stored in the dev/hda1 where the windows can be installed.
Oh and to make sure we understand each other, I have only one HD.


Ok I'm going to try and figure how to burn those ISO's in CD so I can use the SystemRecoveryCD to reinstall GRUB.

Thanks for all the help.

Last edited by jaristr; 08-22-2005 at 06:10 AM.
 
Old 08-22-2005, 06:59 AM   #39
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
Well I reinstalled grub again but it didn't help.
 
Old 08-22-2005, 09:55 AM   #40
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
These things must be done (true):
1) your XP is at /dev/hda2;
2) move d:\boot.ini to /dev/hda1.
[although, yours is quite strange in comparison with mine. Try mine too (with a bit editing)];
3) you must load /dev/hda1 in GRUB (not /dev/hda2);
4) on my system none of the partitions is bootable, so it's not necessary.

I use LILO and can't say anything about GRUB.
If Mandriva has LILO, you can install LILO and I'll put /etc/lilo.conf, so that you be able to boot in all three OSes.
 
Old 08-22-2005, 01:00 PM   #41
igu
Member
 
Registered: Jan 2003
Distribution: Fedora, Gentoo, SUSE, Mandriva
Posts: 127

Rep: Reputation: 15
Quote:
Originally posted by jaristr
I know and I tried again but it just doesn't stay at 240. After boot it's back in 255.
Then probably mandriva's fdisk is also broken. You REALLY-REALLY-REALLY must set the head number to 240. When NTFS was created then the partition table had value 240. Boot won't work from NTFS unless you restore 240 in the partition table. Try SystemRescueCD or Knoppix.
 
Old 08-24-2005, 05:14 AM   #42
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
I used the fdisk in SystemRescueCD to change the head count to 240. And then I typed w and I saw the messages when the partition table was written in disk. However when I went back to fdisk the head count was back in 255 again...
 
Old 08-24-2005, 11:50 AM   #43
igu
Member
 
Registered: Jan 2003
Distribution: Fedora, Gentoo, SUSE, Mandriva
Posts: 127

Rep: Reputation: 15
I've never heard such problem. Somwthing must rewrite it to 255 from 240 but what? Do you have some BIOS MBR protection turned on? Some special boot software, hardware driver? Antivirus? However I fail to see how the partitioner could change it from 240 to 255? Are you sure you're editing /dev/hda (note, no number in the end!) and not some other device?
 
Old 08-25-2005, 06:23 AM   #44
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by igu
I've never heard such problem. Somwthing must rewrite it to 255 from 240 but what? Do you have some BIOS MBR protection turned on? Some special boot software, hardware driver? Antivirus? However I fail to see how the partitioner could change it from 240 to 255? Are you sure you're editing /dev/hda (note, no number in the end!) and not some other device?
Yes I used /dev/hda. And no I don't have any antivirus software. I'll have to check if there is some protection turned on in BIOS but other than that I don't have any idea what is causing that.

Thanks.

Edit: no protection options in BIOS...

Last edited by jaristr; 08-25-2005 at 06:47 AM.
 
Old 08-29-2005, 09:47 AM   #45
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by igu
Of course they disagree because we want to change the wrong 255 to 240. But it seems you have a broken sfdisk too.
So do this:

1. sfdisk -d /dev/hda > hda.pt
2. edit hda.pt and remove the warning line completely
3. sfdisk --no-reread -H240 /dev/hda < hda.pt

Afterwards the head count should be 240 in the partition table and booting should work.

If it still doesn't boot then send the output of 'xxd /dev/hda2 | head'. That contains the right value (mostly it's 240 but not always).
Ok I was able to do this finally using MEPIS. However this is what it said:

Warning: HDIO_GETGEO says that there are 255 heads

Disk /dev/hde: 14593 cylinders, 240 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 7741440 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/hde1 0+ 541 542- 4097488+ 1b Hidden W95 FAT32
end: (c,h,s) expected (541,239,63) found (510,29,63)
/dev/hde2 * 542 10065- 9524- 71994352+ 7 HPFS/NTFS
start: (c,h,s) expected (542,0,1) found (510,30,1)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
/dev/hde3 10065+ 15505- 5440 41126400 5 Extended
start: (c,h,s) expected (1023,239,63) found (1023,254,63)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
/dev/hde4 0 - 0 0 0 Empty
/dev/hde5 12285+ 13096 812- 6138688+ 83 Linux
start: (c,h,s) expected (1023,239,63) found (1023,254,63)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
/dev/hde6 13097+ 13244 148- 1118848+ 82 Linux swap
start: (c,h,s) expected (1023,239,63) found (1023,254,63)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
/dev/hde7 13245+ 15504 2260- 17085568+ 83 Linux
start: (c,h,s) expected (1023,239,63) found (1023,254,63)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
/dev/hde8 10065+ 11174- 1110- 8385867 83 Linux
start: (c,h,s) expected (1023,239,63) found (1023,254,63)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
/dev/hde9 11174+ 12284- 1111- 8393931 83 Linux
start: (c,h,s) expected (1023,239,63) found (1023,254,63)
end: (c,h,s) expected (1023,239,63) found (1023,254,63)
Warning: given size (82252800) exceeds max allowable size (68462415)

sfdisk: bad input



hmm I wonder why it doesnt accept 82252800.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem reading mounted NTFS partition... Virak Linux - Newbie 8 08-18-2005 04:38 PM
Problem to mount NTFS partition ferrouswong Linux - Newbie 3 04-19-2005 02:15 PM
Sudden problem mounting NTFS partition cjtroiani Linux - Hardware 1 12-04-2004 12:02 AM
ntfs partition permission problem pdb1013 Linux - Newbie 4 07-21-2003 11:47 PM
Problem mounting SunOS disk on RedHat - unknown partition table jerrymc Linux - Software 2 12-03-2001 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration