Announcement

Collapse
No announcement yet.

Partition geometry anomaly?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Partition geometry anomaly?

    @snowhog if you want to repartition it, "by cylinders", then I can tell you how to do that with fdisk. It's a little tedious, but not really difficult.

    Comment


      #17
      Re: Partition geometry anomaly?

      @dibl

      I would like that. I would also like to understand why the partitioners are not respecting the cylinder boundries when the partitioning was setup.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #18
        Re: Partition geometry anomaly?

        http://tldp.org/HOWTO/Large-Disk-HOWTO-6.html

        Don't know if this will answer all your questions, but read 6.2.

        Please Read Me

        Comment


          #19
          Re: Partition geometry anomaly?

          @oshunluver

          Damn! Two minds thinking alike. I was just reading that page, and was going to comment on it here, but I see you too, found it!!
          What is this nonsense you get from fdisk about `overlapping' partitions, when in fact nothing is wrong? Well - there is something `wrong': if you look at the begin and end fields of such partitions, as DOS does, they overlap. (And that cannot be corrected, because these fields cannot store cylinder numbers above 1024 - there will always be `overlap' as soon as you have more than 1024 cylinders.) However, if you look at the start and length fields, as Linux does, and as Windows 95 does in the case of partitions with partition type c, e or f, then all is well. So, ignore these warnings when cfdisk is satisfied and you have a Linux-only disk. Be careful when the disk is shared with DOS. Use the commands cfdisk -Ps /dev/hdx and cfdisk -Pt /dev/hdx to look at the partition table of /dev/hdx.
          A well-known claim says that partitions should start and end at cylinder boundaries.

          Since "disk geometry" is something without objective existence, different operating systems will invent different geometries for the same disk. One often sees a translated geometry like */255/63 used by one and an untranslated geometry like */16/63 used by another OS. (People tell me Windows NT uses */64/32 while Windows 2K uses */255/63.) Thus, it may be impossible to align partitions to cylinder boundaries according to each of the the various ideas about the size of a cylinder that one's systems have. Also different Linux kernels may assign different geometries to the same disk. Also, enabling or disabling the BIOS of a SCSI card may change the fake geometry of the connected SCSI disks.

          Fortunately, for Linux there is no alignment requirement at all. (Except that some semi-broken installation software likes to be very sure that all is OK; thus, it may be impossible to install RedHat 7.1 on a disk with unaligned partitions because DiskDruid is unhappy.)
          Windows no longer obstructs my view.
          Using Kubuntu Linux since March 23, 2007.
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #20
            Re: Partition geometry anomaly?

            OK, looking at your fdisk output, and understanding that modern hdds use "translation" control software such that there is no real relationship between the stated numbers of heads and cylinders, vs. the physical disk, yours says:

            255 heads
            63 sectors/track
            14,592 cylinders
            234,441,648 sectors
            1 cylinder would consist of (255 x 63) = 16,065 sectors

            So if we leave that alone (it could be changed with fdisk if we wished), we need to focus on the 14,592 cylinders and figure out how to divvy it up between partitions, using whole cylinders.

            More math (and all from your fdisk output):

            512 bytes is a sector
            2 sectors makes 1024 bytes = 1KB
            2 x 1024 = 2048 sectors make 1MB
            1 cylinder = 16,065 sectors / 2048 = 7.84423828 .... MB (geez there is an awkward figure!)

            Your hdd has 234,441,648 sectors, so I can divide that by 2048 and learn that we're working with a hdd of 114,473.46MB, and if I divide that by 1024 I get 111.79GB.

            I see that you made your root partitions 10,482,688 sectors in size, which I divide by 2048 and see that you intended them to be about 5,118.5MB in size, and doing the same with the "/home" partitions it looks like 26,209,984 / 2048 = 12,797.84MB, and for swap it was 2096451 / 2048 = 1,023.66MB.

            To figure how many cylinders to include in the root partitions, we need to look at your target size of ~5.1GB or 5,119MB, and divide that by that awful number of MB/cylinder. 5,119 / 7.85 = 652 and a small fraction. So I'll suggest you want 652 cylinders in each root partition. Or you can make it 653 if you'd rather round up. Sooooo, (and ignoring the Windows partition) now we need to look at that partitioning plan in terms of whole cylinders. You'll begin the first partition on cylinder #2 (same as it is now) and the last cylinder will be (2 + 652) = 654. I guess what you really want to do for this first one is figure out the cylinder on which Windows starts, and make your first partition end on the cylinder before that one.

            This same logic applies to the partitions following Windows. The next cylinder after the one that Windows ends on shoudl be the beginning of your third partition, and then add 652 to that number, and that will be the last cylinder of the third partition.

            swap will begin on the following cylinder. It needs to be (1024 / 7.844) = 131 cylinders (rounded up) long.

            OK, we've beat the math to death -- you get the idea about calculating cylinders and sizing the partitions. The same logic applies to the Windows partition as all the others.

            So from a live CD session, start fdisk and let's stick with the heads and sectors structure that you have:

            Code:
            sudo fdisk -H 255 -S 63
            You will see a warning about the total number of cylinders exceeding the 1024 limit from the DOS dark ages -- disregard it.

            At the command line, enter "o" (that's a small letter O, not a zero) to begin a new partition table.

            Next, enter "n" to make a new partition.

            Next, enter "e" for extended or "p" for primary. You could make the first two primary if you want, and the rest can all be extended since only Win XP requires itself to be in a primary partition.

            Next, you enter the sequence number of the new partition, beginning with "1" for the first, etc.

            Next, you enter the beginning cylinder number. So for the first partition you will enter "2", and for succeeding partitions it will be the "next up" cylinder following the number of the last cylinder of the preceding partition.

            Next, you enter the final cylinder number for the new partition, which you will have calculated using the "cylinder math" above.

            Next, you enter "t" for partition type. Linux partitions will be "83", the NTFS partition will be "07", and swap is "82".

            After entering the partition type figure, you enter "n" and begin again with the succeeding partition.

            When the final partition is done (you can select the default final cylinder that it offers) and you have entered the partition type, then you enter "w" to write all the information to the partition table.

            Poooof! You have completely partitioned your hdd "by cylinders" now.


            EDIT: Upon observing the challenges presented by working with cylinders of 16,065 sectors (caused by the heads/sectors geometry), this case could be simplified a lot by changing to a geometry of 64 heads and 32 sectors per track, giving a cylinder size of 1,024K (exactly 1MB). To do this, all this needed is to start fdisk as follows:

            Code:
            sudo fdisk -H 64 -S 32
            and of course the "cylinder math" will have to be redone, based on 1MB cylinders, which will make it considerably simpler.

            Comment

            Working...
            X