Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement checking, mounting and dismounting operations in Linux disk management

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Linux disk management how to achieve inspection, mount and unmount operation, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

The disk management of Linux is a very important skill for Linux administrators, and the quality of disk management is directly related to the performance of the whole system.

Disk inspection

Fsck (file system check) is used to check and maintain inconsistent file systems.

If the system is powered off or there is a problem with the disk, you can use the fsck command to check the file system.

Syntax:

Fsck [- t file system] [- ACay] device name

Options and parameters:

-t: given the type of file system, this parameter is not required if it is already defined in / etc/fstab or supported by kernel itself-s: execute the instructions of fsck one by one in order to check-A: check all the partitions listed in / etc/fstab (partition)-C: show the complete check progress-d: print out the debug result of e2fsck-p: when there are-A conditions At the same time, multiple fsck checks are performed together-R: omit / do not check-V: detailed display mode-a: if there is an error in the check, automatically fix it-r: if there is an error in the check, the user will answer whether to fix it-y: the option specifies that each file is automatically entered yes, when not sure which is abnormal You can perform # fsck-y check all fixes.

Example 1

See how many fsck commands the file system supports:

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

Example 2

Force detection of / dev/hdc6 partition:

[root@www] # fsck-C-f-t ext3 / dev/hdc6fsck 1.39 (29-May-2006) e2fsck 1.39 (29-May-2006) Pass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary informationvbird_logical: 11 Checking directory connectivityPass 251968 files (9.1% non-contiguous), 36926 Checking directory structurePass 1004046 blocks

If you do not add the-f option, then because there is no problem with this file system, the check is very fast! If you add-f mandatory inspection, there will be a display process.

Disk mounting and dismounting

Disk mount of Linux uses the mount command, and uninstall uses the umount command.

Disk mount syntax:

Mount [- t file system] [- L Label name] [- o extra option] [- n] device file name mount point

Example 1

By default, mount the / dev/hdc6 you just created to / mnt/hdc6!

[root@www] # mkdir / mnt/hdc6 [root@www] # mount / dev/hdc6 / mnt/hdc6 [root@www] # dfFilesystem 1K-blocks Used Available Use% Mounted on. Omitted in the middle. / dev/hdc6 1976312 42072 1833836 / mnt/hdc6

Disk unmount command umount syntax:

Umount [- fn] device file name or mount point

Options and parameters:

-f: forced removal! Can be used in situations like the Network File system (NFS) that cannot be read;-n: dismount without upgrading / etc/mtab. Uninstall / dev/hdc6

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

Thank you for reading this article carefully. I hope the article "how to implement Inspection, Mount and unmount Operation in Linux disk Management" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

  • How to judge browsers by conditional comments

    This article focuses on "how to use conditional comments to judge browsers". Interested friends may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use conditional comments to judge browsers!

    © 2024 shulou.com SLNews company. All rights reserved.

    12
    Report