Share dry: Linux hard disk partition, mount, format, add to boot start item

Source: Internet
Author: User

0. Create mount Directory

mkdir -p /www

1, confirm whether there is no partition of the disk, such as, no partition of the disk is/DEV/XVDB, in your server may be/dev/vdb note the actual name modification

-l

2, partition for the disk, if partitioned, please skip!

fdisk /dev/xvdb

3. Enter N to start creating the partition

4. Enter p to create the primary partition

5, select the partition number, here enter 1

6. Input partition start position, direct carriage return

7. Input partition end position, direct carriage return

8. Input Wq Save exit

9. Check if partition is successful

-l

10, format the partition, here please enter you see the disk plus partition number, for example, has been formatted, please skip

mkfs.ext4 /dev/xvdb1# (linux老的磁盘分区用的是 ext2 和 ext3  ,现在最新的是 ext4)

11. Add the partition mount information to the boot boot mount

"/dev/xvdb1 /www ext4 defaults 0 0" >> /etc/fstab# 也可以直接修改/etc/fstab文件,在最后加一段# /dev/xvdb1 /www ext4 defaults 0 0

Format Description:

The 1th column is the file system or storage device that needs to be mounted, and/DEV/SDB1 represents which partition

The 2nd column is the mount point

The 3rd column specifies the type of file system or partition, EXT4 is the format of the partition

4th column Mount option, detailed reference Manmount. , defaults is the parameter to be set when mounting (read-only, read-write, enable quota, etc.), input defaults include parameters (rw, dev, exec, auto, nouser, async),

The 5th column is the dump option, which sets whether to let the backup program dump the file system, 0 is ignored, and 1 is a backup.

The 6th column, the FSCK option, tells the FSCK program to check the file system in what order, (2 is the order of the Boot check), the boot system file is 1, and the other file system is 2, if you do not check for 0

12. Re-mount all partitions

-a

13. Check whether the mount is successful

df
 

We recommend a big Data learning group: 593--188--212 has big data learning routes, learning materials, free live lessons

Share dry: Linux hard disk partition, mount, format, add to boot start item

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.