Chinaunix首页 | 论坛 | 博客
  • 博客访问: 159236
  • 博文数量: 34
  • 博客积分: 2070
  • 博客等级: 大尉
  • 技术积分: 277
  • 用 户 组: 普通用户
  • 注册时间: 2010-02-26 19:29
文章分类
文章存档

2015年(2)

2014年(4)

2013年(1)

2012年(1)

2011年(5)

2010年(21)

我的朋友

分类: 服务器与存储

2010-07-08 15:24:44

HDIO_GETGEO
Returns the BIOS disk parameters in the following structure:
struct hd_geometry {
    unsigned char  heads;
    unsigned char  sectors;
    unsigned short cylinders;
    unsigned long  start;
};

A pointer to this structure is passed as the (2) parameter.

The information returned in the parameter is the disk geometry of the drive as understood by DOS! This geometry is not the physical geometry of the drive. It is used when constructing the drive's partition table, however, and is needed for convenient operation of (1), (1), and (1). If the geometry information is not available, zero will be returned for all of the parameters.

BLKGETSIZE
Returns the device size in sectors. The (2) parameter should be a pointer to a long.

On Mon, May 22, 2000 at 04:47:16PM +0100, David Woodhouse wrote:

>  said:
> > > What if BLKGETSIZE/(H*S) isn't an integer?
> > / is the C operator. It rounds down. 
> 
> Sorry, what I meant to say was:
> 
> What if (BLKGETSIZE / (H*S)) * (H*S) != BLKGETSIZE?
> 
> Is there anything that's likely to get confused by that?

No. It happens all the time:

# hdparm -g /dev/hda
 geometry     = 2100/255/63, sectors = 33750864, start = 0

and 2100*255*63 = 33736500 < 33750864.
It just means that if you use an fdisk that likes partitions
to start and end on cylinder boundaries, the last partial
cylinder is wasted. In this case that would be 7 MB.
阅读(10326) | 评论(0) | 转发(0) |
0

上一篇:块设备读写流程

下一篇:硬盘知识

给主人留下些什么吧!~~