Linux partition, format file system, mount

Source: Internet
Author: User
Tags disk usage

Before learning Linux, after all, he did not engage in the operation of the dimension, only pay attention to the use of a lot of commands, not too concerned about the file system this piece. Bought a book of Linux, this part of the read something, take a note haha.

There is a scene, for example, our current server is not enough storage, then of course we need to add a hard disk, right.

When you add a hard disk to a Linux drive, you save data to the hard disk, which involves partitioning the hard disk, formatting (giving the file system), and mounting it.

Step is partition (parted)---> Format (MKFS)-----> Mount (Mount)

Partitioning has many tools. For example fdisk,parted wait, you need to know two partition types. One is the traditional old type called MBR, one is now commonly used type GPT.

The simple difference: MBR up to only 4 primary partitions, on the logical partition is also relatively limited (the number of primary partitions, if you want to partition, you need to extract an extended partition, in the extended partition to add logical partition). GPT basically has enough partitions, and the storage size of the partitions is sufficient.

Fdisk This partitioning tool supports only traditional MBR partition types, both of which are supported by the parted partitioning tool.

The use of partition tools, not much to say, this every step is a hint, there are many online manuals.

When I was studying, I saw the video tutorial of Mu-net, good. Sticker Address: http://www.imooc.com/learn/111

After partitioning, to create a filesystem, the MKFS (make file system) is formatted to create the filesystem, which is formatted for the partition of a piece of disk. EXT4 represents a Linux-supported file system.

For example: MKFS.EXT4/DEV/SDF2

/DEV/SDF2 This is the device name.

You such as SDA, SDB, SDC and so on, this is the meaning of the first disk, A is a hard disk, B is the second block ...

For example SDA1 sda2 Sda3 This is the first hard drive, sda1 the first partition, sda2 the second partition ...

After formatting, it is necessary to mount the file system, which is to put a partition device on a mount point. (Mount point is plainly a directory of existence)

The command format is # Mount/dev/sdb1/home/bala

(Here is a knowledge point, mount the command/dev/sdb1 this device name, it is recommended to use the UUID unique identifier, because the device name will change, and the kernel to find the device order)

When a file system is created for a partition, it is assigned a unique UUID.

So how do you know the device name, corresponding to that UUID? There's an order here.

# Blkid #就是block ID to see which device name corresponds to which UUID. Then when mounted, use the UUID instead of the device name haha

File system This piece must refer to the File system table/etc/fstab

Wait here for a moment.

Also refer to the swap partition.

File system This piece summarizes a few common commands, many of the commands have many options parameters, here is not listed.

# parted

# fdisk-l

# MKFS

# Blkid

# mount

# Umount

# Sync # Synchronize, force something in the buffer, write to disk.

# DF # Disk Usage

# du # directory, each file occupies the storage size

# free # view memory and swap partition swap usage

# ls-i # inode Node

# vi/etc/fstab # View File system tables

Linux partition, format file system, mount

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.