磁盘管理

硬盘
CHS结构体系的硬盘
磁头:Heads
柱面:Cylinders
扇区:Sector 每个扇区存储512字节 (512B)
现在硬盘都采用ZBR技术:
ZBR(Zoned Bit Recording)区位记录
操作系统读取硬盘的时候,不会一个个扇区地读区,这样效率太低,而是一次性连续读取多个扇区,即一次性读取一个"块"(block)。这种由多个扇区组成的"块",是文件存取的最小单位。"块"的大小,最常见的是1KB,即连2个sector组成一个block。4K=8(扇区)sector
查看系统块大小
[root@localhost ~]# xfs_growfs -l /dev/sda3 |grep --color size  (XFS文件系统查看明亮)
log size unchanged, skipping
meta-data=/dev/sda3              isize=256    agcount=4, agsize=3656896 blks
data     =                       bsize=4096   blocks=14627584, imaxpct=25
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=7142, version=2
[root@localhost ~]# tune2fs -l /dev/sda3  | grep --color size  (ext4文件系统查看命令)

磁盘管理
MBR:Master boot record 主引导记录
硬盘的0柱面、0磁头、第一个扇区称为主引导记录(MBR)它由三个部分组成,主引导程序、硬盘分区表DPT(disk partition table)和分区有效标志(55AA)。
在总共512字节的主引导记录里主引导程序(boot loader)占446字节,分区表DPT占用64字节16*4=64,magic number占2个字节固定为55AA
分区
添加磁盘步骤
添加设备  分区  格式化(创建文件系统) 「起名」修改配置文件  创建挂载点  挂载

fdisk
fdisk -l  #查看磁盘信息
[root@localhost ~]# fdisk /dev/sdb     #创建&管理分区
命令(输入 m 获取帮助):m
命令操作
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   e   扩展分区
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition新建
   o   create a new empty DOS partition table
   p   print the partition table打印分区表
   q   quit without saving changes推出
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit保存
   x   extra functionality (experts only)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章