Linux Basics-23, File system Management

Source: Internet
Author: User

################################################

Re-creating the file system will damage the original file


Mkfs:make File System

-T


Mkfs-t ext2 =mkfs.ext2

Mkfs-t ext3 =MKFS.EXT3

Mkfs-t Ext4 =MKFS.EXT4


################################################

File system type

Ext2

Ext3

Ext4


################################################

To view the file system types supported by the current kernel

[Email protected] ~]# Cat/proc/filesystems


################################################

Specially managed ext System file System

Mke2fs

-j: Creating a ext3 Type file system

-B: Specify block size, default 4096, support 1024 2048 4096

-L Label: Specifies the partition volume label

-M #: Percentage of blocks assigned to super users

-I #: Specify how many bytes of space, default 8196, given the number should be greater than the block size of 2^n times

-N #: Specify Inode Count

-F: Force file system creation

-E: User-specified additional file system properties


################################################

Blkid: Querying related properties of disk devices

[Email protected] ~]# Blkid

/dev/sda2:uuid= "1012c420-a3f3-49df-96ec-8342d49d29f6" type= "Ext4"

/dev/sda1:uuid= "C572a53a-3098-4086-a32b-21e616343a99" type= "Ext4"

/dev/sda3:uuid= "4e29d3a8-7004-446b-b693-1f124848aa82" type= "Ext4"

/dev/sda5:uuid= "E01b088a-20f1-4ae5-a9e4-b72d0cb97eab" type= "Ext4"

/dev/sda6:uuid= "A65c442f-2a9e-407e-8422-1192e08b85ee" type= "swap


################################################

E2label: Used to view or define volume labels

E2label device File Volume Label: Set Volume label


################################################

TUNE2FS: Adjusting the file system's related properties

-J: ext2 upgrade to ext3 without compromising the original data

-L Label: set or modify volume label

-M #: adjust reserve percentage

-R #: Specifies the number of blocks reserved

-O: Set default mount Options

Acl

-C #: Specifies that the mount count reaches # times after self-test, 0 or 1 means turn off this feature

-I #: a self-test with a number of days after each mount, 0 or 1 means to turn off this feature

-L: Show information in super fast

[Email protected] ~]# tune2fs-l/DEV/SDA5


################################################

DUMPE2FS: Displaying File System Properties

[Email protected] ~]# DUMPE2FS/DEV/SDA5

-H: Show only Super block information

[Email protected] ~]# dumpe2fs-h/DEV/SDA5


################################################

Fsck: Checking and repairing the Linux file system

-T: Specify File system type

-A: Automatic repair


################################################

E2FSCK: Dedicated to repairing Ext2/ext3 file system

-F: Forced check

-P: Automatic repair


################################################

Mount: Associate a new file system to the current root file system

Uninstall: Remove the association of a file system from the current root file system


Mount: Mount device

Usage

Umount: Device mount point

Equipment

Device file:/dev/sda5

Volume Label: label= ""

Uuid:uuid= ""

mount point: Directory

Requirements: 1, this directory exists, 2, this directory is not used by other processes, 3, the original files in the directory will be temporarily hidden


################################################

Displays the current mount

[email protected] ~]# mount

/dev/sda2 on/type ext4 (rw)

Proc On/proc type proc (rw)

Sysfs On/sys type SYSFS (rw)

Devpts on/dev/pts type devpts (rw,gid=5,mode=620)

Tmpfs on/dev/shm type Tmpfs (rw,rootcontext= "System_u:object_r:tmpfs_t:s0")

/DEV/SDA1 on/boot type EXT4 (rw)

/dev/sda3 on/home type EXT4 (rw)

/dev/sda5 on/tmp type EXT4 (rw)

None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)


################################################

mount [Options] [-0 options]

-A: Mount all file systems defined in the/etc/fstab file

-N: Use-n does not write information to the/etc/mtab file

-T Type: Specifies the file system type on the device being mounted, and without this option, Monut invokes the file system type of the Blkid command

-R: Read-only mount, common Mount discs

-W: Read-write Mount

-O: Specify additional mount options, which specify the properties of the file system startup

Remount: Re-mount the current file system

RO: Mount as read-only

RW: Read-write Mount


When the mount is complete, the files on the corresponding file system are accessed via the mount point


################################################


Umount: Uninstalling a file system

Umount Equipment | | Mount point

Uninstallation considerations: Mounted devices are not in process use


################################################

[Email protected] ~]# free-m

Total used free shared buffers Cached

mem:1869 608 1260 0 170 195

-/+ buffers/cache:242 1626

swap:255 0 255

################################################

Create swap partition

Mkswap/dev/sda8

-L Label


Swapon/dev/sda8

Swapoff/dev/sda8


################################################

Loopback devices

Loopback using software to emulate hardware

Create an image file


DD Command:

if= Data sources

of= Data storage target

Bs=1

conut=2


This article is from the "James Zhan Linux Advanced ops" blog, so be sure to keep this source http://jameszhan.blog.51cto.com/10980469/1878255

Linux Basics-23, File system Management

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.