/Etc/fstab file analysis (version 2)

Source: Internet
Author: User
/Etc/fstab file Analysis

 

As mentioned above, the new partition will expire after the system is restarted. To take effect permanently, you need to write it to the/etc/fstab file.

 

I./etc/fstab file format: 6 components

 

Physical partition name/volume label mount point file system default settings check Sequence

UUID = 6e428a.../ext4 defaults 1 1

Label = // ext4 defaults 1/0 0/1/2

/Dev/sda1

 

2. Write partition information to/etc/fstab

/Dev/sdb1/testext4defaults1 [Detection If Data Partition is used] 2 [detection order ratio/back]

In this way, the partition is automatically mounted when the system starts and does not need to be manually mounted.

 

Iii. Marking

E2label/dev/sda1 // query the volume label

E2label/dev/sdb2 Apache // set the volume label

In this case, you can write it to the/etc/fstab file: Change/dev/sdb1 In the first line to label = Apache, which has the same effect [However, it has been proved by experiments that, in centos 6.4, the scalping method is not supported. Remember]

 

4. added the swap Partition Function for swapfile

Scenario: there is no new hard disk, but you still need to increase the space of the SWAp partition...

 

1. mkdir/var/swap

Chmod 700/var/swap // create a directory for storing swap virtual swap space

 

2. dd If =/dev/Zero of =/var/SWAP/file. swp bs = 1024 k count = 10

 

BS [block size] # specify the file block size. UNIX does not support K.

Count # specify the file. SWP file size in BS.

 

Then: dd If =/dev/Zero of =/var/SWAP/file. swp bs = 1024 k count = 10 # specify/var/SWAP/file. the size of the SWP file is 10 MB, and the size of all the file content is 0.

 

[Use this command to create a very large file to test the read/write speed of the disk and test whether the disk is full]

 

3. mkswap/var/SWAP/file. SWP # create a swap space

4. Swapon/var/SWAP/file. SWP # enable the newly created swap space

Swapoff/var/SWAP/file. SWP # disable the swap space]

 

5. Write the swap space to the/etc/swaptab file. The swap space is automatically loaded every time the system starts.

/Var/SWAP/file. SWP swap defaults 0 0

 

Attachment-disk Copy command

Dd If =/dev/SDA of =/dev/SDB realize Disk/dev/SDA and/dev/SDB copying

 

Appendix-free view memory information

Free-M #-M is displayed in MB, and-G is displayed in G.

 

Appendix-two pseudo devices in Linux

/Dev/Zero: input 0 to the file.

/Dev/null File black hole

/Etc/fstab file analysis (version 2)

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.