• <tr id='5sete'><strong id='5sete'></strong><small id='5sete'></small><button id='5sete'></button><li id='5sete'><noscript id='5sete'><big id='5sete'></big><dt id='5sete'></dt></noscript></li></tr><ol id='5sete'><table id='5sete'><blockquote id='5sete'><tbody id='5sete'></tbody></blockquote></table></ol><u id='5sete'></u><kbd id='5sete'><kbd id='5sete'></kbd></kbd>
  • <dl id='5sete'></dl>

    <code id='5sete'><strong id='5sete'></strong></code>
      1. <ins id='5sete'></ins>
        <acronym id='5sete'><em id='5sete'></em><td id='5sete'><div id='5sete'></div></td></acronym><address id='5sete'><big id='5sete'><big id='5sete'></big><legend id='5sete'></legend></big></address>

        <fieldset id='5sete'></fieldset>

        1. <span id='5sete'></span>
          <i id='5sete'></i>
        2. <i id='5sete'><div id='5sete'><ins id='5sete'></ins></div></i>

          1. redhat linux swap分区扩展的方法有哪些

            • 时间:
            • 浏览:7
            • 来源:124软件资讯网

                redhat linux swap分区扩展的三种要领

                swap 先容:

                当物理内存占用完了后  ,当系统还需要更多的物理内存时  ,物理内存中inactive pages  ,就move到swap空间  。swap 空间是在位于硬盘上的  ,因此会见速率较物理内存慢 。

                当机械的物理内存发生转变时 ,swap 分区也要做响应的扩展:

                有三种要领可以对swap 分区举行扩展:

                一、扩展正在使用的swap 分区的逻辑卷(推荐使用此种方式)

                二、新建swap 分区  ,

                三、新建swap file ,

                详细步骤如下:

                一、扩展正在使用的swap 分区的逻辑卷

                设定用作swap 分区的逻辑卷为:/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 分区

                设定新建的swap 分区的逻辑卷为:/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

                通过此种方式举行swap 的扩展 ,首先要盘算出block的数目 。详细为凭据需要扩展的swapfile的巨细  ,以M为单元  。block=swap分区巨细*1024, 例如  ,需要扩展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.

                总结:三种要领都能对swap 分区举行扩展 ,可是推荐使用第一种要领 。