LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux Partition Table Editor - Need to change "Hidden Sectors" value (https://www.linuxquestions.org/questions/linux-newbie-8/linux-partition-table-editor-need-to-change-hidden-sectors-value-144367/)

Ouch_Taser 02-10-2004 04:48 AM

Correcting "Hidden Sectors" value to allow booting from an extended partition
 
Is there a partition table editor for Linux? I have had a look at 'parted' but I don't think it has the capabilities I need.

Cut a long story short - I have a RedHat 9.0 / WinXP dual boot and GRUB won't boot into WinXP. I suspect this is because WinXP is installed on an extended partition. This excellent site - ("Understanding Multibooting" + I'm Feeling Lucky) - suggests that modfying the "Hidden Sectors" value in the partition table can allow booting from an extended partition. Many disk partitioners apparently inccorectly set this value, which prevents GRUB's chainloading technique from locating the WinXP boot sector.

I think I have read just about every support article and forum post on the web relating to GRUB dual booting issues :study: ;) but in case some genius can solve my problem some other way, here are the details (I would be *very* grateful):

Code:

[root@localhost root]# fdisk -l
                                                                               
Disk /dev/hda: 41.1 GB, 41174138880 bytes
255 heads, 63 sectors/track, 5005 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
                                                                               
  Device Boot    Start      End    Blocks  Id  System
/dev/hda1  *        1        13    104391  83  Linux                                      // Linux /boot
/dev/hda2          1148      5004  30981352+  f  Win95 Ext'd (LBA)        // Extended Partition
/dev/hda3            14      1082  8586742+  83  Linux
/dev/hda4          1083      1147    522112+  82  Linux swap
/dev/hda5          1148      1274  1020096    e  Win95 FAT16 (LBA)      // For Linux/XP sharing
/dev/hda6          1275      5004  29961193+  7  HPFS/NTFS                  // WinXP partition
 
Partition table entries are not in disk order

Here is the relevant part of my current grub.conf, which doesn't work ("Error 12: Invalid Device" or something similar if I recall)

title Windows XP
        map (hd0, 0) (hd0, 5)
        map (hd0, 5) (hd0, 0)
        rootnoverify (hd0,5)
        chainloader +1

Thanks for reading all of this, (those that made it this far).

lugoteehalt 02-10-2004 07:04 AM

Quote:

/dev/hda2 1148 5004 30981352+ f Win95 Ext'd (LBA)
It's a bit since I've done this bootloader stuff so please treat what I say with caution.

Above quote says Windows not on first partition? Next to impossible to get it to boot unless it is on the first partition of one of the drives??

Quote:

title Windows XP
map (hd0, 0) (hd0, 5)
map (hd0, 5) (hd0, 0)
rootnoverify (hd0,5)
chainloader +1
Just spotted above; is this trying to convince Windows it's on the first partition? The use of the map command I am familiar with is using it when Windows is on the first partition of a non-first drive, say hdb1, to make it think it's on first partition of drive a - hda1.

Quote:

/dev/hda5 1148 1274 1020096 e Win95 FAT16 (LBA) // For Linux/XP sharing
Probably bollocks but isn't Win95 vfat, i.e. is the 'FAT 16' wrong??

Ouch_Taser 02-10-2004 06:17 PM

Quote:

Originally posted by lugoteehalt
Above quote says Windows not on first partition? Next to impossible to get it to boot unless it is on the first partition of one of the drives??
I had some progress last night. I used the PT Disk Editor (graphical DOS based editor) to change the Hidden Sector value in the NTFS logical partition to the correct value. Now GRUB *does* chainload to the correct location. However now I am getting the msg "Can't find NTLDR", but at least it is getting there.

I highly reccommend this article: http://www.goodells.net/multiboot/. Specifically: http://www.goodells.net/multiboot/ptedit.htm. A good straight-to-the-point post can be found here: http://groups.yahoo.com/group/xosl/message/2864


Quote:

Just spotted above; is this trying to convince Windows it's on the first partition?
Yeah I was but I didn't really know what I was doing, it was just a guess. It is now:

rootnoverify (hd0,5)
chainloader +1

Quote:

Probably bollocks but isn't Win95 vfat, i.e. is the 'FAT 16' wrong?? [/B]
Hmm, I don't think so. I thought vfat was some linux thing. In any case I havn't touched that drive since using DiskDruid :)

I have read the MS support article on fixing the NTLDR problem, but their scenarios do not cover Linux dual booting, so I suspect there is a simpler way to fix it in this case. Any suggestions?

lugoteehalt 02-11-2004 10:03 AM

Quote:

modfying the "Hidden Sectors" value
Grub has a command for hidding - ?hiding - things. Maybe that would help.

Suspect, but don't take my word for it, that the problem is complex and it would be quickest to re-install Windows on the first partition and then, if necessary, re-install Linux.


All times are GMT -5. The time now is 07:34 AM.