ÉèΪÊ×Ò³ - ¼ÓÈëÊÕ²Ø ASPÕ¾³¤Íø£¨Aspzz.Cn£©- ¿Æ¼¼¡¢½¨Õ¾¡¢¾­Ñé¡¢ÔƼÆËã¡¢5G¡¢´óÊý¾Ý,Õ¾³¤Íø£¡
ÈÈËÑ£º Êý¾Ý ÊÖ»ú ¹«Ë¾
µ±Ç°Î»Ö㺠Ê×Ò³ > ·þÎñÆ÷ > ´î½¨»·¾³ > Windows > ÕýÎÄ

LinuxϵͳÉϽ»»»¿Õ¼äµÄ½éÉÜ(3)

·¢²¼Ê±¼ä£º2018-10-16 19:17 ËùÊôÀ¸Ä¿£º117 À´Ô´£ºDavid Both
µ¼¶Á£ºÒÔÏÂÊÇÔÚ LVM »·¾³ÖÐÔö¼Ó½»»»¿Õ¼ä´óСµÄ²½Öè: ¹Ø±ÕËùÓн»»»¿Õ¼ä¡£ Ôö¼ÓÖ¸¶¨ÓÃÓÚ½»»»¿Õ¼äµÄÂß¼­¾íµÄ´óÐ £ Ϊ½»»»¿Õ¼äµ÷Õû´óСµÄ¾íÅäÖᣠÆôÓý»»»¿Õ¼ä¡£ Ê×ÏÈ£¬ÈÃÎÒÃÇʹÓà lvs ÃüÁÁгöÂß¼­¾í£©À´ÑéÖ¤½»»»¿Õ¼äÊÇ·ñ

ÒÔÏÂÊÇÔÚ LVM »·¾³ÖÐÔö¼Ó½»»»¿Õ¼ä´óСµÄ²½Öè:

  1. ¹Ø±ÕËùÓн»»»¿Õ¼ä¡£
  2. Ôö¼ÓÖ¸¶¨ÓÃÓÚ½»»»¿Õ¼äµÄÂß¼­¾íµÄ´óС¡£
  3. Ϊ½»»»¿Õ¼äµ÷Õû´óСµÄ¾íÅäÖá£
  4. ÆôÓý»»»¿Õ¼ä¡£

Ê×ÏÈ£¬ÈÃÎÒÃÇʹÓà lvs ÃüÁÁгöÂß¼­¾í£©À´ÑéÖ¤½»»»¿Õ¼äÊÇ·ñ´æÔÚÒÔ¼°½»»»¿Õ¼äÊÇ·ñÊÇÂß¼­¾í¡£

  1. [root@studentvm1 ~]# lvs
  2. LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
  3. home fedora_studentvm1 -wi-ao---- 2.00g
  4. pool00 fedora_studentvm1 twi-aotz-- 2.00g 8.17 2.93
  5. root fedora_studentvm1 Vwi-aotz-- 2.00g pool00 8.17
  6. swap fedora_studentvm1 -wi-ao---- 8.00g
  7. tmp fedora_studentvm1 -wi-ao---- 5.00g
  8. usr fedora_studentvm1 -wi-ao---- 15.00g
  9. var fedora_studentvm1 -wi-ao---- 10.00g
  10. [root@studentvm1 ~]#

Äã¿ÉÒÔ¿´µ½µ±Ç°µÄ½»»»¿Õ¼ä´óСΪ 8GB¡£ÔÚÕâÖÖÇé¿öÏ£¬ÎÒÃÇÏ£Íû½« 2GB Ìí¼Óµ½´Ë½»»»¾íÖС£Ê×ÏÈ£¬Í£Ö¹ÏÖÓеĽ»»»¿Õ¼ä¡£Èç¹û½»»»¿Õ¼äÕýÔÚʹÓã¬ÖÕÖ¹ÕýÔÚÔËÐеijÌÐò¡£

  1. swapoff -a

ÏÖÔÚÔö¼ÓÂß¼­¾íµÄ´óС¡£

  1. [root@studentvm1 ~]# lvextend -L +2G /dev/mapper/fedora_studentvm1-swap
  2.   Size of logical volume fedora_studentvm1/swap changed from 8.00 GiB (2048 extents) to 10.00 GiB (2560 extents).
  3.   Logical volume fedora_studentvm1/swap successfully resized.
  4. [root@studentvm1 ~]#

ÔËÐÐ mkswap ÃüÁÕû¸ö 10GB ·ÖÇø±ä³É½»»»¿Õ¼ä¡£

  1. [root@studentvm1 ~]# mkswap /dev/mapper/fedora_studentvm1-swap
  2. mkswap: /dev/mapper/fedora_studentvm1-swap: warning: wiping old swap signature.
  3. Setting up swapspace version 1, size = 10 GiB (10737414144 bytes)
  4. no label, UUID=3cc2bee0-e746-4b66-aa2d-1ea15ef1574a
  5. [root@studentvm1 ~]#

ÖØÐÂÆôÓý»»»¿Õ¼ä¡£

  1. [root@studentvm1 ~]# swapon -a
  2. [root@studentvm1 ~]#

ÏÖÔÚ£¬Ê¹Óà lsblk ÃüÁîÑé֤н»»»¿Õ¼äÊÇ·ñ´æÔÚ¡£Í¬Ñù£¬²»ÐèÒªÖØÐÂÆô¶¯»úÆ÷¡£

  1. [root@studentvm1 ~]# lsblk
  2. NAME                                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  3. sda                                    8:0    0   60G  0 disk
  4. |-sda1                                 8:1    0    1G  0 part /boot
  5. `-sda2                                 8:2    0   59G  0 part
  6.   |-fedora_studentvm1-pool00_tmeta   253:0    0    4M  0 lvm  
  7.   | `-fedora_studentvm1-pool00-tpool 253:2    0    2G  0 lvm  
  8.   |   |-fedora_studentvm1-root       253:3    0    2G  0 lvm  /
  9.   |   `-fedora_studentvm1-pool00     253:6    0    2G  0 lvm  
  10.   |-fedora_studentvm1-pool00_tdata   253:1    0    2G  0 lvm  
  11.   | `-fedora_studentvm1-pool00-tpool 253:2    0    2G  0 lvm  
  12.   |   |-fedora_studentvm1-root       253:3    0    2G  0 lvm  /
  13.   |   `-fedora_studentvm1-pool00     253:6    0    2G  0 lvm  
  14.   |-fedora_studentvm1-swap           253:4    0   10G  0 lvm  [SWAP]
  15.   |-fedora_studentvm1-usr            253:5    0   15G  0 lvm  /usr
  16.   |-fedora_studentvm1-home           253:7    0    2G  0 lvm  /home
  17.   |-fedora_studentvm1-var            253:8    0   10G  0 lvm  /var
  18.   `-fedora_studentvm1-tmp            253:9    0    5G  0 lvm  /tmp
  19. sr0                                   11:0    1 1024M  0 rom  
  20. [root@studentvm1 ~]#

£¨±à¼­£ºASPÕ¾³¤Íø£©

ÍøÓÑÆÀÂÛ
ÍƼöÎÄÕÂ
    ÈȵãÔĶÁ