[opensuse] how to define partition size in sectors?
Hello: I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors. How could I define the partitions' sizes in sectors? (I want to clone data from other partition and I want the new partition to have exactly the same size as the old one.) Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 19 March 2010 10:19:34 am Istvan Gabor wrote:
Hello:
I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors. How could I define the partitions' sizes in sectors? (I want to clone data from other partition and I want the new partition to have exactly the same size as the old one.)
Have you looked at sfdisk? That claims it can work in sectors. The man page also claims that it is "very dangerous" to use to repartition a device but as you have a new disk this may be a risk you are willing to take? -- Don -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2010. március 19. 17:37 napon Don Raboud <don.raboud@ualberta.ca> írta:
On Friday 19 March 2010 10:19:34 am Istvan Gabor wrote:
Hello:
I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors. How could I define the partitions' sizes in sectors? (I want to clone data from other partition and I want the new partition to have exactly the same size as the old one.)
Have you looked at sfdisk? That claims it can work in sectors. The man page also claims that it is "very dangerous" to use to repartition a device but as you have a new disk this may be a risk you are willing to take?
Yes, I saved my previous partition table with sfdisk. But my partitoin table on the new drive won't be the same as the old one, as it is a bigger drive. In the meantime I've learned that in fdisk I can use sectors as size. Thank you, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/19 17:19 (GMT+0100) Istvan Gabor composed:
I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors. How could I define the partitions' sizes in sectors? (I want to clone data from other partition and I want the new partition to have exactly the same size as the old one.)
Making identically sized partitions with legacy partitioning software is actually quite easy, without trying to define anything in sectors, as long as you know the constraints imposed in so doing. Most modern HDs under legacy partitioning have more than 1024 logical cylinders, so most of the partitioning tools' partition definitions will include a logical "sector" count of 63, and a logical "head" count of either 255 or 240. These result in standard cylinder sizes of either just over 8G or just under 8G, depending on whether 255 or 240. Any given PC BIOS will usually prefer either 255 (more common) or 240 (less common), so if you have an existing HD and want to "clone" either the whole disk or individual partitions, odds are quite high each will be assigned the same "head" count. The result of this is there is one single multiple common to all possible partition sizes. If e.g. you ask for a partition of 5000M or 5001M or 4999M or 5003M, what you'll get is a size of 5004.6M, because of rounding to the next larger multiple of a logical "cylinder". And, 5004.6M will always be comprised of the same number of sectors: 0x9c64bf. There is a limitation that can cause the available sector count to differ by the number of sectors in a single logical "track". A primary partition that begins at the start of a disk will have one less available "track" than any other primary partition of "same" size, and thus fewer sectors. All logical partitions also lose a track compared to non-frontal primaries, and so if a logical is the "same" size as a frontal primary, it will have the same number of sectors. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2010. március 19. 18:08 napon Felix Miata <mrmazda@earthlink.net> írta:
On 2010/03/19 17:19 (GMT+0100) Istvan Gabor composed:
I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors. How could I define the partitions' sizes in sectors? (I want to clone data from other partition and I want the new partition to have exactly the same size as the old one.)
Making identically sized partitions with legacy partitioning software is actually quite easy, without trying to define anything in sectors, as long as you know the constraints imposed in so doing.
Most modern HDs under legacy partitioning have more than 1024 logical cylinders, so most of the partitioning tools' partition definitions will include a logical "sector" count of 63, and a logical "head" count of either 255 or 240. These result in standard cylinder sizes of either just over 8G or just under 8G, depending on whether 255 or 240.
Any given PC BIOS will usually prefer either 255 (more common) or 240 (less common), so if you have an existing HD and want to "clone" either the whole disk or individual partitions, odds are quite high each will be assigned the same "head" count. The result of this is there is one single multiple common to all possible partition sizes.
If e.g. you ask for a partition of 5000M or 5001M or 4999M or 5003M, what you'll get is a size of 5004.6M, because of rounding to the next larger multiple of a logical "cylinder". And, 5004.6M will always be comprised of the same number of sectors: 0x9c64bf.
There is a limitation that can cause the available sector count to differ by the number of sectors in a single logical "track". A primary partition that begins at the start of a disk will have one less available "track" than any other primary partition of "same" size, and thus fewer sectors. All logical partitions also lose a track compared to non-frontal primaries, and so if a logical is the "same" size as a frontal primary, it will have the same number of sectors.
Felix, thank you for the detailed explanation, I am digesting it. (: I did know that the size is rounded, but thought that this rounding is not the same in case of different disks. Thanks again, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/19 20:10 (GMT+0100) Istvan Gabor composed:
Felix, thank you for the detailed explanation, I am digesting it. (: I did know that the size is rounded, but thought that this rounding is not the same in case of different disks.
There's another constraint I forgot to mention. HD manufacturers are in process of converting from the decades long tradition of 512 byte sectors to 4096 byte sectors. So far this only applies to some of the biggest HDs, 2T & up I think. If you've acquired one if these big sector disks, forget about attempting to clone from an old HD. You'll have to separately partition, mkfs, and then file copy, instead of cloning. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2010-03-19 at 17:19 +0100, Istvan Gabor wrote:
I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors.
Fdisk takes tracks or sectors. When you press "n" in sector mode, it says: Command (m for help): n First sector (173196828-976768064, default 173196828): Using default value 173196828 Last sector, +sectors or +size{K,M,G} (173196828-976768064, default 976768064): I just tried, sectors are allowed. And with the "extra functionality" enabled, it prints the size in another way (cyl/hd/sct) - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkujsZ8ACgkQtTMYHG2NR9WO0wCgk0Jp36abKHy3A7Ml/tH20wrP gxkAnjNJN/XwcC6FFAUwIswqf9l/74JD =pUF8 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2010. március 19. 18:17 napon "Carlos E. R." <robin.listas@telefonica.net> írta:
On Friday, 2010-03-19 at 17:19 +0100, Istvan Gabor wrote:
I'd like to create partitions on a new hard drive and would like to give the partitions' sizes in sectors instead of bytes/megabytes/gigabytes. I tried with both cfdisk and fdisk but they take partition size input in megabytes even if units are set to sectors.
Fdisk takes tracks or sectors. When you press "n" in sector mode, it says:
Command (m for help): n First sector (173196828-976768064, default 173196828): Using default value 173196828 Last sector, +sectors or +size{K,M,G} (173196828-976768064, default 976768064):
Oops, you're right. I overlooked this one. Sorry. Thank you, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Content-ID: <alpine.LSU.2.00.1003192044160.20880@nimrodel.valinor> On Friday, 2010-03-19 at 19:59 +0100, Istvan Gabor wrote:
2010. március 19. 18:17 napon "Carlos E. R." <> írta:
Last sector, +sectors or +size{K,M,G} (173196828-976768064, default 976768064):
Oops, you're right. I overlooked this one. Sorry.
However, what Felix has explained may have effect and alter the sizes. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkuj1KoACgkQtTMYHG2NR9VA2QCeJERdPKlFJ4jj9Sbp44RViVRM q7oAnAsVLYHZTlb3dgL/gC1PPTleJvDb =Nm7G -----END PGP SIGNATURE-----
participants (4)
-
Carlos E. R.
-
Don Raboud
-
Felix Miata
-
Istvan Gabor