The fifth part of the detailed explanation of disk and file system management
Partition-> create file system (formatted)
File system management
Recreating the file system will damage the original file
Fdisk / dev/sda
You can't delete it inside, just press ctrl+Backspace.
Partprobe / dev/sda only detects this one
Mkfs: make file system
-t FSTYPE mkfs-t ext2 / dev/sda5
Mkfs-t ext2 = mkfs.ext2
Mkfs-t ext3 = mkfs.ext3
Mkfs-t vfat = mkfs.vfat
Specializes in managing ext series file systems
Mke2fs
-j:ext3 creates ext3 type file system mke2fs-j / dev/sda5
-b BLOCK_SIZE: specifies the block size. The default is 4096. Available values are 1024 and 4096.
Mke2fs-b 2048-j / dev/sda5
-L LABEL: specify the partition volume label mke2fs-L MYDATA7 / dev/sda5
-m #: specifies that the percentage of blocks reserved for superusers is mke2fs-m 3 / dev/sda5
-I #: used to create an inode that specifies the number of bytes of space. The default is 8192, where
The given value should be 2 ^ n times the block size.
Mke2fs-I 4096 / dev/sda5
-N #: specify the number of inode
-F: force the creation of a file system
Blkid queries or views the properties of a disk device
Display or locate the properties of the block device
Blkid / dev/sda5
UUID TYPE LABEL
E2label is used to view or define volume labels
E2label device file volume label; set volume label
E2label / dev/sda5
E2label / dev/sda5 MYRR
Tune2fs adjusts the relevant properties of the file system:
Upgrade ext2 to ext3 tune2fs-j / dev/sda5 without harming the original data
-L LABEL: set or modify the volume label tune2fs-L MYDATA / dev/sda5
-m #: adjust the reservation percentage
-r #: specify the number of reserved blocks
-o: set default mount options
Acl
-c #: self-test is performed after the specified number of mounts reaches #; 0 or-1 turns off this feature
-I #: self-test after how many days per mount; turn off this feature for 0 or-1
-l: displays the information in the super block
Dumpe2fs: displaying file system attribute information
-h: displays only super block information df-lh
Dumpe2fs / dev/vol0/root
Fsch detects and repairs the Linux file system
-t FSTYPE: specifies the file system type
-a: automatic repair, will not be asked
E2fsch: designed to repair ext2 and ext3 file systems
-f: mandatory inspection
-p: automatic repair
File system type:
Ext2
Ext3
Check which file systems are supported by the current system
Cat / proc/filesystems
If you want to use a partition, you must mount it.
Mount: associate a new file system to the current root file system
Unmount: removes the association between a file system and the current root file system
Mount: mounting
Mount device mount point
Equipment:
Device file / dev/sda5
Volume label: LABEL = ""
UUID: UUID = ""
Mount point: directory
Request:
1. This directory is not used by other processes
2. The directory must exist in advance.
3. The original files in the directory will be temporarily hidden
Mount: displays the devices and mount points that have been mounted on the current system (without parameters)
Mount [option] [- o option] DEVICE MOUNT_POINT
Options for the mount command functional options for mounting file systems
-a: represents all file systems defined in the mount / etc/fstab file
-n: by default, the mount command mounts a device every time it is mounted
Save the information to / etc/mtab file: using the-n option means that when the device is mounted
Do not write information to this file
-t FSTYPE: specify the type of file system being mounted on the device, do not use this option
Mount calls the blkid command to get the type of the corresponding file system
-r: this option is often used for read-only mount CDs
-W: read write mount
-o: specify additional mount options, that is, properties that are enabled by the file system
Remount: remount the current file system
Ro; mount is read-only
Rw: read write mount
Remount: mount-o remount,ro / dev/sda5 (do not specify mount point)
After the mount is complete, access the files on the corresponding file system through the mount point
Mount / dev/sda5 / mnt/test/
Umount: unmount a file system
Umount equipment
Umount mount point
Uninstall consideration
1. The mounted device is not used by processes.
2 、