Linux disk management commands are related commands for operating disks in Linux system, including partitioning, formatting, and resizing disks. This article is for beginners to learn. After reading this article, you will surely have a lot of GAINS. I hope this article will teach you more things.
Fdisk
Function Description: disk partition.
Syntax: fdisk [-B <partition size>] [-uv] [peripheral device Code] Or fdisk [-l] [-B <partition size>] [-uv] [peripheral device code ...] or fdisk [-s <Partition Number>]
Note: fdisk is a program used to partition disks. It uses a traditional Q & A interface instead of a cfdisk interactive operation interface similar to DOS fdisk. Therefore, it is inconvenient to use, however, the function is not compromised at all.
Parameters:
-B <partition size> specifies the size of each partition.
-L list the Partition Table Status of the specified peripheral device.
-S <Partition Number> outputs the specified partition size to the standard output, in blocks.
-U and "-l" parameter lists replace the number of cylinders with the number of partitions to indicate the start address of each partition.
-V displays the version information.
E2fsck(Ext2 file system check)
Function Description: Check whether the ext2 file system is correct.
Syntax: e2fsck [-acCdfFnprsStvVy] [-B <superblock>] [-B <block size>] [-l <File>] [-L <File>] [device name]
Note: The returned values and meanings of e2fsck after execution are as follows.
0. No error occurs.
1. The file system has an error and has been corrected.
2. The file system has an error and has been corrected.
4. File System error, but not corrected.
8. An error occurred during operation.
16. The syntax used is incorrect.
128 An error occurred in the shared function library.
Parameters:
-A automatically repairs the file system without asking the user's opinion.
-B <superblock> specifies the superblock instead of the preset superblock.
-B <block size> specifies the block size, in bytes.
-C executes badblocks together to identify the damaged block.
-C records the information of the check process in file descriptor, so that the entire check process can be fully monitored.
-D: displays the error message.
-F checks correctness forcibly even if the file system shows no signs of errors.
-F clears the buffer zone of the device before execution.
-L <File> Add the specified block in the file to the damaged block list.
-L <File> first clears the damaged block list, and then adds the specified block in the file to the damaged block list. Therefore, the blocks in the damaged block list are the same as the blocks specified in the file.
-N: Enable the file system in read-only mode and execute it in non-interactive mode. All question conversations are set to "no.
-P: The file system is automatically repaired without asking the user's opinion.
-R this parameter only exists for compatibility and has no practical effect.
-S: If the byte sequence of the file system is not appropriate, the byte sequence is switched; otherwise, no action is performed.
-S swap the byte order regardless of the file system's byte order.
-T: displays the time information.
-V displays detailed information during execution.
-V displays the version information.
-Y is executed in non-interactive mode, and all questions are set to "yes.
Here is the Linux disk management command.
- Analysis on global Linux Authentication
- How to omit a password in Linux
- Linux virus protection
- Fully handle Linux syn Attacks
- Introduction to installing plug-ins in Linux