SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
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.
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.
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.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
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?
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.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
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.
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.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.