Linex 5 - Chapter VII

1, two new SCSI 30GB hard disk of the host
[root @ localhost ~] # fdisk -l
Disk /dev/sdb:32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte

Disk /dev/sdc:32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte

Disk /dev/sda:42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte
disk label type: DOS
disk identifier: 0x000bb981
2, divided into three primary partitions, each 5GB, the remaining space for the extended partition
   device the Start End Blocks Id the System the Boot
/ dev / sdb1 2048 10,487,807 5242880 83 the Linux
/ dev / sdb2 10,487,808 20,973,567 5242880 83 the Linux
/ dev / sdb3 20,973,568 31,459,327 5242880 83 the Linux
/ dev / sdb4 31,459,328 62,914,559 15,727,616. 5 extended
. 3, to establish two logical partitions in the extended partition, capacities of 2GB, 10GB
   device Boot Start End Blocks Id System
/ dev / sdb1 2048 10,487,807 5242880 83 the Linux
/ dev / sdb2 10,487,808 20,973,567 5242880 83 the Linux
/ dev / sdb3 20,973,568 31,459,327 5242880 83 the Linux
/ dev / sdb4 31,459,328 62,914,559 15,727,616. 5 Extended
/ dev / sdb5 31,461,376 35,655,679 2097152 83 the Linux
/ dev / sdb6 35,657,728 10485760 83 the Linux 56,629,247
. 4, the type of the first logical partition to the swap
/ dev / 2097152 82 35,655,679 31,461,376 sdb5 the swap the Linux / the Solaris
. 5, the first partition is formatted as a primary ext4
[the root @ localhost ~] # the mkfs - ext4 T / dev / sdb1
. 6, the second primary partition as XFS
[the root @ localhost ~] # XFS the mkfs -t / dev / sdb2
. 7, the third primary partition as the FAT32
[the root @ localhost ~ ] # mkfs -t vfat -F 32 / dev / sdb3
8, create / DATAl / DATA2 / DATA3
[the root @ localhost ~] # mkdir / DATAl
[the root @ localhost ~] # mkdir / DATA2
[the root @ localhost ~] # mkdir / DATA3
. 9, the first partition is mounted to a main / data1, create a file test in a directory, and implement / etc / fstab
[root @ localhost ~] # Mount / dev / sdb1 / data1
[root @ localhost ~] # Mount / dev / sdb1
Mount: / dev / sdb1 have hung carrier or / data1 busy
       / dev / sdb1 has been mounted on / data1
[the root @ localhost ~] # DF -ht
/ dev / sdb1 ext4 20M 4.6G 4.8G. 1% / data1
10, the second primary partition mounted to / data2, create a file test in a directory, and implement / etc / fstab
[root @ localhost ~] # Mount / dev / sdb2 / data2
[root @ localhost ~] # Mount / dev / sdb2
Mount: / dev / sdb2 already or mount / data2 busy
       / dev / sdb2 has been mounted to / data2 on
/dev/sdb2               xfs       5.0G   33M  5.0G    1% /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 -a/dev/sdb2 /data3
[root@localhost ~]# blkid /dev/sdb2
/dev/sdb2: UUID="b8d60a47-b52f-4620-a331-e897356fd31c" TYPE="xfs"
 

12, the first logical partition formatting a format swap, the swap partition extend, test to see
[root @ localhost ~] # mkswap / dev / sdb5 --------- // create file sorting system
is provided swap version 1, size = 2097148 KiB
no label, UUID = a4dbd2f7-5ecd-470c-a0b4 -16b673df0236
root @ localhost ~] # swapon -s --------- // Check
the file permissions name type size has been with        
/ dev / dm-1 partition 2097148 0 -1

[root @ localhost ~] # swapon / dev / sdb5 --------- // activation
[root @ localhost ~] # swapon -s ------------ // View
files name type size used permission
/ dev / DM-2,097,148 Partition 0. 1 -1
/ dev / sdb5 2,097,148 Partition 0 -2
[the root @ localhost ~] # CAT / proc / meminfo | grep -i "SwapTotal"
SwapTotal: 4194296 kB

13, by xftp other tools linux.iso reached linux virtual machine, and mount view the content

[root @ localhost ~] # Mount / dev / SR0 / Media /      
Mount: / dev / SR0 write protection, will be mounted read-only
[root @ localhost ~] # LS / Media /
CentOS_BuildTag the GPL LiveOS RPM-GPG-KEY . 7--CentOS
the EFI Images the Packages the RPM-the GPG-KEY-the CentOS-Testing. 7-
the EULA the isolinux the repodata TRANS.TBL

14, based on papers will expand 500M SWAP 
[root @ localhost ~] # dd if = / dev / zero of = / sw bs = 1M count = 500
the recording 500 + 0 read into
the recording to write a 0 + 500
524 288 000 bytes (524 MB) have been copied, 3.28226 seconds, 160 MB / sec
[root@localhost ~]# mkswap /sw
We are setting up swap space version 1, size = 511996 KiB
No label, UUID = bab8c32e-1eb8-465b-b719-043143ff12fe
[root@localhost ~]# swapon /sw
swapon: / sw: unsafe permissions 0644, we recommended 0600.
[root@localhost ~]# swapoff /sw
[root@localhost ~]# swapon /sw
swapon: / sw: unsafe permissions 0644, we recommended 0600.
[root@localhost ~]# cat /proc/meminfo | grep -i "swaptotal"
SwapTotal:       4706292 kB

Guess you like

Origin www.cnblogs.com/shao123-/p/11278759.html
Recommended