Showing posts with label Disk Partition Geometry. Show all posts
Showing posts with label Disk Partition Geometry. Show all posts

Tuesday, 16 June 2009

Installing GParted and XOSL

In xVM virtual Box I mount the enhanced GParted.iso I prepared as I explained here, and then I start the machine. It loads GParted from ISO image. I continue on defaults of GParted, but for the last stage when it gives me a choice of command line, as choice [2]. After loading the "Debian" commandline, at the prompt I type "fdisk" and then "return". It gives a usage of "fdisk" command. I type "fdisk /dev/hda". It finds the virtual hard disk and describes its specifications. It gives usual warning of Linux regarding violation of 1024 cylinders limit. For this writting I selected a virtual hard disk of some 16Gb. "fdisk" recognizes a default H=16, S=63 and number of cylinders C=33288. This creates later problems for me if I do not correct them. Each cylinder now contains 1008 blocks, each block 512 bytes gives a total of 0.5Mb capacity for each cylinder. I should have an 8Mb capacity for each cylinder. If I keep S=63 and increase H to H=255 then number of cylinders will be 33288/(255/16) or 33288x16/255 which is roughly C=2088 and each cylinder contains SxHx512=63x255x512=8225280 bytes or some 8Mb of data.

Sunday, 14 June 2009

Geometry of Hard Disk

Two weeks I did not write in this Blog. I am preparing a website here. I needed to become used to the Microsoft Office Live tools and editing the files and uploading and changing backgrounds. Now I am smoothly on the track. Hopefully that site includes very interesting pieces regarding hardware and assembly codes and this Blog remains for general tuning of computer and similar ideas. I was talking about the structure of hard disk. Their technology constantly is changing to reduce the size, to reduce access time for retrieving each piece of data, or in other words to increase the speed of data retrieve. At the same time it is desirable to increase the amount of data that one can put on a hard disk. There are also other goals such as reducing the noise created by hard disk and improve its mechanical features such as ambient compatibility and positioning of a working hard disk in different orientations. BIOS of computer and operating system talk with the embedded software of the hard disk and from that point on we do not know how that software handles data that I give to my computer to be saved. Hard disk takes my data and with all honesty keep them and gives them back to me. For that software all of my data are in form of bytes next to each other. It is like the RAM of computer: there is no cylinder or head or anything. From the time of corporate mainframe computers with their stacks of disks we have data organization in form of a three dimensional space. At each point "head" should stop, read the data and after passing certain time move to another point. While moving it cannot read anything. Normally people understand that a cylinder is a solid object. This is not meaning of a cylinder. A cylinder is only the outer surface of a solid cylinder similar to a pipe with no pith. A solid cylinder object is like many pipes, thousands, smaller inside the larger. I can address each pipe or cylinder by counting from the most outer and larger pipe to the most inner narrower pipe. Each disk in our imaginary stack of disks has two sides for putting data: top and bottom. On each side we have an imaginary head. Actually a real hard disk has two disks, called platter with four heads, but these are not our concern. For partitioning practice I assume that I have 128 disks each two heads (two sides), a total of 256 heads. I further assume that the most bottom disk has not a bottom disk and therefore no head. that reduces heads to 255 at the end. Hence, H=255. That gives address to find one side of an imaginary disk. cylinders on each disk can be seen as circular track of a CD ROM. Then I should navigate around over that side. I divide that similar to a pizza or a pie. Normally, you do it by make it half and then half again and further until you get small portions. For hard disk, small portions are called "sector." It is standard to continue to make half until we get 64 sectors; six times halving, one after the other. They are counted from "zero" to 63 included, 64 all together. Hence, S=63. One does not change this default, except to commit him to some adventures not utilizing partitions for daily work. the last thing remains for me to decide that on a specific sector on a specific head how many cylinders, inside each other, I need. With the scheme that I have had so far each of my cylinders contain roughly 8Mb of data. From that I can decide for number of cylinders. For safe experience I never exceed C=1024 cylinder, or around 8Gb. But for real works, I do not care much about these things and allow GParted or Windows or Solaris or other software manage these tasks.

Sunday, 31 May 2009

Utilizing Virtual Box

I have the GParted.iso image saved somewhere in my computer and want to test it and become familiar with it. I have not burnt it yet to a CD ROM. I open my xVM VirtualBox and mount this ISO image on it by browsing to its saved folder. These all intuitively can be done. Then I start my virtual machine. I already had selected "Other" as name of machine to remember that type of my virtual machine is unspecified. When machine starts it automatically finds the mounted image and then GParted loads. I find it better to use graphical default GParted for a non-partitioned hard disk. In GParted GUI menu I create these partitions: first an extended 2GB second a primary 9Gb and third a primary 9Gb. I create three logical partition inside the first extended partition: first a 16Mb FAT16 for XOSL (it comes as 24Mb) then an ex2 logical with 250Mb capacity and remaining FAT32 for Freedos. I format next primary partition with NTFS for my first XP Windows. I leave the last partition for later. That I selected extended partition as first partition was to overpower myths regarding "first partition" usage. GParted promise is that that its partitions are rounded to "cylinder" but I cannot rely on that due to the fact that in its GUI I could not find any option for selecting number of heads. When you normalise the geometry of the partition and read CHS (Cylinder, Head, Sector), say by Ranish partition tools sometimes you get fractions. It is better to do a basic partitioning and then restart GParted in its "Debian" command lines and, using fdisk utility, fine tune partitions based on a CHS calculated as H=255, S=63 and C should be got through calculations, rather than default of GParted that uses only H=16. This default gives thousands of cylinder. For H=255 and S=63 each roughly 8Mb is one cylinder. Hence, for 24Mb I select 3 cylinders, for 250Mb I select 30 cylinders for Freedos I select 220 cylinders and so on.