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)