Ubuntu 12.04 LTS,我已将新驱动器添加到系统,使用 fdisk 对其进行分区,现在尝试使用 mke2fs 对其进行格式化。该命令失败,因为它认为 inodes_count 和块数为零。
NOTE: -n = simulate actions
$ sudo mke2fs -c -L backups -t ext4 -T default -v -n /dev/sdc1
mke2fs 1.42 (29-Nov-2011)
fs_types for mke2fs.conf resolution: 'ext4'
mke2fs: inode_size (256) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).
以下是分区信息sudo fdisk /dev/sdc使用页命令:
Disk /dev/sdc: 146.8 GB, 146814976000 bytes
61 heads, 35 sectors/track, 134308 cylinders, total 286748000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8b4573b5
Device Boot Start End Blocks Id System
/dev/sdc1 2048 286747999 143372976 5 Extended
因此我添加了块数 143372976:
$ sudo mke2fs -c -L backups -t ext4 -T default -v -n /dev/sdc1 143372976
mke2fs 1.42 (29-Nov-2011)
fs_types for mke2fs.conf resolution: 'ext4'
Filesystem label=backups
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
8962048 inodes, 35843244 blocks
1792162 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1094 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
好的,看起来不错。但是,当我删除“-n”以实际执行操作时,它说文件系统大于明显的设备大小:
$ sudo mke2fs -c -L backups -t ext4 -T default -v /dev/sdc1 143372976
mke2fs 1.42 (29-Nov-2011)
mke2fs: Filesystem larger than apparent device size.
Proceed anyway? (y,n)
当我进入是继续,我得到一个充满错误的屏幕:
badblocks: Invalid argument during seek
我错过了什么?
编辑
以下是/etc/mke2fs.conf:
$ cat /etc/mke2fs.conf
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
default_mntopts = acl,user_xattr
enable_periodic_fsck = 0
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
auto_64-bit_support = 1
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
}
big = {
inode_ratio = 32768
}
huge = {
inode_ratio = 65536
}
news = {
inode_ratio = 4096
}
largefile = {
inode_ratio = 1048576
blocksize = -1
}
largefile4 = {
inode_ratio = 4194304
blocksize = -1
}
hurd = {
blocksize = 4096
inode_size = 128
}
答案1
“扩展” 不是正确的分区类型。扩展分区是“逻辑卷”的特殊容器。本质上,它是 MBR 架构内的嵌套分区架构。
删除此分区,并创建一个新的主分区。默认情况下,它应该已经具有正确的类型(0x83,Linux 文件系统)。