View File system attributes dumpe2fs display file system superblock and blocksgroup information without parameters will show all content-h: Only list superblock data superblock commonly used display content comments: Filesystemvolumename: & lt; none & gt ;...
View File system attributes
Dumpe2fs displays the super block and blocks group information of the file system.
If no parameter is specified, all content is displayed.
-H: Only list superblock data
Notes for frequently used superblock display content are as follows:
Filesystem volume name: <= File system label
Last mounted on:/<= mount point of the file system
Filesystem UUID: 8e4f6141-20f9-4f5a-aad4-bac0483720.2 <= code of this file system
Default mount options: user_xattr acl <= Default mount option
Inode count: 960992 <= number of Inode
Block count: 3840000 <= number of blocks
Reserved block count: 192000 <= number of Reserved blocks
Free blocks: 3093336 <= number of remaining parts
Free inodes: 855672 <= remaining Inode count
First block: 0
Block size: 4096 <= the Block size is 4 K
Mount count: 21 <= number of times the file system is mounted
Maximum mount count:-1 <= How many times does the file need to be mounted? FSCK. if it is a negative number or 0, it will never be self-checked.
Reserved blocks uid: 0 (user root) <= block Reserved for a user
Reserved blocks gid: 0 (group root) <= block Reserved for a group
First inode: 11
Inode size: 256 <= Inode size
All of the above are supberblock-related information. to view the Block Group-related information, run the dumpe2fs command without adding a parameter. Under supberblock, information about the Block Group starts with a Group.
Group *: <= all block group information.
View the UUID of the file system
Blkid
[Root @ yufei ~] # Blkid
/Dev/sda1: UUID = "744b208e-0951-40e1-a4ae-1ece29840ddb" TYPE = "ext4" LABEL = "/dev/sda1 ″
/Dev/sda2: UUID = "c70cd6a4-09cd-4aea-ba94-f3641df4e981" TYPE = "swap"
Ls-l/dev/disk/by-uuid/
[Root @ yufei ~] # Ls-l/dev/disk/by-uuid/
Total 0
Lrwxrwxrwx. 1 root 10 Apr 4 744b208e-0951-40e1-a4ae-1ece29840ddb->.../sda1
Lrwxrwxrwx. 1 root 10 Apr 4 c70cd6a4-09cd-4aea-ba94-f3641df4e981->.../sda2
View the file system information of a disk
Fdisk/dev/sda
[Root @ yufei ~] # Fdisk/dev/sda
Command (m for help): p
Disk/dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00093fdc
Device Boot Start End Blocks Id System
/Dev/sda1*1 1913 15360000 83 Linux
/Dev/sda2 1913 1978 524288 82 Linux swap/Solaris
Q exit
Here we can see the information of the swap partition. if df is used, we cannot see the information of the swap partition. The usage of the fdisk partition command will be detailed later.
Adjust file system parameters
Change the file system label e2label
Command format
E2label device name new Label name
Note: You do not know how to restore LABLE. if you have any idea, you can leave a message to share it. Thank you!
Adjust/view the parameters of the ext2/ext3/ext4 file system in tune2fs
Common options:
-L viewing the file system information is equivalent to the information displayed in dumpe2fs-h.
-C max-mount-counts: sets the number of mount times for force self-check. if this option is enabled, mount conut is added to each mount time. after this option is exceeded, the force self-check is performed.
-I interval-between-checks [d | m | w] sets the time interval for force self-check [d days, m months, w weeks]
-M reserved-blocks-percentage: sets the percentage of reserved blocks.
-R reserved-blocks-count
-L volume-label: set/modify the label of the file system. Functions similar to e2label.
-O [^] mount-option [,...] Set or clear the indicated default mount options in the filesystem. Set or clear the default mounted file system options
Tune2fs-o ^ acl/dev/sda1 clear acl attributes
Tune2fs-o + acl/dev/sda1
-U uid
-G gid
Set the user and user group for which blocks is retained
-U UUID
How to obtain UUID information
Uuidgen dynamically obtains the UUID information of the file system, which can be changed based on your preferences.
It has two parameters.
-R random acquisition
-T random acquisition based on time
Note: after modification, you need to modify the corresponding/etc/fstab and/boot/grub/menu. lst files. Otherwise, your system will not start. During my experiments, I changed the fstab file and forgot the menu. lst file. as a result, the startup device could not be found.
The number and size of blocks and inode are generated when a file system is created. if you want to change the size, you need to format it again.
From Yufei blog