トップ  >  CentOS  >  swap領域拡張

swap領域拡張

swap領域を拡張する方法

    ○swap領域の拡張
    ※本手順では、一度swap領域を外すため負荷状況に気をつけて作業してください
  1. swap領域の一覧を表示する
    # swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/mapper/VolGroup00-LogVol01         partition       524280  0       -1
    
  2. メモリ状況を確認します
    # free
                 total       used       free     shared    buffers     cached
    Mem:        255004     251120       3884          0      11600     168480
    -/+ buffers/cache:      71040     183964
    Swap:       524280         76     524204
    
  3. 一度swap領域を無効化します
    # swapoff /dev/mapper/VolGroup00-LogVol01
    
  4. メモリ状況を確認します
    # free
                 total       used       free     shared    buffers     cached
    Mem:        255004     250888       4116          0      11308     169028
    -/+ buffers/cache:      70552     184452
    Swap:            0          0          0
    
  5. swap領域を拡張します(512MB→1GB)
    # lvextend -L 1G /dev/mapper/VolGroup00-LogVol01
      Extending logical volume LogVol01 to 1.00 GB
      Logical volume LogVol01 successfully resized
    
  6. swap領域準備します
    # mkswap /dev/mapper/VolGroup00-LogVol01
    Setting up swapspace version 1, size = 1073737 kB
    
  7. swap領域を有効化します
    # swapon /dev/mapper/VolGroup00-LogVol01
    
  8. メモリ状況を確認します
    # free
                 total       used       free     shared    buffers     cached
    Mem:        255004     243956      11048          0      11252     161740
    -/+ buffers/cache:      70964     184040
    Swap:      1048568          0    1048568
    

 


    ○swap領域の縮小
    ※本手順では、一度swap領域を外すため負荷状況に気をつけて作業してください
  1. swap領域の一覧を表示する
    # swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/mapper/VolGroup00-LogVol01         partition       1048568 0       -2
    
  2. メモリ状況を確認します
    # free
                 total       used       free     shared    buffers     cached
    Mem:        255004     243956      11048          0      11252     161740
    -/+ buffers/cache:      70964     184040
    Swap:      1048568          0    1048568
    
  3. 一度swap領域を無効化します
    # swapoff /dev/mapper/VolGroup00-LogVol01
    
  4. swap領域を削除します(縮小出来ない為)
    # lvremove  /dev/mapper/VolGroup00-LogVol01
    Do you really want to remove active logical volume LogVol01? [y/n]: y
      Logical volume "LogVol01" successfully removed
    
  5. swap領域を作成します
    # lvcreate -L 512M -n LogVol01 VolGroup00
      Logical volume "LogVol01" created
    
  6. swap領域準備します
    # mkswap /dev/mapper/VolGroup00-LogVol01
    Setting up swapspace version 1, size = 536866 kB
    
  7. swap領域を有効化します
    # swapon /dev/mapper/VolGroup00-LogVol01
    
  8. メモリ状況を確認します
    # free
                 total       used       free     shared    buffers     cached
    Mem:        255004     248516       6488          0      11444     168812
    -/+ buffers/cache:      68260     186744
    Swap:       524280          0     524280
    
プリンタ用画面
友達に伝える
前
ルーティングテーブルの設定
カテゴリートップ
CentOS
次
yumでproxyを使用