博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux 格式化扩展分区(Extended)
阅读量:7103 次
发布时间:2019-06-28

本文共 3338 字,大约阅读时间需要 11 分钟。

如果你在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 /]#
本文转自 jiu~ 博客园博客,原文链接:http://www.cnblogs.com/jiu0821/p/7326775.html,如需转载请自行联系原作者
你可能感兴趣的文章
SQL优化(五) PostgreSQL (递归)CTE 通用表表达式
查看>>
Makefile范例:单文件夹多个.c和.h编译
查看>>
21、深度克隆。
查看>>
微信打开的页面背景音乐无法自动播放
查看>>
sql(join中on与where区别)
查看>>
在pcDuino上搭建一个简单网站
查看>>
微软:我对网络安全最大贡献是免费升级Win10
查看>>
Activity中 FLAG_ACTIVITY_NEW_TASK, FLAG_ACTIVITY_CLEAR_TOP和launchMode 实现清空栈顶行为的调查...
查看>>
最佳(Optimal)置换算法模拟
查看>>
2.3find搜索命令
查看>>
linux命令
查看>>
Java 程序员必备的 Intellij IDEA 插件
查看>>
使用tomcat 7的 maven插件启动项目
查看>>
计算器 abacus 1.0 发布
查看>>
谈谈Memcached与Redis
查看>>
推荐个好用的屏幕截图软件(Screenpresso)
查看>>
OC中的Block(闭包)
查看>>
线程内共享数据的方式
查看>>
网络编程:优雅关闭socket/TIME_WAIT/CLOSE_WAIT/SoLinger
查看>>
test
查看>>