redhat disk test, mount and unloading

Disk test

fsck (file system check) for inspection and maintenance inconsistent file system.

If the system is powered down or disk problems occur, you can check the file system using the fsck command.

grammar:

fsck [-t File System] [-ACay] Device Name

Options and parameters:

-t: Given the type of file system, if the / etc / fstab already defined or supported by the kernel itself without adding this parameter
-s: sequentially one by one to execute instructions to check fsck
-A: of the / etc / fstab listed all the partitions (partition) for examination
-C: display a complete check progress
-d: debug print out the results of the e2fsck
-p: -A while when conditions while checking a plurality of fsck executed together
-R: -A while when conditions are omitted / not checked
-V: detailed display mode
-a: If the check is wrong automatic repair
-r: If the check is wrong by the user to answer whether the repair
-y: options Specifies that the test each file is automatically entered yes, the uncertainty that is not normal, they can perform all the checks # fsck -y repair.

Example 1

Check how many file system supported by the system fsck command:

[root@www ~]# fsck[tab][tab]
fsck fsck.cramfs fsck.ext2 fsck.ext3 fsck.msdos fsck.vfat

Example 2

Mandatory testing / dev / hdc6 partition:

[root@www ~]# fsck -C -f -t ext3 /dev/hdc6
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
vbird_logical: 11/251968 files (9.1% non-contiguous), 36926/1004046 blocks

If you do not add the -f option, because the file system did not have problems, check through a very fast! If coupled with -f Force checking, appear one by one in the process.

Disk mount and dismount

Linux disk mounted using the mount command, uninstall using the umount command.

Disk mount syntax:

mount [-t file system] [-L Label Name] [-o extra options] [-n] filename device mount point

Example 1

The default way that will just create / dev / hdc6 mount / mnt / hdc6 above!

[root@www ~]# mkdir /mnt/hdc6
[root@www ~]# mount /dev/hdc6 /mnt/hdc6
[root@www ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
.....中间省略.....
/dev/hdc6 1976312 42072 1833836 3% /mnt/hdc6

Uninstall disk umount command syntax:

umount [-fn] file name or device mount point

Options and parameters:

-f: Force dismount! Used in cases like the Network File System (NFS) Unable to read;
-n: do not upgrade / etc / mtab removed the case.
Uninstall / dev / hdc6

[root@www ~]# umount /dev/hdc6

Guess you like

Origin www.cnblogs.com/augusite/p/11899843.html