码迷,mamicode.com
首页 > 其他好文 > 详细

磁盘分区

时间:2017-03-25 00:47:52      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:rank   action   table   roo   quit   menu   bsp   style   empty   

将一块磁盘分区,大体分为三个步骤:1. D盘;2. 分区;3. 格式化。

下面以一个U盘为例,演示过程:

1. D盘

  a. 一般插入U盘,可能会自动挂载,那么,需要手动解挂

  df -h 查看挂载点,然后解挂。如下图所示:

   技术分享

  b. 确定磁盘之前是否已经分过区

    fdisk -l 查看系统分区表---list partition table(s)

    从下图中可以看出,/dev/sdb之前分过区。

    技术分享

   c. d盘

    dd if=/dev/zero of=/dev/sdb   bs=1024  count=10240

    一般将前512字节的MBR信息删除后,该盘就没有分区信息了。

    技术分享

 2. 分区

    [root@frank ~]# fdisk /dev/sdb

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 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)

a. 通过fdisk的n指令来新建一个分区

磁盘分区

标签:rank   action   table   roo   quit   menu   bsp   style   empty   

原文地址:http://www.cnblogs.com/black-mamba/p/6614046.html

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