Linux adds hard disk partition formatting and mounts

Source: Internet
Author: User

Nux disk partition format and Mount

significance : Add a hard disk to the Linux system server

experimental Environment : VirtualBox virtual software + centos6.5

Step One: Add hardware hard drive ( I use virtualBox simulation here )

Start

View the device and Locate the newly added hard drive ID

Fdisk-l

Partition

Fdisk/dev/sdb

Description :

P-- primary partition [1-4] or view existing partition

N-- add a partition

D-- Delete partition

+1G-- allocate 1G space

W-- Save and exit

Partition Completion View

Fdisk-l

Next format

Mke2fs/dev/sdb1

Mke2fs/dev/sdb2

Mke2fs/dev/sdb3

Mke2fs/dev/sdb4

Description :

Linux file system with ext2, ext3, Ext4

CentOS 7 start file system supports XFS for massive data

format to ext2 file system

MKE2FS Hard Drive device - t specify file system

formatted as EXT3/4

MKE2FS Hard Drive device - t ext3

MKE2FS Hard Drive device - t Ext4

Example :

Mke2fs/dev/sdb1-t ext3

Mke2fs/dev/sdb2-t EXT4

Upgrade or format

Mke2fs-j/DEV/SDB1

Mke2fs-j/DEV/SDB2

Mke2fs-j/DEV/SDB3

Mke2fs-j/DEV/SDB4

detect if there is an error and the error will be fixed automatically

E2fsck-p/DEV/SDB1

To view the detailed properties of a partition

Tune2fs-l/DEV/SDB1

Set the maximum number of mounts

Example : setting up to mount up to three times

Tune2fs-c 30

Can see the maximum number of times to mount and the number of mounts mounted

Tune2fs-l Equipment

set up to mount up to days

Tune2fs-i 30D/DEV/SDB1

View

Tune2fs-l

Modify Partition Name

E2LABEL/DEV/SDB1 New name

Example :

E2LABEL/DEV/SDB1 Mydisk1

Tune2fs-l/DEV/SDB1

Mount : after partition formatting , cannot be used directly , need to mount

The first kind of temporary mount

Mount Device - t file system mount point

To create a mount point

Mkdir-p/MNT/MEDIA/SDB1

Mkdir-p/MNT/MEDIA/SDB2

Mkdir-p/MNT/MEDIA/SDB3

Mkdir-p/MNT/MEDIA/SDB4

Mount

Mount/dev/sdb1/mnt/media/sdb1

Mount/dev/sdb2/mnt/media/sdb2

Mount/dev/sdb3/mnt/media/sdb3

Mount/dev/sdb4/mnt/media/sdb4

The second type : the permanent mount server restarts, automatically takes effect , no need to manually mount

Configure /etc/fstab

Make the Mount effective

Mount-a

View mounts such as partition file system

Mount

Can see hard disk information

Df-h

To use the hard drive after mounting :

Etc/fstab Configuration Instructions

/DEV/SDB1/MNT/MEDIA/SDB1 ext3 defaults 0 0

first item : equipment

Second Item : mount point is a directory

Third Item : file System

Item Fourth : file system Parameters

Item Fifth : whether to back up

Sixth : whether to detect sectors from fsck

Knowledge :

SDA the first hard drive has sda1 under its partition , Sda2

SDB second hard drive has sdb1, SDB2, SDB3, SDB4 under its partition

end/

Linux adds hard disk partition formatting and mounts

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.