The FDISK command is used to observe hard disk entity usage or to partition the hard disk. It uses the traditional question-and-answer interface rather than the Cfdisk interactive interface of DOS Fdisk, which makes it inconvenient to use, but without compromising the functionality.
FDISK (Options)
-b< partition size;: Specifies the size of each partition;
-L: Lists the partition table status for the specified peripheral devices;
-s< partition number;: Outputs the specified partition size to the standard output, in chunks;
-U: With the "-L" parameter list, the number of partitions is replaced by the number of columns to represent the starting address of each partition;
-V: Displays version information.
The MKFS command is used to create a Linux file system on a device (usually a hard disk). The MKFS itself does not perform the work of establishing the filesystem, but rather calls the relevant program to execute it.
MKFS (option)
FS: Specifies the parameters when the file system is established;
-t< file system type;: Specifies what file system to build;
-V: Displays the version information and the detailed use method;
-V: Displays a brief use method;
C: Before making the file system, check whether the partition has a bad track.
The Partprobe command is used to reread a partitioned table, which appears to occupy space when a file is deleted. You can partprobe the partition without restarting.
Partprobe (option)
-D: Do not update the kernel;
-S: Displays summaries and partitions;
-H: Displays help information;
-V: Displays version information.
Yum -y install parted installation Partprobe
Using the Fdisk tool only writes partition information to disk, and if a MKFS disk partition is required, the system needs to be restarted, while using Partprobe allows kernel to re-read the partition information to avoid rebooting the system
Cat/proc/partitions
Use Partprobe to create a new partition with the Fdisk tool without rebooting the system
set up two directories/oracle and/web to mount the newly created two partitions to the system:
[Email protected] ~]# mkdir/oracle
[Email protected] ~]# Mkdir/web
[Email protected] ~]# mount/dev/sdb4/oracle
[Email protected] ~]# Mount/dev/sdb5/web
If you need to automatically mount the boot every time you need to modify the/etc/fstab file, add two lines of configuration:
[Email protected] ~]# Vim/etc/fstab
Tmpfs/dev/shmTMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
/dev/sdb4/oracle ext2 Defaults 0 0
/dev/sdb5/web ext3 defaults 0 0
The DF command is used to display the available disk space on a disk partition. The default display unit is KB. You can use this command to get how much space the hard disk is taking up, and how much space is left.
DF (option)
-A or--all: contains all file systems;
--block-size=< block size;: Displays the number of chunks in the specified chunk size;
-H or--human-readable: Display information in a more readable manner;
-H or--si: Same as-h parameter, but is calculated with the Bytes as the conversion unit instead of the Bytes;
-I or--inodes: Displays the inode information;
-K or--kilobytes: Specifies a chunk size of 1024 bytes;
-L or--local: Displays only the local file system;
-M or--megabytes: Specifies a chunk size of 1048576 bytes;
--no-sync: Do not perform sync instructions before obtaining disk usage information, this is a preset value;
-P or--portability: use POSIX output format;
--sync: Before obtaining the disk usage information, perform the sync instruction first;
-t< file System type > or--type=< file system type;: Displays only disk information for the specified file system type;
-T or--print-type: Displays the type of file system;
-x< file System type > or--exclude-type=< file system type;: Do not display disk information for the specified file system type;
--help: Display Help;
--version: Displays version information.
The fsck command is used to check and attempt to repair errors in the file system. When the file system error four modernizations, the fsck command can be used to try to repair
FSCK (Options)
-A: Automatically repair the file system without asking any questions;
-A: According to the contents of the/etc/fstab configuration file, check all the file system listed in the file;
-N: Do not execute the instruction, only the action that the actual execution will carry out;
-P: When used with the "-A" parameter, all file systems are checked at the same time;
-R: Use interactive mode, in the implementation of the repair to ask questions, so that users can confirm and decide how to handle;
-r: When used with the "-A" parameter, the file system will skip/directory is not checked;
-S: Perform inspection operations sequentially, not concurrently;
-t< file system type;: Specifies the type of file system to check;
-T: Header information is not displayed when the fsck command is executed;
-V: Displays the instruction execution process.
Linux file system corruption will cause Linux to shut down, error if the system tells you which hard disk partition has a problem, such as/DEV/HDA2, followed by the following command to deal with it: Fsck-y/dev/hda2
Restart the system using the reboot command at the end so that's fine.
If you do not know where the problem is, you can directly: fsck
Linux Disk partition mount instructions