Linux Basic (16) file system

Source: Internet
Author: User
Tags uuid disk usage

Common commands related to file systems under Linux are mainly Df,du,fdisk,partprobe,partx,mkfs,blkid,mke2fs,e2label,tune2fs,dumpe2fs,mount,umount,free, Mkswap,swapon,swapoff,fuser

1.df displaying information about the current file system

-H to GB,KB and other human easy-to-understand ways to file system Information

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/84/4F/wKioL1eMjQHgcmBOAAFVNV8DxBc442.jpg-wh_500x0-wm_3 -wmp_4-s_3543445848.jpg "title=" 1.jpg "alt=" Wkiol1emjqhgcmboaafvnv8dxbc442.jpg-wh_50 "/>

2.du shows how much disk space a file occupies and, if it is a directory, recursively displays the disk usage of all files in the directory.

-S shows the total amount of disk space occupied by all files

-h is displayed in GB,KB and other ways

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/84/4F/wKiom1eMjibibbchAADIjZ5BwUI396.jpg-wh_500x0-wm_3 -wmp_4-s_2266455465.jpg "title=" 2.jpg "alt=" Wkiom1emjibibbchaadijz5bwui396.jpg-wh_50 "/>

3.fdisk

FDISK-L view Current disk partition status

The most common feature of Fdisk is to manage disk partitions

Fdisk/dev/sda

P: Displays the partition of the current hardware, including unsaved changes

N: Create a new partition

E: Create an extended partition

P: Create primary partition

D: Delete a partition

W: Save exit

Q: Do not save exit

T: Modify the partition type

L

L: Show all supported types

4.partx or Partprobe notifies the file system to reread the partitioned table when the disk partition is modified (deleted or added) through the FDISK command.

5.MKFS for file system creation

Mkfs:make File System

-T Fstype #后面指定文件系统的类型

Mkfs-t ext2 = mkfs.ext2

Mkfs-t ext3 = Mkfs.ext3

6.Linux provides commands specifically for the file system of the Ext type (EXT2,EXT3,EXT4).

Mke2fs

-j: Creating a ext3 Type file system

-B block_size: Specifies the block size, which defaults to 4096; the available values are 1024, 2048, or 4096;

-L LABEL: Specifies the partition volume label;

-M #: Specifies the percentage of blocks reserved for super users

-I #: To specify how many bytes of space to create an inode, the default is 8192; The value given here should be 2^n times the block size;

-N #: Specifies the number of inode;

-F: Force file system creation;

-E: User Specifies additional file system attributes;

7.blkid: Query or view related properties of disk devices for example: BLKID/DEV/SDA1

UUID View unique identification number of the disk system

Type view file system types

Label to view the volume label of the file system

8.e2label: Used to view or define volume labels

E2label device File Volume Label: Set Volume label

Example: e2label/dev/sda1 bootsection

9.TUNE2FS: Adjusting the file system's related properties

-j: No damage to the original data, the ext2 upgrade to ext3;

-L LABEL: Sets or modifies the volume label;

-M #: Adjust the reserved percentage;

-R #: Specifies the number of reserved blocks;

-O: Set default mount options;

Cc.

-C #: Specify the number of mounts to # times after the self-test, 0 or 1 tables to turn off this function;

-I #: The self-test is performed per mount, and 0 or 1 means that the function is turned off;

-L: Displays the information in the Super block;

10.DUMPE2FS: Displays property information for a file system (a partition is a file system)

-H: Show only information in the Super block

11.mount,umount to mount the Unmount file system, respectively

Mount

Mount Device mount point

Equipment:

Device file:/dev/sda5

Volume Label: label= ""

Uuid:uuid= ""

mount point: Directory

Requirements:

1, this directory is not used by other processes;

2, the catalogue must exist beforehand;

3, the original files in the directory will be temporarily hidden;

When the mount doesn't follow anything, it displays the currently mounted device as well as the mount point.

You can also specify additional options when mounting the file system on Mount

mount [Options] [-o options] DEVICE mount_point

-A: Indicates that all file systems defined in the/etc/fstab file are mounted (common)

-N: By default, the Mount command saves the mounted device information to the/etc/mtab file each time a device is mounted, and using the-N option means that the information is not written to the file when the device is mounted;

-T Fstype: Specifies the type of file system on which the device is being mounted; When this option is not used, Mount invokes the Blkid command to obtain the type of the corresponding file system;

-R: Read-only mount, Mount disc often with this option

-W: Read-write Mount

-O: Specifies the additional mount option, which specifies the properties that the file system enables;

Remount: Re-mount the current file system

RO: Mount as read-only

RW: Read-write Mount

=============================

Umount for uninstalling file systems

Umount device The latter mount point umount/dev/sda1 or Umount/boot

12.free display memory usage in the system

-m displays in MB units

-G displays in GB units

-h is displayed in the most readable way (common)

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/84/4F/wKiom1eMkrfwlNYYAAJy5EcM06M070.jpg-wh_500x0-wm_3 -wmp_4-s_3586071209.jpg "title=" 1.jpg "alt=" Wkiom1emkrfwlnyyaajy5ecm06m070.jpg-wh_50 "/>

13.mkswap Creating swap partitions

Mkswap/dev/sda8

-L LABEL #可以指定卷标

14. Swap partitions cannot be mounted and must be started manually

swapon/dev/sda#

-A: Enable all switching devices defined in the/etc/fstab file

15. Turn off swap partitions

swapoff/dev/sda#

16.fuser: Verifying that a file or socket file is in use by the process

-V: View running processes on a file

-K: kills the process that is accessing the file

-M: Specify files in mounted file system

example, view the process that is accessing 1.txt FUSER-VM 1.txt

Kill all processes that are accessing 1.txt fuser-km 1.txt

FUSER-KM Mount_point: Terminates all processes that are accessing this mount point


This article is from the "thick Product Thin Hair" blog, please make sure to keep this source http://joedlut.blog.51cto.com/6570198/1827445

Linux Basic (16) file system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.