揮発性のメモ2

http://d.hatena.ne.jp/iww/

シリンダ数、ヘッド数、セクター数を調べる方法

fdisk を使って調べることが可能

# fdisk -lu /dev/sda
Disk /dev/sda: 64 MB, 64225280 bytes
8 heads, 32 sectors/track, 490 cylinders
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          32       62463       31216   83  Linux
/dev/sda2           62464      125439       31488   83  Linux

CHSの書き換えについて

シリンダ数、ヘッド数、セクタ数は cfdisk の中で g を押せば変更が可能。

dd などでMBRをゼロクリアしても、シリンダ数とヘッド数が適当な値に変更されてしまう。
したがって、同じ大きさのつもりでパーティションを作成してもパーティションサイズは微妙に変わる。

# dd if=/dev/zero of=/dev/sda count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.5479e-05 seconds, 14.4 MB/s

# cfdisk /dev/sda
# fdisk -lu /dev/sda
Disk /dev/sda: 64 MB, 64225280 bytes
2 heads, 62 sectors/track, 1011 cylinders
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              62       62495       31217   83  Linux
/dev/sda2           62496      125363       31434   83  Linux