|
加入用 fdisk分出一块分区后,程序是会提示需要重启电脑后才能使分区生效。其实也可以无需重启,而直接进行格式化然后使用,方法是执行下面的指令:
partprobe /* inform the OS of partition table changes 通知系统分区表要改变了*/
mke2f /dev/sda6 /*假设 sda6 就是新划分出来的分区*/
mke2fs [options] device
a toggle a bootable flag 将分区设置为启动区 b edit bsd disklabel 编辑bsd的disklabel c toggle the dos compatibility flag 设置该分区为dos分区 d delete a partition 删除分区 l list known partition types 列出已知的分区类型 m print this menu 打印帮助列表 n add a new partition 创建新分区 o create a new empty DOS partition table p print the partition table 查看分区信息 q quit without saving changes 退出不保存 s create a new empty Sun disklabel t change a partition's system id 改变分区类型 u change display/entry units v verify the partition table w write table to disk and exit 保存退出 x extra functionality (experts only)
![]()
一个分区中,起始的块为启动扇区(boot sector)。
一定数量的块(blocks)组成一个块组(group)
在第一个组中的第一个 block 称之为 super block ,里面记录着这个分区里总共分为多少个块,有多少个inode等信息。
如果 super-block 损毁,那么这个分区就无法存储数据,所以在每个 block group 的第一个block都作为一个 super-block 的一个备份( super block bakcup )。
分区的相关信息,用 dumpe2fs 命令查看,如执行一下指令:
dumpe2fs /dev/sdc10 /*以我的分根区为例*/
结果显示(部分):
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 1302528
Block count: 5201035
Reserved block count: 260051
Free blocks: 3142288
Free inodes: 955300
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1022
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Filesystem created: Sat Nov 29 17:24:28 2008
Last mount time: Mon Dec 1 23:01:14 2008
Last write time: Mon Dec 1 23:01:14 2008
接着是 super-block 的内容:First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
First orphan inode: 90218
Default directory hash: half_md4
Directory Hash Seed: 44904a45-e11f-4979-bf04-017f58edb455
Journal backup: inode blocks
Journal size: 128M
在接着就是 group 的详细信息(部分):
Group 0: (Blocks 0-32767)
Primary superblock at 0, Group descriptors at 1-2
Reserved GDT blocks at 3-1024
Block bitmap at 1025 (+1025), Inode bitmap at 1026 (+1026)
Inode table at 1027-1538 (+1027)
23572 free blocks, 7969 free inodes, 2 directories
Free blocks: 1722-2047, 2213-4095, 4099-6143, 6222-8191, 10080-10239, 11578-12287, 12758-14335,
16385-16391, 17215-18431, 18819-20479, 20482-22527, 22589-26623, 26730-28671, 28673-30719, 30823
-32767
Free inodes: 224-8192
Group 1: (Blocks 32768-65535)
Backup superblock at 32768, Group descriptors at 32769-32770
Reserved GDT blocks at 32771-33792
Block bitmap at 33793 (+1025), Inode bitmap at 33794 (+1026)
Inode table at 33795-34306 (+1027)
...... |
|