婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > Linux系統(tǒng)怎么調(diào)整swap分區(qū)大小?

Linux系統(tǒng)怎么調(diào)整swap分區(qū)大小?

熱門標(biāo)簽:申請(qǐng)400電話流程好嗎 柯城手機(jī)地圖如何做地圖標(biāo)注 軟件電話機(jī)器人 襄陽(yáng)地圖標(biāo)注店 萊蕪移動(dòng)外呼系統(tǒng) 金華呼叫中心外呼系統(tǒng)廠家 小語(yǔ)股票電銷機(jī)器人 高德地圖標(biāo)注在電腦上 杭州電銷機(jī)器人有效果嗎

這里介紹Linux系統(tǒng)中調(diào)整swap大小的方法。

1、使用free命令帶上m參數(shù),查看swap文件大小,官方建議在RAM是2到4.5G時(shí),swap是RAM的2倍;如果RAM大于等于4G則swap等于RAM即可

2、也可用cat 查看etc目錄下的swaps文件,如下圖

3、創(chuàng)建一個(gè)swap文件

復(fù)制內(nèi)容到剪貼板
  1. ########   
  2.   
  3. dd if=/dev/zero of=/tmp/swap bs=1MB count=1024   
  4.   
  5. ########  

以下僅供參考:不用看

Creating a swap file

First of, make sure the file system the disk you wish to swap on is properly mounted. For the purposes of this tutorial we will assume the disk is mounted as /mnt and we want to use the file /mnt/myswap.swp for swapping.

使用下面的命令創(chuàng)建一個(gè)1G的swap文件

復(fù)制內(nèi)容到剪貼板
  1. Use the following command to create a 1024MB file that we will use for swapping   
  2.   
  3. ########   
  4.   
  5. dd if=/dev/zero of=/mnt/myswap.swp bs=1024MB count=1   
  6.   
  7. ########  

4、制作一個(gè)swap文件,如果覺(jué)得繁瑣,可以將mkswap文件掛載到tmp目錄下,例如:

復(fù)制內(nèi)容到剪貼板
  1. ########   
  2.   
  3. mkswap /tmp/swap   
  4.   
  5. ########  

以下僅供參考:不用看

Preparing the swap file

Before we enable the swap file we must first set it up. The following command accomplishes just that:

########

mkswap /mnt/myswap.swp

########

5、使用swapon 啟動(dòng)/tmp/swap

復(fù)制內(nèi)容到剪貼板
  1. ########   
  2.   
  3. swapon /tmp/swap   
  4.   
  5. ########  

使用一個(gè)swap分區(qū),如果已經(jīng)有一個(gè)swap分區(qū),該步驟可以省略

以下僅供參考:不用看

Using a swap partition

Setting up a swap partition is a bit more difficult, as the partition must be first created then formatted using the linux-swap file system. Once that is done, assuming the swap partition is at/dev/scsi/host0/bus0/target0/lun0/part5 (common for v24 USB drives with mutiple partitions), the only command that needs be issued is:

6、再次使用free查看增加后的swap大小

7、如果只想增加swap大小,請(qǐng)忽略以下的操作,重要?。∪绻皇褂脛偛旁黾拥?G的swap文件,使用下面的swapoff命令,可以關(guān)閉,這樣swap文件就縮小了1G

使用swapoff關(guān)閉swap文件

復(fù)制內(nèi)容到剪貼板
  1. ########   
  2.   
  3. swapoff /tmp/swap   
  4.   
  5. ########  

注意事項(xiàng):如果只想增加swap大小,請(qǐng)忽略第7步的所有操作。

相關(guān)推薦:

linux系統(tǒng)怎么增加swap分區(qū)空間???

CentOS技巧:減小Linux swap分區(qū)的方法

Linux下swap耗盡該怎么辦?如何釋放swap?

標(biāo)簽:九江 臺(tái)州 昌都 海東 優(yōu)質(zhì)穩(wěn)定 孝感 玉樹(shù) 哈密

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux系統(tǒng)怎么調(diào)整swap分區(qū)大小?》,本文關(guān)鍵詞  Linux,系統(tǒng),怎么,調(diào)整,swap,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Linux系統(tǒng)怎么調(diào)整swap分區(qū)大小?》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Linux系統(tǒng)怎么調(diào)整swap分區(qū)大小?的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 怀安县| 察哈| 白玉县| 中西区| 二手房| 遂昌县| 华安县| 平安县| 新密市| 长沙市| 广河县| 徐州市| 闵行区| 杭锦后旗| 大名县| 昌江| 寻乌县| 大城县| 广灵县| 临桂县| 台南县| 慈利县| 应用必备| 东海县| 唐山市| 绵阳市| 和林格尔县| 忻城县| 曲阜市| 津市市| 瓦房店市| 宣汉县| 木里| 通山县| 襄城县| 浙江省| 高雄县| 新建县| 南郑县| 高雄县| 沭阳县|