Linux OPS Practice case-December 20, 2015-December 31 (first time)

Source: Internet
Author: User

1, the creation of a 10G file system, the type of EXT4, requires the boot can be automatically mounted to a separate data/data directory;

(1) Create a new partition

[Email protected] wuzhibin]# FDISK/DEV/SDA

Warning:dos-compatible mode is deprecated. It ' s strongly recommended to

Switch off the mode (command ' C ') and change display units to

Sectors (Command ' u ').

Command (M for help): N

(2) Setting the primary partition

Command Action

E Extended

P primary partition (1-4)

P

(3) Set to 3rd primary partition

Partition number (1-4): 3

(4) Set the partition capacity to 10G

First cylinder (2811-26108, default 2811): 2811

Last cylinder, +cylinders or +size{k,m,g} (2811-26108, default 26108): +10g

(5) Save Settings exit

Command (M for help): W

(6) Use the PARTX-A command to activate the newly partitioned partition so that you do not have to restart your computer

[Email protected] wuzhibin]# partx-a/DEV/SDA

(7) Format the new partition as EXT4

[Email protected] wuzhibin]# mke2fs-t Ext4/dev/sda3

(8) Create/data directory

[Email protected] ~]# Mkdir/data

(9) Set the new Partition's volume label to/data

[Email protected] ~]# E2label/dev/sda3/data

(10) Set to automatically mount the new partition to the/data directory

[Email protected] ~]# Vi/etc/fstab

Add/dev/sda3/data ext4 default 0 0 to the last row, save exit to complete the boot automatically mount/data directory





























Linux OPS Practice case-December 20, 2015-December 31 (first time)

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.