码迷,mamicode.com
首页 > 系统相关 > 详细

Linux的磁盘分区

时间:2014-07-13 19:39:31      阅读:344      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   strong   文件   os   

磁道:track

扇区:sector

磁头:head

柱面:cylinder

 

  • 每个扇区,512字节

  • 每个磁道划分为63个扇区

  • 逻辑磁头(盘面)数设为255

  •   一个柱面的大小

  •   =255 * 63 * 512 = 8M

  • 硬盘或分区的容量

  • =柱面大小 * 柱面数

[root@localhost ~]# fdisk -l ###fdisk查看磁盘列表 fdisk -l /dev/sdb 单独查看一块磁盘

Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26         156     1052257+  82  Linux swap / Solaris
/dev/sda3             157        5221    40684612+  83  Linux

Disk /dev/sdb: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesnt contain a valid partition table

 划分新的磁盘

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
   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 partitions system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

常用的划分参数:n 增加新的分区 t 修改存在分区 w 保存退出 q 不保存退出 

按照提示进行划分,分区大小直接 +xG 

划分结束后:partprobe /dev/sdb 识别新的分区表

[root@localhost ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1217     9775521   83  Linux
/dev/sdb2            1218        2434     9775552+  83  Linux
/dev/sdb3            2435        5221    22386577+   5  Extended
/dev/sdb5            2435        2557      987966   82  Linux swap / Solaris
/dev/sdb6            2558        3166     4891761    b  W95 FAT32

 格式化分区

mkfs make filesystem  mkfs -t ext3/vfat /dev/sdb1

通过ls /sbin/mkfs* 可以查看可以格式化的文件类型

挂载分区

mount /dev/sdb1 /mnt/part1  

umount /dev/sdb1  umount /mnt/part1

 

Linux的磁盘分区,布布扣,bubuko.com

Linux的磁盘分区

标签:style   blog   color   strong   文件   os   

原文地址:http://www.cnblogs.com/yimiao/p/3841084.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!