Linux Study notes third week fifth class (February 9)

Source: Internet
Author: User

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)

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.