CentOS使用mkfs.ext4快速格式化大容量硬盘
2016-01-22 16:38
746 查看
昨天(2014-09-16)屁民瑞威为了测试一个系统,给2台虚拟机各分配了1.5TB的存储空间。但是当使用fdisk创建分区后,使用mkfs.ext4格式化文件系统时,那个速度之慢,为了不搞坏硬盘,没有取消格式化,最终其中一台虚拟机等了几个小时才完成格式化。在这期间就想有没有类似windows的快速格式化选项。
通过mkfs.ext4 –help没有看出所以然来,网上有兄弟指出可以通过mkfs.ext4 -T largefile /dev/xxx这个方式快速格式化硬盘。man mkfs.ext4一路找可以看到这样的信息:
然后查看/etc/mke2fs.conf
测试mkfs.ext4 -T largefile /dev/xxx这个方式,几乎在几分钟完成快速格式化。
通过mkfs.ext4 –help没有看出所以然来,网上有兄弟指出可以通过mkfs.ext4 -T largefile /dev/xxx这个方式快速格式化硬盘。man mkfs.ext4一路找可以看到这样的信息:
-T usage-type[,...] Specify how the filesystem is going to be used, so that mke2fs can choose optimal filesystem parameters for that use. The usage types that are supported are defined in the configuration file /etc/mke2fs.conf(5). The user may specify one or more usage types using a comma separated list. If this option is is not specified, mke2fs will pick a single default usage type based on the size of the filesystem to be created. If the filesystem size is less than or equal to 3 megabytes, mke2fs will use the filesystem type floppy. If the filesystem size is greater than 3 but less than or equal to 512 megabytes, mke2fs(8) will use the filesystem small. Otherwise, mke2fs(8) will use the default filesystem type default.
- T usage - type [ , . . . ] Specify how the filesystem is going to be used , so that mke2fs can choose optimal filesystem parameters for that use . The usage types that are supported are defined in the configuration file / etc / mke2fs . conf ( 5 ) . The user may specify one or more usage types using a comma separated list . If this option is is not specified , mke2fs will pick a single default usage type based on the size of the filesystem to be created . If the filesystem size is less than or equal to 3 megabytes , mke2fs will use the filesystem type floppy . If the filesystem size is greater than 3 but less than or equal to 512 megabytes , mke2fs ( 8 ) will use the filesystem small . Otherwise , mke2fs ( 8 ) will use the default filesystem type default . |
[defaults] base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr blocksize = 4096 inode_size = 256 inode_ratio = 16384 [fs_types] ext3 = { features = has_journal } ext4 = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize inode_size = 256 } ext4dev = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize inode_size = 256 options = test_fs=1 } small = { 4000 blocksize = 1024 inode_size = 128 inode_ratio = 4096 } floppy = { blocksize = 1024 inode_size = 128 inode_ratio = 8192 } news = { inode_ratio = 4096 } largefile = { inode_ratio = 1048576 blocksize = -1 } largefile4 = { inode_ratio = 4194304 blocksize = -1 } hurd = { blocksize = 4096 inode_size = 128 }
[ defaults ] base_features = sparse_super , filetype , resize_inode , dir_index , ext_attr blocksize = 4096 inode_size = 256 inode_ratio = 16384 [ fs_types ] ext3 = { features = has _ journal } ext4 = { features = has_journal , extent , huge_file , flex_bg , uninit_bg , dir_nlink ,extra_isize inode_size = 256 } ext4dev = { features = has_journal , extent , huge_file , flex_bg , uninit_bg , dir_nlink ,extra_isize inode_size = 256 options = test_fs = 1 } small = { blocksize = 1024 inode_size = 128 inode_ratio = 4096 } floppy = { blocksize = 1024 inode_size = 128 inode_ratio = 8192 } news = { inode_ratio = 4096 } largefile = { inode_ratio = 1048576 blocksize = - 1 } largefile4 = { inode_ratio = 4194304 blocksize = - 1 } hurd = { blocksize = 4096 inode_size = 128 } |
相关文章推荐
- Ubuntu 为 root 帐号开启 SSH 登录
- Linux 目录结构
- (总结)Linux的chattr与lsattr命令详解
- Linux中常用操作命令
- Linux下触摸屏驱动程序分析
- Linux---CentOS 定时运行脚本配置
- CentOS常见问题记录
- CentOS 安装zabbix-server和zabbix-agent
- CentOS 7 配置FTP(vsftpd)
- Linux 学习笔记
- Intel集成显卡驱动安装linux
- Linux运维笔记
- Linux下errno错误信息对照
- centos6.0下搭建LNMP环境
- linux中中解决vsftp连接时的“500 OOPS:cannot change directory:/root”
- linux中vim的工作模式
- Linux中JDK1.6的安装和配置方法
- Linux workqueue工作原理
- centos 6.2 64安装hping3
- Linux 用户管理(1)