Hard disk partition, mount, virtual memory expansion

1, the new two 30GB SCSI hard disk for the host
2, divided into three primary partitions, each 5GB, the remaining space as the extended partition
[root @ localhost ~] # fdisk / dev / sdb
command (input m to get help): n-   
the Select (default P): P
Last sector, sector + region or + size {K, m, G} (2048-209715199, default 209715199): + 5G
partition Linux type is set to 1, the size is set to 5 GiB
ditto
ditto
command (input m to get help): n-
the Select (default e): e
then return times
3, to establish two logical partitions in the extended partition, capacities of 2GB, 10GB
command (input m to get help): n-
Last sector, sector + or + size {K, m, G} (31461376-209715199, default 209715199): + 2G
partition 5 has been set to the type of Linux, the size is set to 2 GiB
command (input m to get help): n-
Last sector, sector + or + size {K, m , G} (35657728-209715199, default 209715199): + 10G
partition 6 has been set to the type of Linux, GiB size to 10
. 4, the type of the first logical partition to a swap
command (input m to get help): t
partition number (1-6, default. 6):. 5
Hex Code (Code list all input L): 82
5, the first partition is formatted as a primary ext4
[the root @ localhost ~] # mkfs.ext4 / dev / sdb1
. 6, the second primary partition as XFS
[the root @ localhost ~] # the mkfs.xfs / dev / sdb2
. 7, the third primary partition as the FAT32
[the root @ localhost ~] # 32 the mkfs -F -t vfat / dev / sdb3
. 8, create / DATAl / DATA2 / DATA3
[the root @ localhost ~] # mkdir / data1
[root @ localhost ~] # mkdir / data2
[root @ localhost ~] # mkdir / DATA3
9, the first primary partition to mount / data1, create a file in the directory test, and implement / etc / fstab
[root @localhost ~] # mount / dev / sdb1 / data1
10, the second primary partition to mount / data2, create a file in the directory test, and implement / etc / fstab
[root @ localhost ~] # Mount / dev / sdb2 / data2
11, the second primary partition to mount / data3, create a test file in the directory, and based on the UUID implement / etc / fstab
[root @ localhost ~] # Mount / dev / sdb3 / DATA3
12, the first logical partition formatting a format swap, the swap partition extend, test to see
[the root @ localhost ~] # the mkswap / dev / sdb5
[the root @ localhost ~] # the swapon / dev / sdb5
[the root @ localhost ~] # cat / proc / meminfo | grep -i "swaptotal"
[Root @ localhost ~] # swapoff / dev / sdb5 (canceled)
13, by xftp other tools linux.iso reached linux virtual machine, and mount view the contents of
[root @ localhost ~] # Mount linux.iso aaaa /
[root @ localhost ~] # LS aaaa
14, file-based manner SWAP expand 500M
[the root @ localhost ~] # dd IF = / dev / ZERO of = / ssss BS = 1M COUNT = 500
[the root @ localhost ~] # the mkswap / ssss
[the root @ localhost ~] # the swapon / ssss
[the root @ ~ localhost] # CAT / proc / meminfo | grep -i "SwapTotal"
SwapTotal: 4706292 kB
15, the optical disc contents using a command dd made into iso image
16, view disk usage
17, by using the above commands parted partitioning process over again for another hard
18, try to use a shell script to configure yum warehouse
19, try to use a shell script to configure the httpd service
20, try to use a shell script to achieve 2 to 12 questions

Guess you like

Origin www.cnblogs.com/shenchunbo/p/11275438.html