# Fedora Core 2 / Windows XP Dual Boot - Drive Geometry



## robert2513 (Jun 6, 2003)

Hi there.

I am currently trying to setup a computer dual booting Windows XP Pro and Fedora Core 2. I understand there is a problem with this setup; something with Fedora changing the drive geometry causing Windows not to boot. I found the remedy here:

http://lwn.net/Articles/86835/

After reviewing it, and running the command in Fedora Rescue :

fdisk -l /dev/hda

I get the following:

Disk /dev/hda: 60.0 GB, 60011642880 bytes
225 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device: /dev/hda1 Boot: * Start: 1 End: 7296 Blocks 5860588+ 
Id: 7 System: HPFS/NTFS

Now, my question is, is the cylinders amount the 7296 or the 16065? The reason I am asking is that in the example in the article, the number is something like 14593 and according to my read-out, my cylinders is 7296. The number 16065 seems more appropriate. I am new at linux, so forgive me if this is a stupid question.

Thank you.
Robert2513


----------



## 141191 (Sep 12, 2004)

Robert2513,
for sure the number you're looking for is 7296 cylinders.
You should have something like that in your BIOS config.

What is written in your POST when your HD is detected? (just when you power on you computer)


----------



## robert2513 (Jun 6, 2003)

Thanks for the reply. When I turn on the computer, all I see is the Dell Loading Screen. The computer is a Dell Inspiron 9100 laptop.


----------



## 141191 (Sep 12, 2004)

ok, are you familiar with BIOS handling?
if not, that's no problem if you do not change anything, we just want to "see" things, right?

Dell computers are different, usually to access BIOS you press "Del" after power up your computer.

I checked the net and seems you gotta try also
- "F1"
- pressing "Reset" twice
- "Ctrl" + "Alt" + "Enter"

once there, try "Autodetect Hard Drive" and take a look on the CHS parameters. Press "Esc" and select "Exit".

Don't save any modifications made.

Good luck.


----------



## lotuseclat79 (Sep 12, 2003)

robert2513 said:


> Hi there.
> 
> I am currently trying to setup a computer dual booting Windows XP Pro and Fedora Core 2. I understand there is a problem with this setup; something with Fedora changing the drive geometry causing Windows not to boot. I found the remedy here:
> 
> ...


If you do a little calculation, you will be able to read between the lines of what the output information is saying: i.e. one cylinder consists of 16065 512-byte blocks or 8225280 bytes (each cylinder). And if you divide the total number of bytes of your 60GB disk (60011642880 bytes) by the number of bytes in each cylinder (8225280 bytes) you get 7296 cylinders!

-- Tom

P.S. Your question was not stupid, and I doubt that a hard disks drive geometry can be changed by any OS - as the disk drive manufacturer creates the disk to industry standards.

P.P.S. Good luck with your dual boot setup.


----------



## I Fix 4 U (Jul 19, 2004)

well fc2 does have issues w/ drive geometry. it was clearly stated on their forums and site. I managed to get fc2 running fine with my windows box. I didnt install them on the same harddrive basically i didnt even touch my harddrive w/ xp but on the other i put grub and fc2 and made it bootable. it did mess up drive geom and i had to reconfigure grub myself to get xp to boot. but all was good.


----------



## 141191 (Sep 12, 2004)

lotuseclat79,
disk geometry cannot be changed in the sense having a 60GB hard disk and setting it as a 80GB, for instance.

But, in my case, I have a 40GB disk. I'm totally free to choose either
CHS = 79406,16,63 or CHS=4981,255,63
I don't know why those numbers are equivalent. Does anybody know the math behind? (79405*X1+16*Y1+63*Z1 = 4981*X2+255*Y2+63*Z2 --> find X1,Y1,Z1 and X2,Y2,Z2 -- I guess is something like that)

My mobo is some old and it doesn't like C>65535, that means the second choice is the only one a have.

When I installed FC2, the thing screw up my HD as well, because I have H=255.

I had only FC2 on that disk, so the damage was almost nothing.

But that bug is unforgettable and I decide to say f***! to Red Hat and their crappy Fedora project -- I change to Conectiva and Suse


----------



## I Fix 4 U (Jul 19, 2004)

yah i removed fedora it had too much problems. then i went to knoppix but since i could run it from cd i removed it. now i'm looking around. didnt like linspire, mandrake didn't work for some reason as it worked great on my other machines. my next try out will be gentoo if i have some time. if not i'll try to install MEPIS.


----------



## saikee (Jun 11, 2004)

I have installed FC2 with a bunch of other Linux distros and XP on the same drive on various hard disks (IBM 60Gb and Maxtor 200Gb ATA133) and have yet to experience the geometry problem.

My FC2 is in hde2 below

Disk /dev/hde: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hde1 * 1 3187 25599546 7 HPFS/NTFS
/dev/hde2 3188 4403 9767520 83 Linux
/dev/hde3 4404 5619 9767520 83 Linux
/dev/hde4 5620 24792 154007122+ 5 Extended
/dev/hde5 5620 5984 2931831 82 Linux swap
/dev/hde6 5985 7200 9767488+ 83 Linux
/dev/hde7 7201 7808 4883728+ 83 Linux
/dev/hde8 7809 9024 9767488+ 83 Linux
/dev/hde9 9025 9632 4883728+ 83 Linux
/dev/hde10 9633 10848 9767488+ 83 Linux
/dev/hde11 10849 11456 4883728+ 83 Linux
/dev/hde12 11457 12672 9767488+ 83 Linux
/dev/hde13 12673 13280 4883728+ 83 Linux
/dev/hde14 13281 14496 9767488+ 83 Linux
/dev/hde15 14497 15104 4883728+ 83 Linux
/dev/hde16 15105 16320 9767488+ 83 Linux
/dev/hde17 16321 16928 4883728+ 83 Linux
/dev/hde18 16929 18144 9767488+ 83 Linux
/dev/hde19 18145 18752 4883728+ 83 Linux
/dev/hde20 18753 19968 9767488+ 83 Linux
/dev/hde21 19969 20576 4883728+ 83 Linux
/dev/hde22 20577 21184 4883728+ 83 Linux
/dev/hde23 21185 21792 4883728+ 83 Linux
/dev/hde24 21793 22400 4883728+ 83 Linux
/dev/hde25 22401 23008 4883728+ 83 Linux
/dev/hde26 23009 23616 4883728+ 83 Linux
/dev/hde27 23617 24224 4883728+ 83 Linux
/dev/hde28 24225 24792 4562428+ 83 Linux


----------



## 141191 (Sep 12, 2004)

Wow, that's really impressive! You may really like Linux...
How's your head BIOS config for that HD? Do you have Heads = 255?
I see fdisk is written that, but I want to know what is in BIOS.

BTW, during FC2 installation, have you done 'linux geometry=24792,255,63'? Or you have reformatted you disk?
That could be the secret, in my case I didn't know that bug, so I get in the worse way.

But it's not impossible to run FC2, that's not my point. I just don't feel comfortable with companies using my system as free trials for catching their bugs --> That's why I hate M$, and Red Hat have done the very same!


----------



## lynch (Aug 3, 2002)

http://usalug.org/phpBB2/viewtopic.php?t=2745


----------



## I Fix 4 U (Jul 19, 2004)

i agree with both. Also during installation of FC i think thats where the drive geom problems start but i didnt have any. I just removed it because i had other problems. I was careful of what i selected and deselected in the installer and i made sure i did all my choices in advanced.
PS saikee's just likes linux and went a little far with the multiboot compliance.
Also another problem that might make xp unbootable. Fedora Core cannot properly handle setting up grub to dualboot xp. I spend about 2 hours and i figured out that i had to modify my menu.lst and add a few things.


----------



## saikee (Jun 11, 2004)

OK, I have checked my BIOS information. My 200Gb Maxtor Diamond Plus 9 was detected by "auto" and no cylinder or head data was given. My other 60Gb drive was also auto-detected but the head and clinder data is displayed in the BIOS page. Both disks have LBA on.

Here is the menu.lst of my FC2. I have also Red Hat 9 in Partition hda11. The previous fdisk -l was printed off Suse 9.1. Suse names my boot drive as hde but FC2 goes with the majority and names the same disk as hda. Just an example to show FC2 works and doesn't cause geometry problem at least in my case. Thus the geometry problem may be hardware dependent. The FC2 has Slackware twice because I am in a process of pushing some distros to the rear end of the drive.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,6)
# kernel /boot/vmlinuz-version ro root=/dev/hda2
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=100
splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title Fedora Core (2.6.7-1.494.2.2)
root (hd0,1)
kernel /boot/vmlinuz-2.6.7-1.494.2.2 ro root=/dev/hda2 rhgb quiet
initrd /boot/initrd-2.6.7-1.494.2.2.img

title floppy
root (fd0)
chainloader +1

title Wondows XP @ hda1
hide (hd0,2)
unhide (hd0,0) 
rootnoverify (hd0,0)
chainloader +1

itle SATA Wondows XP @ sda1
hide (hd0,0)
unhide (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd0,0)
chainloader +1

title floppy
root (fd0)
chainloader +1

title Wondows Debain Sarge @ hda3
root (hd0,2)
chainloader +1

title Wondows Suse 9.1 @ hda6
root (hd0,5)
chainloader +1

title Wondows Vine 2.6 @ hda7
root (hd0,6)
chainloader +1

title Mandrake 9.2
root (hd0,7)
chainloader +1

title Slackware 10
root (hd0,8)
chainloader +1

title Knoppix 3.4
root (hd0,9)
chainloader +1

title Red Hat 9
root (hd0,10)
chainloader +1

title Lycoris 3
root (hd0,11)
chainloader +1

title Libranet 2.8.1
root (hd0,12)
chainloader +1

title Mandrake 10
root (hd0,13)
chainloader +1

title Knoppix 3.3
root (hd0,14)
chainloader +1

title Yoper
root (hd0,15)
chainloader +1

title Slax (not working)
root (hd0,16)
chainloader +1

title Mepis (problem)
root (hd0,17)
chainloader +1

title Kanotix
root (hd0,18)
chainloader +1

title empty
root (hd0,19)
chainloader +1

title Blax
root (hd0,20)
chainloader +1

title Tiny sofa
root (hd0,21)
chainloader +1

title empty
root (hd0,22)
chainloader +1

title Slackware 10 @ hda27
root (hd0,26)
chainloader +1


----------



## I Fix 4 U (Jul 19, 2004)

looking at that saikee about how many partitions do you have in your extened and what is their size. do you use qtparted?


----------



## saikee (Jun 11, 2004)

In my second last post the fdisk -l indicates 28 partitions with standard 5 or 10 Gb partitions for the Linux.

I have just dd another copy of the hard disk intending to reduce the 10 Gb partitions into 5Gb so that I can pack more of them in.

My current trouble are

(1) Some distro like FC2 can only report the first 16 partitions in fdisk

(2) Lilo is not ambitious and has not been written to accept more than 16 entries in the boot menu. Grub has no limit.

(3) Some distros, especially the small ones, have a problem of being installed in the rear end of the drive where the partition number is high.

No I don't use Qtparted. I just partition the hard disk the way I want and copy the installed Linux (from anoth hard disk) over using the tar or dd command. For a new one I obviously have to do an installation.


----------



## I Fix 4 U (Jul 19, 2004)

so u use fdisk erasing all data and just put linux back from another location by dd?


----------



## saikee (Jun 11, 2004)

I standardise my Linux partitions with Ext2 file system.

If the source and target partitions are the same size and have the same partition number I use dd to transfer from one hard disk to another. The transfer distro will boot without modification (after I include it in the MBR's bootloader of course).

If the source and target partitions are different size I have to use tar which preserves the file structure, ownership etc. The transfer distro also need no modification.

If the source and target partitions are different size and different partition name then after transfer by tar I need to amend the partition references in boot menu, fstab and mtab files.

I try to avoid a re-installation if I could retain the installed distros. This works fine as long as the Linux had been installed in the same computer with identical hardware. 

I do keep backup copies of my dsitros.


----------



## I Fix 4 U (Jul 19, 2004)

so when you're just swapping a distro from partition to partition if you are modifing your table?


----------



## saikee (Jun 11, 2004)

Don't understand your question iXneonXi.

If the source locates at a partition different to the target then the references to the old partition must be revised to the new one.

My point is once you have a distro installed successfully you can keep on using it in various partitions and there is no need to re-install it unless it is damaged beyond repair.


----------



## I Fix 4 U (Jul 19, 2004)

o your just saying you move your linuxes from partition to partition if needed. but why would you need to move them?


----------



## saikee (Jun 11, 2004)

I started with one Linux taking over the whole drive, then I put it togther with XP, then XP with 4 Linux, then 16 partitions and finally the 28 partitions. I did it by moving from one drive to another. It is much quicker and safer than resizing. I have resizing messing up the partition table before. It is only a few minutes in copying a partition over.

I have all my hard drives in caddies and none fixed inside any of my computers (except laptops). It is true plug and play in my case.

When investigating your two Windows system booting I just slipped in two backup copies of my XP into the same computer to see if I could boot 3 XPs with Linux. This setup allows me to find out things quickly.


----------



## I Fix 4 U (Jul 19, 2004)

For the person who started this thread i do know of geom problems but i have had fc2 successfully installed and able to multiboot with my xp on the same computer with absolutely no problems.
___________________________________________________________
Note To Saikee:
i'd like to get back on chat sometime when its best for you b/c that looks like an interestin method i think i should get really good at. or you could pm me and describe it in much detail. also, win98 is succesfully installed in the other harddrive and i can boot it if i change my bios. linspire nuked winxp's mbr like i didnt want but i was able to acess via the grub floppy (thanx  ) We really need to talk i need to get a few things sorted out and put things back to normal.


----------



## saikee (Jun 11, 2004)

iXneonXi,

Think we have hijacked this thread to talk about our own things but at least you and I can confirm that FC2 does work and the geometry problem may not entirely created by FC2.

I put my hard disk information forward because that I thought it would be a prime candidate for the alleged problem. FC2 and Red Hat have served me well. They are stable and stand shoulder to shoulder among the top Linux performers. I feel I should speak out to defend them.

If you have any other Linux issue I shall be glad of any asistance. Just catch me whenever you see in in MSN Messenger. I am not due to be away for a few weeks yet.


----------



## I Fix 4 U (Jul 19, 2004)

Thanx saikee. Yah FC2 is quite a nice system esp w/ redhat updater. See you on MSN.

Sorry to you robert about messing with your thread but basically ask me or saikee to help you set up a dualboot xp system. we have done it successfully. i will be on aim alot and my screename if iXneonXi. I prefer not to reveal my MSN name.

ps do you think the geom errors are kernel related, or anaconda (installer) related?


----------



## 141191 (Sep 12, 2004)

saikee has described a nice method to backup, upgrade and install our distros if we have at least two disks available.
I understand precisely what he says because I'm familiar with things he has done, despite I don't have similiar architecture.
I want to make you some questions: suppose you have distros A, B and C. And you have disks /dev/hda and /dev/hdb
You said anytime you need repartitioning, you simply repartition correctly one of your disks and flip A, B and C to the correctly partitioned disk, right?
Fine, repartitioning is not a issue that way...

But, what happen when you need to move B from /dev/hda to /dev/hdb? Do you have to use A or C to do that? Could you use B for moving itself or not?
Unfortunately, I'm not familiar with 'dd' specially because I never know the block size. I would really enjoy if you post your command line as an example.

Thanks for this thread.

PS: one more note, if you have HEADS=16 at BIOS, FC2 installation will work no problem. That probably explains the examples we had FC2 working fully with WinXP and I'm pretty sure this is an Anaconda bug.


----------



## I Fix 4 U (Jul 19, 2004)

k i'll try that out, i'm going to reinstall fc2.


----------



## saikee (Jun 11, 2004)

dd copies the data in native mode, in 1s and 0s, and so the file type has no consequence. Therefore it can be used for cloning a hard drive with both Windows and Linux partitions.

The strength of dd is also its weakness because it work perfectly only if the size of both source and target drives or partitions are identical.

The block size can be omitted and a deafult value will probably be used as most hard drive has 512 bytes per sector. My experience with dd, for two identical 200Gb disks with XP and loads of Linux inside, on block sizes yields the following results. ( the hdd has 512 bytes/sector, 63 sectors/head and 255 heads/cylinder so 512x63=32256=one track size and 512x63x255=8225280=one cylinder size)

(1) dd if=/dev/hda of=/dev/hdb took over 4 hours. Disk has 28 partitions.
(2) dd if=/dev/hda of=/dev/hdb bs=8225280 took over 2 hours. Disk has 28 partitions.
(3) dd if=/dev/hda of=/dev/hdb bs=32256 took over 1.5 hours. Disk has 16 partitions previously. Using Norton Ghost the operation took over 4 hours.

Thus Linux's dd command outperforms a commercial software like Norton Ghost.

I would use dd if the source and target partitions are same size and have the same partition number (say 5th partition) by typing

dd if=/dev/hda5 of=/dev/hdb5

I don't bother with block size for a partition because it is a few minutes job for a 10Gb transfer.

Tar command is more flexible and this is the thread  I learned from. The relevant bit is by the moderator DMR when he started "here is the deal". I follow his method exactly but omitting the verbose parameter "v" as I don't need to see screen scrolling during copying. Also I now do it with a script adding the command "date" before and after the tar command so that I get the time record of the whole process.


----------



## I Fix 4 U (Jul 19, 2004)

sounds cool. still think i need an estimate when you will be on msn though. i have a few things i need to sort out.


----------



## saikee (Jun 11, 2004)

There is a threat for me to go to Abu Dhabi this weekend but I should be in the evening Thursday and Friday.


----------



## I Fix 4 U (Jul 19, 2004)

i'll pm you when i figure things out.


----------



## 141191 (Sep 12, 2004)

saikee,
Linux is a mature OS, so accessing peripherals like hard disks could be benefited by DMA, for instance. That would explain the dramatic difference between Ghost and 'dd'.

So, concerning what you said, it doesn't matter what distro you are using to move your data, a particular one can perfectly copy itself to another disk, right?
I was curious about swap, because those transfers should hardly use virtual memory and when you copy the place you're using to swap... that's generally trouble!
Windows (aghhh, sorry for that) gets crazy when you try to copy win386.swp or pagesys. I never tried something related on Linux, I just thought they cleverly made a special partition (SWAP) to avoid that situation.

Thanks for that.


----------



## saikee (Jun 11, 2004)

****,

I think it is a characteristic of Linux that it can be cloned to another hard drive while being the working operating system in the PC, a feat Windows can never do.

Not all Linux behave the same way in dd. My first operation with dd with Knoppix took 20 times longer than Suse. When I started my dd adventure the same 200Gb drive took 36 hours to clone! I haven't found out the reason behind it yet. It may be something to do with the Linux setup, Kernel version or the support of 64 bit CPU (Suse supports AMD 64 bit processor).


----------



## I Fix 4 U (Jul 19, 2004)

also in windows you just can't go copying system files that are in use. linux can esp if you are root.


----------

