最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

redhat linux swap分區(qū)擴(kuò)展的三種方法詳解

  發(fā)布時間:2017-03-19 14:16:09   作者:佚名   我要評論
一些朋友對redhat linux swap分區(qū)擴(kuò)展不知道如何操作?今天小編將為大家?guī)淼氖莚edhat linux swap分區(qū)擴(kuò)展的三種方法詳解!希望對大家會有幫助,有需要的朋友一起去看看吧

redhat linux swap分區(qū)擴(kuò)展的三種方法

swap 介紹:

當(dāng)物理內(nèi)存占用完了后,當(dāng)系統(tǒng)還需要更多的物理內(nèi)存時,物理內(nèi)存中inactive pages ,就move到swap空間。swap 空間是在位于硬盤上的,因此訪問速度較物理內(nèi)存慢。

當(dāng)機(jī)器的物理內(nèi)存發(fā)生變化時,swap 分區(qū)也要做相應(yīng)的擴(kuò)展:

有三種方法可以對swap 分區(qū)進(jìn)行擴(kuò)展:

一、擴(kuò)展正在使用的swap 分區(qū)的邏輯卷(推薦使用此種方式)

二、新建swap 分區(qū),

三、新建swap file,

具體步驟如下:

一、擴(kuò)展正在使用的swap 分區(qū)的邏輯卷

設(shè)定用作swap 分區(qū)的邏輯卷為:/dev/VolGroup00/LogVol01

Disable swapping for the associated logical volume:

# swapoff -v /dev/VolGroup00/LogVol01

Resize the LVM2 logical volume by 256 MB:

# lvm lvresize /dev/VolGroup00/LogVol01 -L +256M

Format the new swap space:

# mkswap /dev/VolGroup00/LogVol01

Enable the extended logical volume:

# swapon -va

Test that the logical volume has been extended properly:

# cat /proc/swaps 或者# free

二、新建swap 分區(qū)

設(shè)定新建的swap 分區(qū)的邏輯卷為:/dev/VolGroup00/LogVol02

Create the LVM2 logical volume of size 256 MB:

# lvm lvcreate VolGroup00 -n LogVol02 -L 256M

Format the new swap space:

# mkswap /dev/VolGroup00/LogVol02

Add the following entry to the /etc/fstab file:

/dev/VolGroup00/LogVol02 swap swap defaults 0 0

Enable the extended logical volume:

# swapon -va

Test that the logical volume has been extended properly:

# cat /proc/swaps 或者# free

三、新建swapfile

通過此種方式進(jìn)行swap 的擴(kuò)展,首先要計算出block的數(shù)目。具體為根據(jù)需要擴(kuò)展的swapfile的大小,以M為單位。block=swap分區(qū)大小*1024, 例如,需要擴(kuò)展64M的swapfile,則:block=64*1024=65536.

然后做如下步驟:

dd if=/dev/zero of=/swapfile bs=1024 count=65536

Setup the swap file with the command:

mkswap /swapfile

To enable the swap file immediately but not automatically at boot time:

swapon /swapfile

To enable it at boot time, edit /etc/fstab to include the following entry:

/swapfile swap swap defaults 0 0

After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps 或者 free.

總結(jié):三種方法都能對swap 分區(qū)進(jìn)行擴(kuò)展,但是推薦使用第一種方法。

相關(guān)文章

最新評論

汽车| 华蓥市| 建水县| 神农架林区| 普安县| 宿州市| 大安市| 新乐市| 台中市| 曲松县| 枣阳市| 苏州市| 沙雅县| 西峡县| 宁德市| 两当县| 绥阳县| 宁乡县| 唐山市| 广州市| 股票| 广元市| 双辽市| 遂昌县| 定结县| 虹口区| 石门县| 宝清县| 清远市| 伊吾县| 将乐县| 罗江县| 平安县| 伊春市| 合川市| 久治县| 盐池县| 连平县| 凭祥市| 白玉县| 建平县|