Простой пример.Создадим файловую систему.
Для начала создадим разреженный (прости, господи) файл размером 1 Гиг
Shell
user@debian:~/foo$ rm -f bar
user@debian:~/foo$ dd of=bar bs=1M seek=1024 count=0
0+0 записей считано
0+0 записей написано
скопировано 0 байт (0 B), 6,5893e-05 c, 0,0 kB/c
user@debian:~/foo$ ls -ls bar
0 -rw-r--r-- 1 user user 1073741824 Янв 11 14:03 bar
user@debian:~/foo$
Shell
user@debian:~/foo$ sudo mke2fs -t ext2 -F -v bar
mke2fs 1.42.5 (29-Jul-2012)
fs_types for mke2fs.conf resolution: 'ext2'
Discarding device blocks: done
Discard succeeded and will return 0s - skipping inode table wipe
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
user@debian:~/foo$
Shell
fs_types for mke2fs.conf resolution: 'ext2'
Shell
man mke2fs
...
The defaults of the parameters for the newly created filesystem, if not overridden by the options listed below, are controlled by the /etc/mke2fs.conf configuration file. See the mke2fs.conf(5) manual page for more details.
.If mke2fs started with a program name of mke2fs.ext4, then the filesystem type of ext4 will be used. If the filesystem is smaller than 3 megabytes, and no usage type is specified, then mke2fs will use a default usage type of floppy. This results in an fs_types list of "ext4, floppy". Both the ext4 subsection and the floppy subsection define an inode_size relation, but since the later entries in the fs_types list supersede earlier ones, the configuration parameter for fs_types.floppy.inode_size will be used, so the filesystem will have an inode size of 128
Вот мой файл mke2fs.conf
mke2fs.conf
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
}
Коль скоро я указал файловую систему ext2, значит мы должны пойты не в stanza [default], а в stanza [fs_types]:
Shell
Each tag in the [fs_types] stanza names a filesystem type or usage type which can be specified via the -t or -T options to mke2fs(8), respectively.
Но как бы то ни было. Я указываю -t ext2, лезу, понимаешь в stanza [fs_types] и наблюдаю такую картину: ext3, ext4, ext4dev, small, floppy, big, huge, news, largefile, largefile4, hurd
А ext2 отсутствует (тут вспоминаем строчку fs_types for mke2fs.conf resolution: 'ext2'). Откуда же берутся параметры для файловой системы, которая ext2? В этот перечень так и просится пункт default, но его нет.
В общем, как это всё работает, я так и не понял. Может, кто мои рассуждения поправит? Спасибо, кто откликнется. Debian 7.