LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-31-2006, 03:59 AM   #1
asilentmurmur
Member
 
Registered: Mar 2005
Location: Washington DC area
Posts: 214

Rep: Reputation: 30
how many HDD cylinders = 1 megabyte?


hey everyone this is a general question.

I am using Fdisk to partition my drive so i can install slack 10.2. the units its giving me are in cylinders. I wanted to know how many cylinders equal 1 megabyte. Also in cfdisk how do i create an extended partition?
 
Old 03-31-2006, 04:24 AM   #2
cor67393
Member
 
Registered: May 2005
Distribution: Slackware 12.1
Posts: 52

Rep: Reputation: 16
Why do you want to use both fdisk and cfdisk?
I suggest sticking with cfdisk, and so does the manpage of fdisk .

With cfdisk, to make an extended partition, just make a logical partition. Under linux, /dev/hdx[1-4] are primary partitions, and /dev/hdx[n>4] are logical partitions, which automatically reside in an extended partition. I think, if you use logical partitions you can't use /dev/hdx4, and are limited to three primary partitions.

Using cfdisk, you just specify the partition size in bytes and don't worry about cylinders and all that stuff. To make a logical partition, just make a partition with number larger than (or equal to) 5.
 
Old 03-31-2006, 04:35 AM   #3
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Actually fdisk allows you to set partition sizes in MB as well. When fdisk asks you for the ending cylinder, just type +XXXXM to set the size in MB.
 
Old 03-31-2006, 06:04 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Actually, it isn't MB if you say +.M It's disk-drive manufacturers' megabytes = 1 million bytes, not 1024x1024 bytes like everyone else in the world thinks. That way they get to rip you off a few billion bytes on a "40G" hard drive.

To answer the original question, when you do fdisk -l it tells you the size of your drive based on how it was configured. For example:

Disk /dev/hda: 40.0 GB, 40000776920 bytes (see what I mean, this is NOT 40 GB!!!)
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

So your answer is 1M / 8225280 = number of cylinders per "manufacturer's megabyte" since each cylinder has 8225280 bytes.

A better way, using the suggestions above is to remember that real megabytes are approx. equal to 1024 "manufacturer's megabytes." So you can just say +1024M for 1G, +2048M for 2G, etc.

Last edited by Randux; 04-01-2006 at 11:36 AM.
 
Old 03-31-2006, 11:43 AM   #5
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Quote:
Originally Posted by Randux
It's disk-drive manufacturers' megabytes = 1 million bytes, not 1024x1024x1024
Actually 1 megabyte is 1024 kilobytes, where 1 kilobyte is 1024 bytes. So 1 megabyte is 1024*1024 bytes.
Quote:
Originally Posted by Randux
Disk /dev/hda: 40.0 GB, 4000776920 bytes (see what I mean, this is NOT 40 GB!!!)
Yeap. You only have 4GB drive. You missed one number, because if you have 40GB drive, that is 40,000,000,000 bytes. There are 11 numbers not 10.

I don't know if all the cylinders have the same size (because the tracks which they consist of are different length). So I don't know if the size of cylinder could be counted. I guess that cylinders which are nearer the center of the hard disk circle are smaller than the outer ones. Maybe somebody could clarify this to me?

Last edited by Alien_Hominid; 03-31-2006 at 11:45 AM.
 
Old 03-31-2006, 12:53 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Quote:
Originally Posted by cor67393
Why do you want to use both fdisk and cfdisk?
I suggest sticking with cfdisk, and so does the manpage of fdisk .

With cfdisk, to make an extended partition, just make a logical partition. Under linux, /dev/hdx[1-4] are primary partitions, and /dev/hdx[n>4] are logical partitions, which automatically reside in an extended partition. I think, if you use logical partitions you can't use /dev/hdx4, and are limited to three primary partitions.

Using cfdisk, you just specify the partition size in bytes and don't worry about cylinders and all that stuff. To make a logical partition, just make a partition with number larger than (or equal to) 5.
Hi,

As for your description about the extended partition requirement for /dev/hdx4 is not correct! You can create an extended partition for any device assignment, be it for /dev/hdx1, /dev/hdx2, /devhdx3 or /dev/hdx4.

If you make /dev/hdx3 the extended partition then the first logical will be /dev/hdx5. With space allocation for each desired logical up to the amount of the extended space.

HTH!
 
Old 03-31-2006, 01:21 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Cylinders don't stand for any particular size. Usually a drive can be set up with more than one cylinder, head and sector geometries.
 
Old 04-01-2006, 11:38 AM   #8
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Cool

Quote:
Originally Posted by Alien_Hominid
Actually 1 megabyte is 1024 kilobytes, where 1 kilobyte is 1024 bytes. So 1 megabyte is 1024*1024 bytes.

Yeap. You only have 4GB drive. You missed one number, because if you have 40GB drive, that is 40,000,000,000 bytes. There are 11 numbers not 10.

I don't know if all the cylinders have the same size (because the tracks which they consist of are different length). So I don't know if the size of cylinder could be counted. I guess that cylinders which are nearer the center of the hard disk circle are smaller than the outer ones. Maybe somebody could clarify this to me?
Couple of typos- so sue me
 
Old 04-01-2006, 11:47 AM   #9
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
I have only noticed this because hdd architecture is rather interesting thing for me (I don't know much about it) so I have analyzed your post and saw some minor typos. I have revealed them that they wouldn't confuse the newbies.

Last edited by Alien_Hominid; 04-01-2006 at 11:49 AM.
 
Old 04-01-2006, 11:53 AM   #10
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
I'm glad somebody read it! In answer to your question, I think all cylinders and tracks contain the same number of bytes by definition. Otherwise nobody could plan allocation. I'm not sure how it works because as you mention, rotational speed is different on various parts of the platter. This is a very old problem (disks have been around for 40 years?) and I'm sure they have elegant solutions by now. Maybe the sectors have different sizes in different parts of the platter.
 
Old 04-01-2006, 12:06 PM   #11
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
I think that sectors can't have different sizes otherwise you wouldn't know the way how to adress them.
Quote:
Originally Posted by http://en.wikipedia.org/wiki/Cylinder-head-sector
Cylinder-head-sector, also known as CHS, is a method of addressing data on a hard drive.

Every hard drive consists of platters and read-write heads. If a drive has four platters, it has eight read-write heads, one on each side of each platter. The head value is the number of read-write heads in the drive.

Each platter is divided into tracks. The cylinder value is the number of tracks on one side of each platter. There are the same number of cylinders on each side of each platter. The sector value is the number of sectors in each cylinder (or track), each sector consisting of (normally) 512 bytes.

Older hard drives, such as MFM and RLL drives, divided each cylinder into an equal number of sectors and the CHS values matched the physical makeup of the drive. A drive with a CHS value of 500 x 4 x 32 would have 500 tracks per side of each platter, two platters, and 32 sectors per cylinder, with a total of 32,768,000 bytes (about 31 megabytes). Most modern drives have a surplus space that doesn't make a cylinder boundary. Each partition should always start and end at a cylinder boundary. Only some of the most modern operating systems may disregard this rule, but this can cause some compatibility problems, especially if the user wants to boots up to more than one OS on the same drive.

IDE drives have replaced the MFM and RLL drives, and are much more efficient at storing data. They use Zone Bit Recording (ZBR), where the number of sectors in a cylinder varies with its location on the drive. Cylinders nearer to the edge of the platter contain more sectors than cylinders near the spindle because there is more space in a given track near the edge of the platter. The CHS addressing system does not work on these drives because of the varying number of sectors per cylinder. An IDE drive can be configured in system BIOS with any configuration of cylinders, heads, and sectors that does not exceed the capacity of the drive. The drive converts the given CHS address into the actual address for the specific hardware configuration.
So as you see the size of sector is the same, only there are a different number of sectors in each track.
 
Old 04-01-2006, 03:57 PM   #12
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
This explanation doesn't sound reasonable either- the geometry is included in the fdisk output. It shows the number of sectors/track as a fixed number!
 
Old 04-01-2006, 11:55 PM   #13
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
It only show's that for compatibility with software purposes (make CHS addressing possible). Do you really think that my:
Code:
 Disk /dev/sda: 120.0 GB, 120030944768 bytes
255 heads, 63 sectors/track, 14592 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
has 255 heads? So there would be around 123 platters. In reality there are 3.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cylinders, heads and spt-command? kpachopoulos Linux - General 1 07-05-2005 02:52 PM
netgear FA310TX only transfers data at 1.2 Megabyte/sec niverson Fedora 14 03-29-2004 11:40 PM
Boot partition after 1024 cylinders concoran Linux - General 5 10-19-2001 02:21 PM
Boot sector > 1024 cylinders amitrgholap Linux - Software 2 09-28-2001 12:41 PM
Boot sector > 1024 cylinders amitrgholap Linux - Newbie 1 09-28-2001 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration