fdisk -l   查看分区状况,也可查看指定分区

Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0009ec81

Device Boot      Start         End      Blocks   Id  System /dev/sda1   *           1          13      102400   83  Linux Partition 1 does not end on cylinder boundary. /dev/sda2              13         274     2097152   82  Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3             274        2611    18770944   83  Linux

///////////////////////////////////////////////////////////////////////////////////////////////

添加虚拟磁盘

#init 0

编辑虚拟机设置 - 添加 - 硬盘 -下一步 - scsi - 创建新的虚拟磁盘 - 磁盘大小10G - 将虚拟磁盘存储为单个文件 - 完成 - 确定 - 开机。

///////////////////////////////////////////////////////////////////////////////////////////////////////

给虚拟磁盘分区

#fdisk -l

两个磁盘 给新的磁盘分区

#fdisk /dev/sdb

磁盘大小大于两个T,使用parted /dev/sdb   m 查看可使用的指令   p 打印当前分区列表

n 创建新的分区

选择不同的分区类型 e是扩展分区    p是主分区

Command (m for help): n
Command action
   e   extended
   p   primary pa

p

Partition number (1-4): 1 First cylinder (1-1305, default 1): 1 Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): +2G

//////////////////////////////////////////////////////////////////////////////////////////

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfae59dbe

Device Boot      Start         End      Blocks         Id     System

/dev/sdb1               1         262     2104483+  83      Linux

/////////////////////////////////////////////////////////////////////////////////////////////

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 2
First cylinder (263-1305, default 263):
Using default value 263
Last cylinder, +cylinders or +size{K,M,G} (263-1305, default 1305): +5G

//////////////////////////////////////////////////////////////////////////////////////////////

Device Boot      Start         End      Blocks        Id  System

/dev/sdb1               1         262        2104483+  83  Linux

/dev/sdb2             263         916       5253255    5    Extended

////////////////////////////

Command (m for help): n

Command action

l   logical (5 or over)

p   primary partition (1-4)

l

First cylinder (263-916, default 263):

Using default value 263 Last cylinder, +cylinders or +size{K,M,G} (263-916, default 916): +2G

//////////////////////////////////////////////////////////////////////////////////

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfae59dbe

Device Boot      Start         End      Blocks       Id  System

/dev/sdb1               1          262     2104483+  83  Linux

/dev/sdb2             263         916     5253255    5    Extended

/dev/sdb5             263         524     2104483+  83  Linux

///////////////////////////////////////////////////////////////////////

wq保存退出

linux命令-fdisk分区的更多相关文章

  1. linux 使用fdisk分区扩容

    标签:fdisk分区 概述 我们管理的服务器可能会随着业务量的不断增长造成磁盘空间不足的情况,在这个时候我们就需要增加磁盘空间,本章主要介绍如何使用fdisk分区工具创建磁盘分区和挂载分区,介绍两种情 ...

  2. Linux系统fdisk分区

    以下操作全部基于win7 64位系统上的Linux虚拟机(CentOS6.6). 当Linux虚拟机的硬盘空间不够用时,可以手动添加硬盘块,流程如下: 右键虚拟机,点击“Add”按钮: 选择“Hard ...

  3. Linux虚拟机fdisk分区

    以下操作全部基于win7 64位系统上的Linux虚拟机(CentOS6.6). 当Linux虚拟机的硬盘空间不够用时,可以手动添加硬盘块,流程如下: 右键虚拟机,点击“Add”按钮: 选择“Hard ...

  4. Linux中fdisk分区

    一.硬盘接口    从整体的角度上,硬盘接口分为IDE.SATA.SCSI和SAS四种,IDE接口硬盘多用于家用产品中,也部分应用于服务器,SCSI接口的硬盘则主要应用于服务器市场,而SAS只在高端服 ...

  5. linux 使用fdisk分区扩容,看介绍命令(未完)

    https://www.cnblogs.com/chenmh/p/5096592.html LVM 逻辑磁盘的一些命令 http://man.linuxde.net/vgcreate

  6. linux下fdisk分区管理、文件系统管理、挂载文件系统等

    分区管理工具有:fdisk, parted, sfdisk fdisk:对于一块硬盘来讲,最多只能管理15分区: # fdisk -l [-u] [device...]  查看硬盘设备分区信息 # f ...

  7. Linux学习 - fdisk分区

    一.fdisk命令分区过程 系统一旦重启,分区将消失 1 添加新硬盘 直接在虚拟机上添加 2 查看新硬盘 fdisk -l 3 分区 fdisk /dev/sdb fdisk进入/dev/sdb硬件设 ...

  8. 为什么Linux的fdisk分区时第一块磁盘分区的First Sector是2048?

    这个问题曾经困扰我很久,在了解了MBR之后,我曾认为第一块分区之前为一个block.但是用fdisk查看是2048,一直不了解其中的缘由,今天查了一下资料,大概了解了,其中的细节留着慢慢去了解. 最直 ...

  9. Linux fdisk命令参数及用法详解---Linux磁盘分区管理命令fdisk

    fdisk 命令 linux磁盘分区管理 用途:观察硬盘之实体使用情形与分割硬盘用. 使用方法: 一.在 console 上输入 fdisk -l /dev/sda ,观察硬盘之实体使用情形. 二.在 ...

随机推荐

  1. java连接SQL数据库(JDBC)相关设置

    2016-06-14 一.SQL server中的相关设置(以sql server 2012 版本为例) 建立一个SQL server 身份认证的服务器登录名 首先启动SQL客户端,以windows身 ...

  2. CSDN_博客__WapPc

    CSDN 博客  手机上的网址 和 PC上的网址,对应关系: 1. 举个例子: 手机上的网址: http://m.blog.csdn.net/article/details?id=7910239 PC ...

  3. cern-cloud-architecture

    规模: 总体: 有26个Cell 一个数据中心运行控制节点,另外一个仅仅运行nova cell 统一,灵活 nova-api运行在VM中,当然需要至少一个部署在物理机上来启动VM. 每个cell只有一 ...

  4. JavaScript 正则表达收集整理

    JavaScript 正则表达收集整理 //可为空 /^\s*$/ //密码验证,必须且只含有数字和字母,可以拥有英文符号,6-17位 /(?=.{,})(?=.*\d)(?=.*[a-z])[\x2 ...

  5. R语言入门基础

    教程:常用运算函数.对一般数据进行运算的常用函数: 1.round() #四舍五入 例:x <- c(3.1416, 15.377, 269.7) round(x, 0) #保留整数位 roun ...

  6. PHP中preg_match正则匹配的/u /i /s是什么意思

    /u 表示按unicode(utf-8)匹配(主要针对多字节比如汉字) /i 表示不区分大小写(如果表达式里面有 a, 那么 A 也是匹配对象) /s 表示将字符串视为单行来匹配

  7. PostMan使用教程(1)

    Postman介绍 Postman是google开发的一款功能强大的网页调试与发送网页HTTP请求,并能运行测试用例的的Chrome插件.其主要功能包括: 模拟各种HTTP requests 从常用的 ...

  8. poj2778 ac自动机+矩阵快速幂

    给m个子串,求长度为n的不包含子串的母串数,最直接的应该是暴搜,肯定tle,考虑用ac自动机 将子串建成字典树,通过next表来构造矩阵,然后用矩阵快速幂求长度为n的数量 邻接矩阵https://we ...

  9. 《Effective C++》——条款08:别让异常逃离析构函数

    考虑如下代码: class Widget{ public: ... ~Widget(){...}//假设这个可能吐出一个异常 }; void doSomething() { std::vector&l ...

  10. checking for event2/thread.h... no libevent_pthreads required, failing

    /********************************************************************************** * checking for e ...