Setting the Proper Geometry


Forum: Other Help Topics
Topic: Setting the Proper Geometry
started by: satimis

Posted by satimis on April 05 2006,14:09
Hi folks,

I went thourgh following URL;
< http://www.damnsmalllinux.org/wiki....endrive >

and got following points unresolved.

I have a 512MB pendrive without partitions.

# sfdisk -l /dev/sda
Code Sample

Disk /dev/sda: 1008 cylinders, 16 heads, 61 sectors/track
Units = cylinders of 499712 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0       -       0          0    0  Empty
/dev/sda2          0       -       0          0    0  Empty
/dev/sda3          0       -       0          0    0  Empty
/dev/sda4          0       -       0          0    0  Empty


Step 2)
According to his formula.

Total number of sectors on the drive = cylinder x heads x sectors
total_sectors = 1008x16x61=983,808

no_of_cylinders = total_sectors / 32 / number_of_heads
no_of_cylinder = 983,808/32/16 = 1,921.5

A sector = 512 bytes
Total number of sectors on boot partition = 64 millon / 512
total_sectors_on_boot_partition = 64 x 1,000,000 / 512 = 125,000

What will be the use of his calculation, the above figures?

Step 3)
# sfdisk -f -Cnumcyl -Hnumheads -Snumsectors /dev/sda
Code Sample

/dev/sda1/ :    

What shall I enter/type ?

TIA

B.R.
satimis

Posted by anaconda on April 06 2006,11:08
Well..
First of all write the old C/H/S on a piece of paper, so that you can change those back if you can't get it to work.

If I understood correctly: Your problem is than the number of cylinders isn't a whole number. ie. you got 1921,5 cylinders. That is not a problem. because you can always make the USB-stick smaller than what it was.(newer bigger)

Just use 1921 Cylinders.. You will lose ~1-2MB.

If the USB-stick was mine, I would make only 1 partition and use USB-HDD installation of DSL
960x32x32 (=983040)
Then if I needed more room to the USB-stick I could just delete /KNOPPIX temporarily and free the 50MB....

But if you want to make USB-ZIP installation then you should use
1921x16x32 (=983552)
~64MB sda1:
sda1  0  244 6 *
and the rest to sda2:
sda2 245 1921

Here the first partition has 244 cyls which is less than 1024

Posted by satimis on April 06 2006,13:46
Hi anaconda,

Tks for your advice.

Quote
Just use 1921 Cylinders.. You will lose ~1-2MB.
How to arrive lose ~1-2MB?  What formula to be used to calculate it?

Quote
If the USB-stick was mine, I would make only 1 partition and use USB-HDD installation of DSL
960x32x32 (=983040)
It is also my wish.  In the past I tried many times to get my pendrive booted with option "USB-HDD" without success.  Then I have only one solution i.e. formatting the pendrive in zip geometry.  What is the trick behind?

What is "960x32x32 (=983040)"?  How to arrive to this forumla?

960 = no_of_cylinders ?
32 = head ?
32 = sectors ?

Why need such figures ?

Please advise.  TIA

Quote
But if you want to make USB-ZIP installation then you should use
1921x16x32 (=983552)
~64MB sda1:
sda1  0  244 6 *
and the rest to sda2:
sda2 245 1921
1921 ~=1921.5
16 = heads ?
32 = sectors ?

Why need 32 sector?

Whether to run;

# sfdisk -f -Cnumcyl -Hnumheads -Snumsectors /dev/sda

substituting;
-Cnumcyl with "-1921"

-Hnumheads with "-16"

-Snumsectors with "-32"

Then /dev/sda1 will be created with output "sda1  0  244 6 *" displayed.

afterwards how to create /dev/sda2 with result "sda2 245 1921" displayed

Pls advise.  TIA

B.R.
satimis

Posted by anaconda on April 06 2006,14:39
Quote
What is "960x32x32 (=983040)"?  How to arrive to this forumla?

960 = no_of_cylinders ?
32 = head ?
32 = sectors ?

Why need such figures ?


Yes. 960 cyls 32 heads 32 sectors. Because you have to have 32 sectors and the first partition (booting) should be 1024 cylinders or less..
You could just as well have 1024 Cyls 30 Heads and 32 sectors. (which would total also 983040)

Quote
1921 ~=1921.5
16 = heads ?
32 = sectors ?

Why need 32 sector?

Yes. that is what I meant. 1921 cyls 16 heads and 32 sectors.
And I dont know why 32 sectors is needed, but that is what reads in the page.
< http://www.damnsmalllinux.org/wiki....endrive >
And if you have problems with your usb-stick you should do as they recommend there.

I had to change the geometry in one of my usb-sticks and after the change it worked. On the other hand I have 1 usb-stick which has 61 sectors and it works just fine with it..


Quote

# sfdisk -f -Cnumcyl -Hnumheads -Snumsectors /dev/sda

substituting;
-Cnumcyl with "-1921"

-Hnumheads with "-16"

-Snumsectors with "-32"

Then /dev/sda1 will be created with output "sda1  0  244 6 *" displayed.

sfdisk -f -C1921 -H16 -S32 /dev/sda
and then
sda1:0 244 6 *
and then you just press a couple of times enter and the rest is allocated to sda2..


Quote
How to arrive lose ~1-2MB?  What formula to be used to calculate it?

didn't use any formula. it is just a rough estimate. Just to say that your usb-stick will be a little smaller..

Posted by satimis on April 07 2006,08:34
[quote=anaconda,April 06 2006,10:39][/quote]
Hi anaconda,

Tks for your explanation.

Quote
sfdisk -f -C1921 -H16 -S32 /dev/sda
and then
sda1:0 244 6 *
and then you just press a couple of times enter and the rest is allocated to sda2..

1) How to get the figure 244 which I suppose is the number_of_cylinder.  What will be the size of /dev/sda1
2) on /dev/sda2
/dev/sda2: 245 "number_of_cylinder" ext2
- If I need 300MB then what will be the number_of_cylinder and how to get it
- whether putting "ext2" there if I need its FS being ext2.  ext3 there for ext3 FS and so on.

Afterwards run
mkfs.msdos /dev/sda1
mkfs -t ext2 /dev/sda2

Please advise.  TIA

B.R.
satimis

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.