LINUX-存储设备的管理

1.设备的查看
 1)发现系统中的设备
  fdisk 是用于管理磁盘分区的应用程序
  fdisk -l      ##查看系统中真实存在的设备
    
  cat /proc/partitions  ##查看年系统中被系统识别的设备
    
 2)系统发现的,被系统利用的,有id信息的
  blink     ##查看设备的id信息
    
 3)发现并且在挂载的设备
  df -h
  df -H
    

2.设备名称的读取
 /dev/sda s=sata d=disk a=a   ##第一块sata硬盘
 /dev/sda1  ##第一块sata硬盘第一个分区
 /dev/vda   ##虚拟化硬盘
 /dev/cdrom ##光驱

3.设备分区信息
 1)mbr主引导记录446个字节
 2)mpt主分区表64个字节
 3)硬盘的有效性标识"55aa"2个字节
 4)一个主分区占用16个字节记录分区信息
 5)一块硬盘上如果用mbr的分区方式最多可以存在4个主分区
 6)mbr分区方式主分区和扩展分区最多16个(可用)
 7)gpt分区128个

4.分区的划分
 [root@localhost ~]#fdisk /dev/vdb
 elcome to fdisk (util-linux2.23.2).

 Changes will remain in memory only,until you decide to write them.
 Be careful before using the writecommand.


 Command (m for help): m           ##帮助
 Command action
   a  toggle a bootable flag
   b  edit bsd disklabel
   c  toggle the dos compatibility flag
   d  delete a partition      ##删除分区
   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   ##修改分区功能id
   u  change display/entry units
   v  verify the partition table
   w  write table to disk and exit ##保存更改到分区表中
   x  extra functionality (experts only)
 Command (m for help): n           ##新建分区
 Partition type:
   p  primary (0 primary, 0 extended, 4 free)  ##分区类型位主分区
   e  extended                ##分区类型位扩展分区
 Select (default p):               ##默认位主分区
 Using default response p
 Partition number (1-4, default 1): 1       ##主分区id
 First sector (2048-20971519, default2048):    ##此分区起始位置 (一般选择默认)
 Using default value 2048
 Last sector, +sectors or +size{K,M,G}(2048-20971519, default 20971519): +100M    ##分区大小
 Partition 1 of type Linux and of size100 MiB is set
 Command (m for help): p

 Disk /dev/vdb: 10.7 GB, 10737418240bytes, 20971520 sectors
 Units = sectors of 1 * 512 = 512bytes
 Sector size (logical/physical): 512bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes /512 bytes
 Disk label type: dos
 Disk identifier: 0x193488c3

 Device Boot      Start         End      Blocks  Id  System
 /dev/vdb1         2048      206847      102400  83  Linux

 Command (m for help): wq       ##保存推出,如果安q表示放弃更改退出
    

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值