Swap partition linux file as

Swap partition file as linux
1. Create a swap partition to be used as a file: 1GB swap partition size increases, the command written as follows, where the count is equal to a desired number of blocks (bs * count = file size).
dd if = / dev / zero of = / var / swapfile bs = 2M count = 1024

2. formatted as a swap file:
mkswap / var / swapfile # establish a swap file system

3. Enable the swap file:
swapon / var / swapfile # Enable swap file

4. Enable the system to boot from the added line in the file / etc / fstab are:
/ var / Defaults the swap the swap the swapfile 0 0

Guess you like

Origin blog.51cto.com/zhizhimao/2403479