Martins wrote:

it is possible with fdisk, i did it and it worked, and this is steps i followed, step 7 wasnt necesary for me:


More info about the bug can be found here:
https://bugzilla.redhat.com/bugzill...g.cgi?id=115980
https://bugzilla.redhat.com/bugzill...g.cgi?id=113201


Note that whatever web browser and method you are using to cut and paste URLs is producing broken links. Fortunately, at least the bug ID was intact so I was able to lookup the bugs.

I don't see how either bug applies to Maxim, as he didn't get this after installing FC2, changing from kernel 2.4 to 2.6, or doing anything to his partiton table. He just moved the disk from primary master to (primary slave?). Also, AFAIK this has not been a problem for any Gentoo user using fdisk to partition his drives.

Device Boot Start End Blocks Id System
/dev/hda1 * 63 33732719 16866328+ 7 HPFS/NTFS
/dev/hda2 74692800 78140159 1723680 1c Hidden W95 FAT32
(LBA)
/dev/hda3 35834400 74692799 19429200 83 Linux
/dev/hda4 33732720 35834399 1050840 82 Linux swap

So I recreated this partition table on a spare 100Gb USB disk:


Command (m for help): p

Disk /dev/sda: 100.0 GB, 100030242816 bytes
16 heads, 63 sectors/track, 193821 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       33465    16866328+  83  Linux
/dev/sda2           74101       77520     1723680   83  Linux
/dev/sda3           35551       74100    19429200   83  Linux
/dev/sda4           33466       35550     1050840   83  Linux

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): p

Disk /dev/sda: 100.0 GB, 100030242816 bytes
16 heads, 63 sectors/track, 193821 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    33732719    16866328+  83  Linux
/dev/sda2        74692800    78140159     1723680   83  Linux
/dev/sda3        35834400    74692799    19429200   83  Linux
/dev/sda4        33732720    35834399     1050840   83  Linux



$ fdisk -H 255 /dev/hda # or 240 for some configurations
Command: o (create new partition table)

6. by now you have a newly generaed partition table, with the original
disk geometry. Recreate the partitions as they were before:

Command: n (new partition)
Primary partition (p)
Partition number: 1
First cylinder: 63 # beginning of first partition
Last cylinder or +size[...]: 33732719 # end of first partition


This doesn't work, because we are still working in cylinders:

Partition number (1-4): 1
First cylinder (1-12161, default 1): 63
Last cylinder or +size or +sizeM or +sizeK (63-12161, default 12161): 33732719
Value out of range.

But I assume what you really meant is to switch to sectors. After recreating all of the partitions in sector mode, I have:

Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    33732719    16866328+  83  Linux
/dev/sda2        74692800    78140159     1723680   83  Linux
/dev/sda3        35834400    74692799    19429200   83  Linux
/dev/sda4        33732720    35834399     1050840   83  Linux

Ok, so this seems to work. I didn't know about the 'u' command for fdisk, so thanks for that.

But I still have a problem with this from a sanity standpoint. Note the output of sfdisk for the 16-heads vs 255-heads tables:

carcharias rjf # sfdisk -l /dev/sda

Disk /dev/sda: 193821 cylinders, 16 heads, 63 sectors/track
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0+  33464   33465-  16866328+  83  Linux
/dev/sda2      74100   77519    3420    1723680   83  Linux
/dev/sda3      35550   74099   38550   19429200   83  Linux
/dev/sda4      33465   35549    2085    1050840   83  Linux

Disk /dev/sda: 12161 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0+   2099-   2100-  16866328+  83  Linux
/dev/sda2       4649+   4863     215-   1723680   83  Linux
/dev/sda3       2230+   4649-   2419-  19429200   83  Linux
/dev/sda4       2099+   2230-    131-   1050840   83  Linux

Notice all of the extra '+' and '-' signs...those mean that the partitions do not line up with cylinder boundaries, and we probably should have left the partition table at 16-heads. Fdisk may (now) handle this ok, but it is not standard and less intelligent partition tools are likely to throw a fit. Actually, this is what most of the bug reports regarding parted and disk druid are about...they couldn't handle the misalignment.

Anyway, my information about fdisk was defintely out of date...the last time I had a direct problem with 255 vs 16 heads was in 1999 or so. Thanks for pointing out that fdisk has more capability that I had given it credit for.

-Richard

--
gentoo-user@gentoo.org mailing list

Reply via email to