Linux下分区详解之--Fdisk


1、            通过Fdisk查看系统分区详细信息:

Fdisk –l   详解:

[root@ www.bkjia.com ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280bytes

注释:这个硬盘的大小是10.7GB,有255个磁面,63个扇区,1305磁柱(cylinders)

每个cylinder(磁柱)的容量是 8225280 bytes=8225.280 K(约为)=8.225280M(约为);

  Device Boot      Start         End      Blocks  Id  System

/dev/sda1  *           1          13      104391  83  Linux

/dev/sda2              14        1305   10377990   8e  Linux LVM

 

idSystem 表示的是一个意思,id看起来不太直观,我们要在fdisk 一个分区时,通过指定id来确认分区类型;比如 7表示的就NTFS 分区;这个在fdisk 中要通过t功能来指定。下面的部分会提到;

 

Disk /dev/sdb: 21.4 GB,21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280bytes

 

Disk /dev/sdb doesn't contain a validpartition table

说明:硬盘分区的表示:在Linux 是通过hd*x sd*x 表示的:

其中* 表示的是abc ... ...

另外x 表示的数字 123 ... ...

hd大多是IDE硬盘;sd大多是SCSI或移动存储;引导(Boot):表示引导分区,在上面的例子中sda1 是引导分区;

Start (开始):表示的一个分区从Xcylinder(磁柱)开始;

End (结束):表示一个分区到 Ycylinder(磁柱)结束;

 

2、            学会使用fdisk帮助功能:

[root@ www.bkjia.com~]# fdisk /dev/sda

 

Thenumber of cylinders for this disk is set to 1305.

There isnothing wrong with that, but this is larger than 1024,

and couldin certain setups cause problems with:

1) softwarethat runs at boot time (e.g., old versions of LILO)

2)booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command(m for help): m      ---输出帮助信息

Commandaction

   a  toggle a bootable flag  ---设置启动分区

   b  edit bsd disklabel      ---编辑分区标签

   c  toggle the dos compatibility flag

   d  delete a partition        --删除一个分区

   l  list known partition types  --列出分区类型

   m  print this menu         --帮助

   n  add a new partition      --建立一个新的分区

   o  create a new empty DOS partition table  --创建一个新的空白DOS分区表

   p  print the partition table               ---打印分区表

   q  quit without saving changes           ---退出不保存设置

   s   createa new empty Sun disklabel        ---

   t   changea partition's system id          ---改变分区的ID

   u   changedisplay/entry units            ---改变显示的单位

   v   verifythe partition table              ---检查验证分区表

   w  write table to disk and exit            ---保存分区表

   x  extra functionality (experts only)

 

Command (m for help):

  • 1
  • 2
  • 3
  • 4
  • 5
  • 下一页

相关内容