Linux磁碟和檔案系統管理(4)_檔案系統屬性查看 修改
檔案系統屬性查看及調整工具: e2label命令:設定檔案系統卷標,這樣避免格式化修改卷標 e2label 裝置名稱 [Label]
#查看分區卷標[root@localhost ~]# e2label /dev/sdb1mytest#修改分區卷標[root@localhost ~]# e2label /dev/sdb1 'labelNew'[root@localhost ~]# e2label /dev/sdb1labelNew
tune2fs命令:顯示ext系列檔案系統的屬性或修改其屬性 文法:tune2fs [option] 裝置名稱 參數: -l:顯示super block中的資訊 -j:將ext2檔案系統轉換為ext3檔案系統,加入journal -L ‘label’:類似e2label,分區卷標 -m #:調整預留給管理員的管理空間百分比 -O:檔案系統屬性的啟動或關閉 [^]feature[,...] -o:檔案系統預設掛載選項的啟用或關閉 [^]mount-option[,...] man tune2fs查看詳細的參數 樣本:
[root@localhost ~]# tune2fs -l /dev/sdb1tune2fs 1.42.9 (28-Dec-2013)Filesystem volume name: labelNew ------->卷標Last mounted on: /mnt/test3 ----->掛載點Filesystem UUID: e238f3ae-863c-473e-a1ca-35b1e0a69de2Filesystem magic number: 0xEF53Filesystem revision #: 1 (dynamic)Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isizeFilesystem flags: signed_directory_hash Default mount options: user_xattr acl ----> 預設掛載選項Filesystem state: cleanErrors behavior: ContinueFilesystem OS type: LinuxInode count: 65536Block count: 262144Reserved block count: 13107Free blocks: 249189Free inodes: 65524First block: 0Block size: 4096Fragment size: 4096Group descriptor size: 64Reserved GDT blocks: 127Blocks per group: 32768Fragments per group: 32768Inodes per group: 8192Inode blocks per group: 512Flex block group size: 16Filesystem created: Tue Sep 15 05:53:15 2015Last mount time: Tue Sep 15 17:07:02 2015Last write time: Tue Sep 15 17:59:21 2015Mount count: 9Maximum mount count: -1Last checked: Tue Sep 15 05:53:15 2015Check interval: 0 (<none>)Lifetime writes: 49 MBReserved blocks uid: 0 (user root)Reserved blocks gid: 0 (group root)First inode: 11Inode size: 256Required extra isize: 28Desired extra isize: 28Journal inode: 8Default directory hash: half_md4Directory Hash Seed: 45da449e-ad33-4a49-9660-1469a94cc2f8Journal backup: inode blocks#修改預設掛載選項:啟用journal_data[root@localhost ~]# tune2fs -o journal_data /dev/sdb1tune2fs 1.42.9 (28-Dec-2013)[root@localhost ~]# tune2fs -l /dev/sdb1....Default mount options: journal_data user_xattr acl....
dumpe2fs 命令:顯示 ext2/ext3/ext4 檔案系統資訊 文法:dumpe2fs [option] DEVICE 參數: -h: 僅顯示超級塊資訊; -b:顯示壞塊資訊 -x:顯示詳細的組資訊 樣本:
[root@localhost ~]# dumpe2fs -x /dev/sdb1dumpe2fs 1.42.9 (28-Dec-2013)Filesystem volume name: labelNew...super block 資訊...Journal start: 0Group 0: (Blocks 0x00000000-0x00007fff) [ITABLE_ZEROED] Checksum 0xba41, unused inodes 8180 Primary superblock at 0x00000000, Group descriptors at 0x00000001-0x00000001 Reserved GDT blocks at 0x00000002-0x00000080 Block bitmap at 0x00000081 (+129), Inode bitmap at 0x00000091 (+145) Inode table at 0x000000a1-0x000002a0 (+161) 28521 free blocks, 8180 free inodes, 2 directories, 8180 unused inodes Free blocks: 0x0000008e-0x00000090, 0x00000099-0x000000a0, 0x000010a2-0x00007fff Free inodes: 0x0000000d-0x00002000...組資訊...