当使用fdisk/parted创建分区后,使用mkfs.ext4格式化文件系统时,那个速度之慢,几个T大小磁盘几个小时才完成格式化。在这期间就想有没有类似windows的快速格式化选项。
man mkfs.ext4一路找可以看到这样的信息:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
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
.
|
然后查看/etc/mke2fs.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
[
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
}
|
测试mkfs.ext4 -T largefile /dev/xxx这个方式,几乎在几分钟完成快速格式化。