如果你在Linux系统中格式化磁盘时遇到如下错误,那么表示你正在格式化一个扩展分区。

[root@GETTestLNX06 ~]# mkfs.ext4 /dev/sdb1

 

mke2fs 1.41.12 (17-May-2010)

 

mkfs.ext4: inode_size (128) * inodes_count (0) too big for a

 

filesystem with 0 blocks, specify higher inode_ratio (-i)

 

or lower inode count (-N).

 

直接格式化扩展分区是不允许的,只能格式化主分区和逻辑分区。那么那么应该如何格式化一个扩展分区呢,我们要么删除该扩展分区,创建一个主分区;要么在扩展分区上创建逻辑分区,如下操作所示

1: 创建逻辑分区

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

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

Command (m for help): p

 

Disk /dev/sdb: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 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: 0xd61351c9

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       13054   104856223+   5  Extended

 

Command (m for help): n

Command action

   l   logical (5 or over)

   p   primary partition (1-4)

l

First cylinder (1-13054, default 1): 1

Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054): 

Using default value 13054

 

Command (m for help): p

 

Disk /dev/sdb: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 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: 0xd61351c9

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       13054   104856223+   5  Extended

/dev/sdb5               1       13054   104856192   83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

2:格式化逻辑分区

[root@GETTestLNX06 ~]# mkfs.ext4 /dev/sdb5

mke2fs 1.41.12 (17-May-2010)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

6553600 inodes, 26214048 blocks

1310702 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

800 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks: 

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 

        4096000, 7962624, 11239424, 20480000, 23887872

 

Writing inode tables: done                            

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 28 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

3:将挂载信息写入配置文件

编辑[root@GETTestLNX06 ~]# vi /etc/fstab

4:挂载新建的分区

[root@GETTestLNX06 ~]# cd /

[root@GETTestLNX06 /]# mkdir u01

[root@GETTestLNX06 /]# mount -a

[root@GETTestLNX06 /]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_gettestlnx06-lv_root

                       44G  2.3G   40G   6% /

tmpfs                 3.9G     0  3.9G   0% /dev/shm

/dev/sda1             477M   33M  419M   8% /boot

/dev/sdb5              99G   60M   94G   1% /u01

[root@GETTestLNX06 /]# 

 

[参考资料]:

http://www.docin.com/p-670819195.html

Linux 格式化扩展分区(Extended)的更多相关文章

  1. linux 磁盘 扩展分区

  2. Linux格式化分区报错Could not start /dev/sda No such file or directory 解决办法

    Linux查看已经分好的区[root@linuxidc ~]# fdisk -l /dev/sda   Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 he ...

  3. Linux的磁盘分区(一)

    磁道:track 扇区:sector 磁头:head 柱面:cylinder 每个扇区,512字节 每个磁道划分为63个扇区 逻辑磁头(盘面)数设为255 一个柱面的大小 =255 * 63 * 51 ...

  4. linux磁盘及分区详解

    1.Linux 分区简介 1.1 主分区 vs 扩展分区 硬盘分区表中最多能存储四个分区,但我们实际使用时一般只分为两个分区,一个是主分区(Primary Partion)一个是扩展分区(extend ...

  5. Linux安装的分区问题

    对于一般的外部SATA存储设备,在ubuntu中会显示在/etc/sd*中,例如: SATA1插槽上的文件名:/dev/sda SATA5插槽上的文件名:/dev/sdb USB磁盘:/dev/sdc ...

  6. CentOS(五)--Linux系统的分区概念

    一.系统分区 首先先普及一下有关系统分区的一些知识: 硬盘分区有三种,主磁盘分区.扩展磁盘分区.逻辑分区. 一个硬盘主分区至少有1个,最多4个,扩展分区可以没有,最多1个.且主分区+扩展分区总共不能超 ...

  7. Oracle ASM无法识别扩展分区的磁盘设备

    在linux 环境下,我们一般通过udev或者asmlib来绑定磁盘分区作为ASM的候选存储单元.在使用udev的情况下,一般只要我们可以看到被绑定的磁盘的设备,并且这些设备的属主和权限没有问题,AS ...

  8. Linux学习 - fdisk分区

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

  9. linux mkfs命令参数及用法详解---linux格式化文件系统命令(包括swap分区)

    mkfs 命令  linux格式化磁盘命令           linux mkfs         指令:mkfs 使用权限 : 超级使用者 使用方式 : mkfs [-V] [-t fstype] ...

随机推荐

  1. Unity调用Android类方法

    Unity调用Android类方法 1.  添加Unity的classes.jar文件 创建一个Android工程AndroidUnityDemo. 由于Unity的版本不同,直接在Unity安装包文 ...

  2. js构建ui的统一异常处理方案(四)

    上一篇我们介绍了统一异常处理方案的设计方案,这一篇我们将直接做一个小例子,验证我们的设计方案. 例子是一个todo的列表界面(页面代码参考于https://github.com/zongxiao/Dj ...

  3. Groovy学习--基本语法了解

    x项目用到gradle,学习gradle之前准备先过一遍Groovy的语法.这里参考:Groovy入门. 该博客没有系统的讲解Groovy的语法和原理,仅仅只是罗列了使用Groovy的常规方法.我照着 ...

  4. 在Mac下运行ASP.NET Core应用程序

    在Mac下运行ASP.NET Core应用程序 通过参照.NET Core相关官方文档,在我的Mac电脑上用Visual Studio Code创建了我的第一个ASP.NET应用. 开发环境搭建 首先 ...

  5. C#图片加水印实例与代码

    本文要提供的类可以为图片加文字水印,以及判断是否是图片文件.经过测试可运行,例子请下载:http://hovertree.com/h/bjaf/5qc5eh6y.htm 例子效果图: 以下是Hover ...

  6. Visual Studio 2013 Unit Test Project App.config文件设置方法

    开放中经常会要做单元测试,新的项目又没有单元测试项目,怎么才能搭建一个单元测试项目呢? 下面跟我四步走,如有错误之处,还请指正! 1.添加项目 2.添加配置文件 新建app.config文件,注意不是 ...

  7. 【Win10开发】Toast通知——后台激活

    前篇文章我们写了关于Toast的前台激活,那么接下来就讲一讲它的后台激活.当通知出现时并不会出现app的界面,但是app能在后台获取到通知中的信息. 关于xaml和Toast通知架构我们在这里就不再赘 ...

  8. linux系统下make & make install

    make,make install都是典型的使用GNU的AUTOCONF和AUTOMAKE产生的程序的安装步骤. make是用来编译的,在命令行输入make命令之后,系统会在当前目录下搜索Makefi ...

  9. php中的M方法

  10. [译]Godot系列教程三 - 场景实例化(续)

    场景实例化(续) 要点 场景实例化带来很多便利的用法,总体来说有: 将场景细分,更便于管理 相对于某些引擎中的Prefab组件更灵活,并且在许多方面更强大 是一种设计更复杂的游戏流程甚至UI的方式 这 ...