鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)

时间:2022-07-04 05:14:08
  1. 磁盘的组成主要有:
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
  2. 主分区和扩展分区:
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
  3. super block、inode、block
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
  4. 文件系统一开始就将inode与block规划好了,除非重新格式化,否则inode与block固定后就不在变动
  5. 文件系统最前面有一个启动扇区,这个启动扇区可以安装引导装载程序。
  6. 数据块)数据块:
    在Ext2文件系统中所支持的block大小有1KB,2KB及4KB三种而已。
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
  7. inodetable(inode表格)
    inode记录的文件数据至少有:
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)

  8. super block(超级块):
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)

  9. block bitmap(block对照表)、inode bitmap(inode对照表)
    鸟哥的linux私房菜学习笔记《十一》磁盘与文件系统(block与inode)

  10. dumpe2fs查询超级块的信息
    参数:
    -b:列出保留为坏道的部分
    -h:仅列出superblock的数据,不会列出其他的区段内容

    [root@CentOS kevin]# dumpe2fs /dev/sda1
    dumpe2fs 1.41.12 (17-May-2010)
    Filesystem volume name:   <none>
    Last mounted on:          /boot
    Filesystem UUID:          210195dc-73eb-4dc8-be3e-db36b147c314
    Filesystem magic number:  0xEF53
    Filesystem revision #: 1 (dynamic)
    Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize
    Filesystem flags:         signed_directory_hash 
    Default mount options:    user_xattr acl
    Filesystem state:         clean
    Errors behavior:          Continue
    Filesystem OS type:       Linux
    Inode count:              51200
    Block count:              204800
    Reserved block count:     10240
    Free blocks:              170154
    Free inodes:              51162
    First block:              1
    Block size:               1024
    Fragment size:            1024
    Reserved GDT blocks:      256
    Blocks per group:         8192
    Fragments per group:      8192
    Inodes per group:         2048
    Inode blocks per group:   256
    Flex block group size:    16
    Filesystem created:       Wed Mar  1 16:03:23 2017
    Last mount time:          Mon Mar  6 00:22:57 2017
    Last write time:          Mon Mar  6 00:22:57 2017
    Mount count:              11
    Maximum mount count:      -1
    Last checked:             Wed Mar  1 16:03:23 2017
    Check interval:           0 (<none>)
    Lifetime writes:          48 MB
    Reserved blocks uid:      0 (user root)
    Reserved blocks gid:      0 (group root)
    First inode:              11
    Inode size:           128
    Journal inode:            8
    Default directory hash:   half_md4
    Directory Hash Seed:      4f4c0f86-b819-4859-a959-67ebacd82557
    Journal backup:           inode blocks
    Journal features:         (none)
    Journal size:             4096k
    Journal length:           4096
    Journal sequence:         0x00000024
    Journal start:            0
    
    
    Group 0: (Blocks 1-8192) [ITABLE_ZEROED]
      Checksum 0xf843, unused inodes 2010
      Primary superblock at 1, Group descriptors at 2-2
      Reserved GDT blocks at 3-258
      Block bitmap at 259 (+258), Inode bitmap at 275 (+274)
      Inode table at 291-546 (+290)
      3785 free blocks, 2010 free inodes, 6 directories, 2010 unused inodes
      Free blocks: 4408-8192
      Free inodes: 39-2048
    Group 1: (Blocks 8193-16384) [INODE_UNINIT, ITABLE_ZEROED]
      Checksum 0x6273, unused inodes 2048
      Backup superblock at 8193, Group descriptors at 8194-8194
      Reserved GDT blocks at 8195-8450
      Block bitmap at 260, Inode bitmap at 276
      Inode table at 547-802
      1296 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
      Free blocks: 9016-10240, 12218-12288
      Free inodes: 2049-4096
    ............
    ............
    ............