分类: LINUX
2012-03-31 10:22:51
1.dd if=/dev/zero of=partition.001MG.img bs=1024K count=1
2.mkfs.ext4 -I256 -b1024 -N38649 partition.001M.img (生成3864个INODE,再多就出错)
3.sudo mount -t ext4 -o loop,acl,user_xattr,errors=remount-ro partition.001M.img partition.001M.mnt
PS:
1.查看分区结构sudo dumpe2fs partition.001M.img
Group 0: (Blocks 1-1023) [ITABLE_ZEROED]
Checksum 0x7ace, unused inodes 3845
Primary superblock at 1, Group descriptors at 2-2
Reserved GDT blocks at 3-5
Block bitmap at 6 (+5), Inode bitmap at 22 (+21)
Inode table at 38-1001 (+37)
38 free blocks, 3845 free inodes, 2 directories, 3845 unused inodes
Free blocks: 20-21, 23-37, 1003-1023
Free inodes: 12-3856
(END)
2.umount partition.001M.mnt
ls -lid ./
2 drwxr-xr-x 3 jiwan jiwan 1024 2011-06-10 14:03 ./ --->预分配1BlOCK
ls -lid ./lost+found/11 drwx------ 2 root root 12288 2011-06-10 14:03 ./lost+found/ --->预分配12BLOCK(试过100G的分区也是12BLOCK)
inode编号从1开始,分区根节点的编号是2,之外还会创建9个特殊文件(如记录损坏Block的文件,Journal文件等等),所以用户可以使用的inode从11开始。格式化的时候默认还会创建lost+found这个目录(id=11,占用12个BLOCK,可以删除)
参考:
1.Ext2
文件系统的硬盘布局
2.
3.总的磁盘结构和分区结构
4.
5.Linux安裝入門與基本管理[討論區]
6.
7.inode 和
blocksize
8.Linux
inode相关知识