4.5/4.6 disk Formatting
CentOS7 with XFS as the default file system;
MKE2FS,MKFS.EXT2,MKFS.EXT3,MKFS.EXT4,MKFS.XFS are formatted commands;
Mke2fs-t Ext4 ==mkfs.ext4; similar to other commands, the XFS type is not supported by MKE2FS temporarily;
The MKE2FS command options are as follows:
-t specifies the file system type;
-b specifies block size blocks;
-m specifies the percentage of the size reserved for the partition;
-I specifies the number of bytes corresponding to an inode;
Partition format, specify file system type EXT4, block size 2048B, reserved size 0.1%, command for #mke2fs-t ext4-b 2048-m 0.1/dev/sdb1;
The partition is formatted in XFS format and the command is #mkfs.xfs/dev/sdb;
4.7/4.8 Disk Mount
View partition file system type, command for #blkid/dev/sdb;
Format disk partition, need to mount before access; Mount point is a directory;
Mount command for #mount partition mount point;
For example command #mount/dev/sdb/mnt/;
View mount condition, command for #df-h;
Mount command common options:
Defaults default, rw readable writable, SUID settings Uid,dev device related, exec executable, auto mount, Nouser can not be normal user mount, async not real-time synchronization, sync real-time sync update;
-o Specifies which features of the mounted partition, such as Ro,sync,remount;
/etc/fstab mounted partition configuration file; view edit #vi/etc/fstab;
Specific explanation, can #man fstab;
View uuid, command for #blkid/dev/sdb;
Unmount the disk, followed by the disk partition, the command is #umount/dev/sdb;
Unmount the disk, followed by the mount point, the command is #umount-l/mnt/;
4.9 Adding swap space manually
The idea of adding a virtual disk is to create a swapfile----format the swap format----enable the virtual disk;
Establish Swapfile, command for #dd If=/dev/zero of=/tmp/newdisk bs=1m count=1024;
DD Disk read-write command, if specified source,/dev/zero can continuously provide "0", of the specified target file, BS definition block size, count definition block number, target file size =bs * count;
View file size, command for #du-sh/tmp/newdisk;
format to swap format, command for #mkswap-f/tmp/newdisk;
Mount swap partition, command for #swapon/tmp/newdisk;
View memory usage, command for #free-m;
Free view Memory Usage command, M for display in megabytes;
Unmount the swap partition, the command is #swapoff/tmp/newdisk;
Linux Study notes third week fifth class (February 9)