精华内容
下载资源
问答
  • Redhat Linux – LVM Volume Attributes AUGUST 25, 2013BYLINGESWARAN R1 COMMENT LVM How to Install LVM on Linux and Disk Operations Linux – LVM – Volume Group Operations Linux LVM – Volume ...

    Redhat Linux – LVM Volume Attributes

    AUGUST 25, 2013 BY LINGESWARAN R 1 COMMENT


    LVM

     

    Redhat Linux’s Logical volume Manager has many attributes which are available for controlling the behavior LVM objects or to changing the default values of LVM. We may not use those attributes very often in typical production environment but knowing is not a bad thing. As a Unix/Linux admin,we should have capability  to explain each and every field of commands output as most of the fields will reflect the attributes value.Here we will see some of LVM attributes.


     

    Physical volume(PV) attributes:

    To check the physical volume attributes,use “pvs” command.The forth column of pvs command output displays the physical volume attributes.

    [root@mylinz ~]# pvs

      PV         VG        Fmt  Attr PSize   PFree

      /dev/sda2  vg_mylinz lvm2 a-    19.51g      0

      /dev/sdd1  uavg      lvm2 a-   508.00m 408.00m

      /dev/sde   uavg      lvm2 a-   508.00m 508.00m

      /dev/sdf   uavg      lvm2 a-     5.00g   5.00g

    [root@mylinz ~]#

     

    The above command output shows “a” in the attribute field which explains that physical volumes can be “allocated” to the volumes.

    Export the volume group “uavg” and check pvs output.

    [root@mylinz ~]# vgexport uavg

      Volume group "uavg" successfully exported

    [root@mylinz ~]# pvs

      PV         VG        Fmt  Attr PSize   PFree

      /dev/sda2  vg_mylinz lvm2 a-    19.51g      0

      /dev/sdd1  uavg      lvm2 ax   508.00m 408.00m

      /dev/sde   uavg      lvm2 ax   508.00m 508.00m

      /dev/sdf   uavg      lvm2 ax     5.00g   5.00g

    [root@mylinz ~]#

    In attributes field, you can see that “x”  is added now.This show that volume group is exported.

    We can stop the allocation to the disk by using pvchnage command.By disabling allocation,volume will not be extended using that specific physical volume.

    [root@mylinz ~]# pvchange -x n /dev/sdd1

      Physical volume "/dev/sdd1" changed

      1 physical volume changed / 0 physical volumes not changed

    [root@mylinz ~]# pvs

      PV         VG        Fmt  Attr PSize   PFree

      /dev/sda2  vg_mylinz lvm2 a-    19.51g      0

      /dev/sdd1  uavg      lvm2 --   508.00m 408.00m

      /dev/sde   uavg      lvm2 a-   508.00m 508.00m

      /dev/sdf   uavg      lvm2 a-     5.00g   5.00g

    [root@mylinz ~]#

    You can revert the change any time using below mentioned command.

    [root@mylinz ~]#  pvchange -x y /dev/sdd1

      Physical volume "/dev/sdd1" changed

      1 physical volume changed / 0 physical volumes not changed

    [root@mylinz ~]# pvs

      PV         VG        Fmt  Attr PSize   PFree

      /dev/sda2  vg_mylinz lvm2 a-    19.51g      0

      /dev/sdd1  uavg      lvm2 a-   508.00m 408.00m

      /dev/sde   uavg      lvm2 a-   508.00m 508.00m

      /dev/sdf   uavg      lvm2 a-     5.00g   5.00g

    [root@mylinz ~]#

    Some of the useful commands to get the details of physical volume.
    1.To get the physical volumes with  “UID” , use “-v” option.
    Note:You can also use “pvs -vv” to get more detailed information.

    [root@mylinz ~]# pvs -v

     Scanning for physical volume names

      PV      VG   Fmt Attr PSize   PFree  DevSize   PV UUID

    /dev/sdd1 uavg lvm2 ax 508.00m 408.00m 511.98m tJ5YhP-VOZV-yfQ6-Uyye-WGT7-VLcl-7M3RMK

    /dev/sde  uavg lvm2 ax 508.00m 508.00m 512.00m FadWLT-LjD8-v8VB-pboY-eZbK-vYpE-ZWq0i9

    /dev/sdf  uavg lvm2 ax 5.00g   5.00g   5.00g GbvgWh-l0w3-wCA6-umkD-zfsS-8yAZ-GeOSKF

    [root@mylinz ~]#


    2.To get all the disks connected to the system ,use “pvs -a”

    [root@mylinz ~]# pvs -a

      PV                     VG        Fmt  Attr PSize   PFree

      /dev/root                             --        0       0

      /dev/sda1                             --        0       0

      /dev/sda2              vg_mylinz lvm2 a-    19.51g      0

      /dev/sdb1                             --        0       0

      /dev/sdc1                             --        0       0

      /dev/sdd1              uavg      lvm2 ax   508.00m 408.00m

      /dev/sde               uavg      lvm2 ax   508.00m 508.00m

      /dev/sdf               uavg      lvm2 ax     5.00g   5.00g

      /dev/sdg                              --        0       0

      /dev/vg_mylinz/lv_swap                --        0       0

    [root@mylinz ~]#

    /dev/sda1 is not part of LVM but you get the disk list in pvs command.

    3.To get the segment wise output,use below command.

    [root@mylinz ~]# pvs --segments

      PV         VG        Fmt  Attr PSize   PFree   Start SSize

      /dev/sda2  vg_mylinz lvm2 a-    19.51g      0      0  4234

      /dev/sda2  vg_mylinz lvm2 a-    19.51g      0   4234   760

      /dev/sdd1  uavg      lvm2 ax   508.00m 408.00m     0    13

      /dev/sdd1  uavg      lvm2 ax   508.00m 408.00m    13    25

      /dev/sdd1  uavg      lvm2 ax   508.00m 408.00m    38    89

      /dev/sde   uavg      lvm2 ax   508.00m 508.00m     0   127

      /dev/sdf   uavg      lvm2 ax     5.00g   5.00g     0  1279

    [root@mylinz ~]#


     

    Volume Group(VG) Attributes:

    You can see the volume group attributes using vgs command.
    table.tableizer-table { border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif font-size: 12px; } .tableizer-table td { padding: 4px; margin: 3px; border: 1px solid #ccc; } .tableizer-table th { background-color: #104E8B; color: #FFF; font-weight: bold; }

    ATTRIBUTES

    DESCRIPTION

    r,w

    (r)ead & (w)rite permissions

    z

    resi(z)eable

    x

    e(x)ported

    p

    (p)artial

    c,n,a,i

    allocation policy (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited

    c

    (c)luster

    Here we will see sample vgs command output.

    [root@mylinz ~]# vgs

      VG        #PV #LV #SN Attr   VSize  VFree

      uavg        3   1   0 wz--n-  5.99g 5.89g

      vg_mylinz   1   2   0 wz--n- 19.51g    0

    [root@mylinz ~]#

    [root@mylinz ~]# vgs -v

        Finding all volume groups

        Finding volume group "uavg"

        Finding volume group "vg_mylinz"

    VG        Attr   Ext   #PV #LV #SN VSize  VFree VG UUID

    uavg      wz--n- 4.00m   3   1   0  5.99g 5.89g c87FyZ-5DND-oQ3n-iTh1-Vb1f-nBML-vUBUE9

    vg_mylinz wz--n- 4.00m   1   2   0 19.51g    0  dIgmLP-aoe3-anxY-WHYE-bBtX-u28M-WF6Ye5

    [root@mylinz ~]#


    There are some other volume group attributes which will be useful while creating the new volume group.

    table.tableizer-table { border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif font-size: 12px; } .tableizer-table td { padding: 4px; margin: 3px; border: 1px solid #ccc; } .tableizer-table th { background-color: #104E8B; color: #FFF; font-weight: bold; }

    ATTRIBUTES

    DESCRIPTION

    -l

     maximum logical volumes

    -p

    maximum physical volumes

    -s

    physical extent size (default is 4MB)

    -A

    autobackup

    All the above mentioned attributes can be set while creating the volume group.You can not modify those values after that.In the below example,I have used most the  attributes with specific value to create new volume group.

    [root@mylinz ~]# vgcreate   -l 512 -p 256 -s 32M -Ay newvg /dev/sdf

      Volume group "newvg" successfully created

     vgs newvg

      VG    #PV #LV #SN Attr   VSize VFree

      newvg   1   0   0 wz--n- 4.97g 4.97g

    [root@mylinz ~]#

    You can see the newly set values in vgdisplay command output.

    [root@mylinz ~]# vgdisplay -v newvg

        Using volume group(s) on command line

        Finding volume group "newvg"

      --- Volume group ---

      VG Name               newvg

      System ID

      Format                lvm2

      Metadata Areas        1

      Metadata Sequence No  1

      VG Access             read/write

      VG Status             resizable

      MAX LV                512

      Cur LV                0

      Open LV               0

      Max PV                256

      Cur PV                1

      Act PV                1

      VG Size               4.97 GiB

      PE Size               32.00 MiB

      Total PE              159

      Alloc PE / Size       0 / 0

      Free  PE / Size       159 / 4.97 GiB

      VG UUID               Ny4xsv-uJ49-sZr9-lvfq-Oa7n-l5mH-1bPBbp

     

      --- Physical volumes ---

      PV Name               /dev/sdf

      PV UUID               GbvgWh-l0w3-wCA6-umkD-zfsS-8yAZ-GeOSKF

      PV Status             allocatable

      Total PE / Free PE    159 / 159

     

    [root@mylinz ~]#


     

    Logical Volume (LV) Attributes:

    Knowing the logical volume attributes.

    [root@mylinz ~]# lvs

      LV      VG        Attr   LSize   Origin Snap%  Move Log Copy%  Convert

      vol1    uavg      -wi-ao 100.00m

      lv_root vg_mylinz -wi-ao  16.54g

      lv_swap vg_mylinz -wi-ao   2.97g

    [root@mylinz ~]#

    The below tables covers the “lvs” command attributes. table.tableizer-table { border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif font-size: 12px; } .tableizer-table td { padding: 4px; margin: 3px; border: 1px solid #ccc; } .tableizer-table th { background-color: #104E8B; color: #FFF; font-weight: bold; }

    VOLUME TYPE ATTRIBUTES(FIRST FIELD OF ATTR)

    DESCRIPTION

    m

    (m)irrored

    M

    (M)irrored without intial sync

    o

    (o)rgin

    p

    (p)vmove

    s

    (s)napshot

    S

    invalid (S)napshot

    v

    (v)irtual

    i

    mirror (i)mage

    l

    mirror (I)mage without sync

    c

    under (c)onstruction

    Simple Volume

     

    table.tableizer-table { border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif font-size: 12px; } .tableizer-table td { padding: 4px; margin: 3px; border: 1px solid #ccc; } .tableizer-table th { background-color: #104E8B; color: #FFF; font-weight: bold; }

    ATTRIBUTES (SECOND TO SIXTH FIELD OF ATTR)

    DESCRIPTION

    w,r (Second Feild)

    Permissions ‘(r)’ead ‘(w)’rite

    c,I,n.a,I (Third Feild)

    Allocation policy (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited

    m (Fourth Feild)

    Fixed (m)inor

    a,s,I (Fifth Feild)

    (a)ctive, (s)uspended, (I)nvalid snapshot,,

    S (Fifth Feild)

    Invalid (S)uspended snapshot

    I (Fifth Feild)

    Mapped device present with (i)nactive table

    d (Fifth Feild)

    Mapped (d)evice present with-out tables

    o (sixth Feild)

    device (o)pen (Volume is in active state or may be mounted )

     

    While creating the volume can provide various attributes like stripe size,no of extends 

    etc.These are already covered in volume creation.

    Here we will see some of the useful “lvs” command options.
    1.To display the logical volumes with underlying physical volumes use,

    [root@mylinz ~]# lvs -a -o +devices

    LV      VG        Attr   LSize   Origin Snap%  Move Log Copy%  Convert Devices

    vol1    uavg      -wi-ao 100.00m                                   /dev/sdd1(13)

    lv_root vg_mylinz -wi-ao  16.54g                                   /dev/sda2(0)

    lv_swap vg_mylinz -wi-ao   2.97g                                   /dev/sda2(4234)

    [root@mylinz ~]#


    2.To see the complete physical disks segmnets for logical volumes,

    [root@mylinz ~]# lvs -a -o +seg_pe_ranges --segments

      LV      VG        Attr   #Str Type   SSize   PE Ranges

      vol1    uavg      -wi-ao    1 linear 100.00m /dev/sdd1:13-37

      lv_root vg_mylinz -wi-ao    1 linear  16.54g /dev/sda2:0-4233

      lv_swap vg_mylinz -wi-ao    1 linear   2.97g /dev/sda2:4234-4993

    [root@mylinz ~]#


    3.For detailed logical volume information,

    [root@mylinz ~]# lvdisplay --maps /dev/uavg/vol1

      --- Logical volume ---

      LV Name                /dev/uavg/vol1

      VG Name                uavg

      LV UUID                XjMpRC-6f5k-FN9L-jz5v-f0Gj-wBpf-xc9GVD

      LV Write Access        read/write

      LV Status              available

      # open                 1

      LV Size                100.00 MiB

      Current LE             25

      Segments               1

      Allocation             inherit

      Read ahead sectors     auto

      - currently set to     256

      Block device           253:2

     

      --- Segments ---

      Logical extent 0 to 24:

        Type                linear

        Physical volume     /dev/sdd1

        Physical extents    13 to 37

    [root@mylinz ~]#


    Hope this post is informative for you.Thank you for reading this article.Please leave a comment if you have any doubt.I will get back to you.

     

    展开全文
  • Red Hat Enterprise Linux 6 Logical Volume Manager Administration
  • 通过扩展Volume Group、Logical Volume来达到扩展文件系统的大小,     我的服务器是建在虚机的,   分配硬盘空间时,通过修改参数把原来硬盘加大的。   [root@...

    通过扩展Volume Group、Logical Volume来达到扩展文件系统的大小,

     

     

    我的服务器是建在虚机上的,

     

    分配硬盘空间时,通过修改参数把原来硬盘加大的。

     

    [root@localhost ~]# fdisk -l

    Disk /dev/sda: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14        1044     8281507+  8e  Linux LVM

    先创建物理分区

    #fdisk /dev/sda

     

    通n键,创建一个主分区;

    通t键,输入8e转换为LVM分区 

    w键,写入分区表

    Disk /dev/sda: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14        1044     8281507+  8e  Linux LVM
    /dev/sda3            1045        3916    23069340   8e  Linux LVM

     

     

    重启生效,然后创建物理卷(physical volume)

     

    #pvcreate /dev/sda3

      Physical volume "/dev/sda3" successfully created

     

    查看现有的vg

     

    #vgdisplay

     

      --- Volume group ---
      VG Name               VolGroup00
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               7.88 GB
      PE Size               32.00 MB
      Total PE              252
      Alloc PE / Size       250 / 7.81 GB
      Free  PE / Size       2 / 64.00 MB
      VG UUID               Zv74Nv-kqbn-SpF3-yBcg-brXn-2X0G-5mbJcx

    通过vgextend命令扩展现有的vg

     

    #vgextend  VolGroup00 /dev/sda3

       Volume group "VolGroup00" successfully extended

     

    #vgdisplay

     

      --- Volume group ---
      VG Name               VolGroup00
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  4
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               29.88 GB
      PE Size               32.00 MB
      Total PE              956
      Alloc PE / Size       250 / 7.81 GB
      Free  PE / Size       706 / 22.06 GB
      VG UUID               Zv74Nv-kqbn-SpF3-yBcg-brXn-2X0G-5mbJcx

     

     

    #mount

     

    /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
    none on /proc type proc (rw)
    none on /sys type sysfs (rw)
    none on /dev/pts type devpts (rw,gid=5,mode=620)
    /dev/sda1 on /boot type ext3 (rw)
    none on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

    可以看到文件系统的 / 是挂载在/dev/mapper/VolGroup00-LogVol00上的,

    因此,通过改变lv LogVol00的大小来达到给/增减空间的目的。

     

    # lvscan
      ACTIVE            '/dev/VolGroup00/LogVol00' [5.88 GB] inherit
      ACTIVE            '/dev/VolGroup00/LogVol01' [1.94 GB] inherit

    通过lvresize命令扩展Logical Volume

     

    # lvresize -L +22.06G /dev/VolGroup00/LogVol00
      Rounding up size to full physical extent 22.06 GB
      Extending logical volume LogVol00 to 27.94 GB
      Logical volume LogVol00 successfully resized

    调整完后,查看一下文件系统使用情况

    #df -h 

     

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                          5.8G  3.5G  2.1G  63% /
    /dev/sda1              99M   14M   81M  14% /boot
    none                  506M     0  506M   0% /dev/shm

    发现并没有没发生改变

     

    通过ext2online命令在线resize文件系统

     

    #ext2online /dev/mapper/VolGroup00-LogVol00

     

    #df -h

     

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                           28G  3.5G   23G  14% /
    /dev/sda1              99M   14M   81M  14% /boot
    none                  506M     0  506M   0% /dev/shm

    大小调整成功!

     

    检查分区

    #e2fsck /dev/VolGroup00/LogVol00

    展开全文
  • linux-volume.zip

    2020-04-25 10:31:42
    makefile实例应用 linux开源glib/gio库的应用:GVolumeMonitor、GVolume、GMount、GDrive 查看linux系统卷设备/分区信息
  • Using and Administering Linux Volume 2 好资料 Using and Administering Linux Volume 2
  • Linux 扩展LVM下的Volume Group、Logical Volume

    Linux 扩展LVM下的Volume Group、Logical Volume

     

     通过扩展Volume Group、Logical Volume来达到扩展文件系统的大小,

     

     

    我的服务器是建在虚机上的,

     

    分配硬盘空间时,通过修改参数把原来硬盘加大的。

     

    [root@localhost ~]# fdisk -l

    Disk /dev/sda: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14        1044     8281507+  8e  Linux LVM

    先创建物理分区

    #fdisk /dev/sda

     

    通n键,创建一个主分区;

    通t键,输入8e转换为LVM分区 

    w键,写入分区表

    Disk /dev/sda: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14        1044     8281507+  8e  Linux LVM
    /dev/sda3            1045        3916    23069340   8e  Linux LVM

     

     

    重启生效,然后创建物理卷(physical volume)

     

    #pvcreate /dev/sda3

      Physical volume "/dev/sda3" successfully created

     

    查看现有的vg

     

    #vgdisplay

     

      --- Volume group ---
      VG Name               VolGroup00
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               7.88 GB
      PE Size               32.00 MB
      Total PE              252
      Alloc PE / Size       250 / 7.81 GB
      Free  PE / Size       2 / 64.00 MB
      VG UUID               Zv74Nv-kqbn-SpF3-yBcg-brXn-2X0G-5mbJcx

    通过vgextend命令扩展现有的vg

     

    #vgextend  VolGroup00 /dev/sda3

       Volume group "VolGroup00" successfully extended

     

    #vgdisplay

     

      --- Volume group ---
      VG Name               VolGroup00
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  4
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               29.88 GB
      PE Size               32.00 MB
      Total PE              956
      Alloc PE / Size       250 / 7.81 GB
      Free  PE / Size       706 / 22.06 GB
      VG UUID               Zv74Nv-kqbn-SpF3-yBcg-brXn-2X0G-5mbJcx

     

     

    #mount

     

    /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
    none on /proc type proc (rw)
    none on /sys type sysfs (rw)
    none on /dev/pts type devpts (rw,gid=5,mode=620)
    /dev/sda1 on /boot type ext3 (rw)
    none on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

    可以看到文件系统的 / 是挂载在/dev/mapper/VolGroup00-LogVol00上的,

    因此,通过改变lv LogVol00的大小来达到给/增减空间的目的。

     

    # lvscan
      ACTIVE            '/dev/VolGroup00/LogVol00' [5.88 GB] inherit
      ACTIVE            '/dev/VolGroup00/LogVol01' [1.94 GB] inherit

    通过lvresize命令扩展Logical Volume

     

    # lvresize -L +22.06G /dev/VolGroup00/LogVol00
      Rounding up size to full physical extent 22.06 GB
      Extending logical volume LogVol00 to 27.94 GB
      Logical volume LogVol00 successfully resized

    调整完后,查看一下文件系统使用情况

    #df -h 

     

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                          5.8G  3.5G  2.1G  63% /
    /dev/sda1              99M   14M   81M  14% /boot
    none                  506M     0  506M   0% /dev/shm

    发现并没有没发生改变

     

    通过ext2online命令在线resize文件系统

     

    #ext2online /dev/mapper/VolGroup00-LogVol00

     

    #df -h

     

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                           28G  3.5G   23G  14% /
    /dev/sda1              99M   14M   81M  14% /boot
    none                  506M     0  506M   0% /dev/shm

    大小调整成功!

     

    mkfs.ext3 /dev/sda3

     

    mount -t ext3 /dev/sda3 /usr

     

    检查分区

    #e2fsck /dev/VolGroup00/LogVol00

    展开全文
  • Logical Volume Manager在Linux中的应用.pdf
  • vold是LinuxVolume守护程序,可以自动安装CD-ROM,硬盘,USB闪存棒,iPod等。还可以通过UUID或volumename标识分区,并将它们安装在预定义的文件夹中。 旨在用手替换安装!
  • http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) ...Logical Volume Manager (Linux) From Wikipedia, the free encyclopedia "Logical Volume Manager" redirects here. It is not to be c...

    http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)

    Logical Volume Manager (Linux)

    From Wikipedia, the free encyclopedia
     
     

    Linux Logical Volume Manager
    Original author(s)Heinz Mauelshagen
    Stable release3.12.4 (8 December 2013; 1 day ago)[±][1]
    Preview release3.13-rc3(6 December 2013; 3 days ago) [±][2]
    Written inC
    Operating systemLinux
    LicenseGNU GPL
    Websitekernel.org
     

    LVM is a logical volume manager for the Linux kernel; it manages disk drives and similar mass-storage devices. The term "volume" refers to a disk drive or partition thereof. It was originally written in 1998 by Heinz Mauelshagen, who based its design on that of the LVM in HP-UX.

    The installers for the Arch LinuxCrunchBangCentOSDebianFedoraGentooMandrivaMontaVista LinuxopenSUSE,PardusRed Hat Enterprise LinuxSlackwareSLEDSLESLinux Mint, and Ubuntu distributions are LVM-aware and can install a bootable system with a root filesystem on a logical volume.

     

     

    Common uses[edit]

    LVM is commonly used for the following purposes:

    • Managing large hard disk farms by allowing disks to be added and replaced without downtimes and services disruption, in combination with hot swapping.
    • On small systems (like a desktop at home), instead of having to estimate at installation time how big a partition might need to be in the future, LVM allows file systems to be easily resized later as needed.
    • Performing consistent backups by taking snapshots of the logical volumes.
    • Creating single logical volumes of multiple physical volumes or entire hard disks (somewhat similar to RAID 0, but more similar to JBOD), allowing for dynamic volume resizing.
    • the Ganeti solution stack relies on the Linux Logical Volume Manager

    LVM can be considered as a thin software layer on top of the hard disks and partitions, which creates an abstraction of continuity and ease-of-use for managing hard drive replacement, re-partitioning, and backup.

    Features[edit]

    The LVM can:

    • Resize volume groups online by absorbing new physical volumes (PV) or ejecting existing ones.
    • Resize logical volumes (LV) online by concatenating extents onto them or truncating extents from them.
    • Create read-only snapshots of logical volumes (LVM1).
    • Create read-write snapshots of logical volumes (LVM2).
    • Create RAID logical volumes (since recent LVM implementations, such as Red Hat Enterprise Linux v6 [1]): RAID1, RAID5, RAID6, etc.
    • Stripe whole or parts of logical volumes across multiple PVs, in a fashion similar to RAID 0.
    • Mirror whole or parts of logical volumes, in a fashion similar to RAID 1.
    • Allocate thin-provisioned logical volumes from a pool [2] 
    • Move online logical volumes between PVs.
    • Split or merge volume groups in situ (as long as no logical volumes span the split). This can be useful when migrating whole logical volumes to or from offline storage.

    The LVM will also work in a shared-storage cluster (where disks holding the PVs are shared between multiple host computers), but requires an additional daemon to propagate state changes between cluster nodes.

    Implementation[edit]

    Inner workings of the version 1 of LVM. In this diagram, PE stands for a Physical Extent.
    Relationship between various elements of the LVM.

    LVM keeps a metadata header at the start of every physical volume, each of which is uniquely identified by a UUID. Each PV's header is a complete copy of the entire volume group's layout, including the UUIDs of all other PVs, the UUIDs of all logical volumes and an allocation map of PEsto LEs. This simplifies data recovery in the event of PV loss.

    In the 2.6-series of the Linux Kernel, the LVM is implemented in terms of the device mapper, a simple block-level scheme for creating virtual block devices and mapping their contents onto other block devices. This minimizes the amount of relatively hard-to-debug kernel code needed to implement the LVM. It also allows its I/O redirection services to be shared with other volume managers (such as EVMS). Any LVM-specific code is pushed out into its user-space tools, which merely manipulate these mappings and reconstruct their state from on-disk metadata upon each invocation.

    To bring a volume group online, the "vgchange" tool:

    1. Searches for PVs in all available block devices.
    2. Parses the metadata header in each PV found.
    3. Computes the layouts of all visible volume groups.
    4. Loops over each logical volume in the volume group to be brought online and:
      1. Checks if the logical volume to be brought online has all its PVs visible.
      2. Creates a new, empty device mapping.
      3. Maps it (with the "linear" target) onto the data areas of the PVs the logical volume belongs to.

    To move an online logical volume between PVs on the same Volume Group, use the "pvmove" tool:

    1. Creates a new, empty device mapping for the destination.
    2. Applies the "mirror" target to the original and destination maps. The kernel will start the mirror in "degraded" mode and begin copying data from the original to the destination to bring it into sync.
    3. Replaces the original mapping with the destination when the mirror comes into sync, then destroys the original.

    These device mapper operations take place transparently, without applications or file systems being aware that their underlying storage is moving.

    Caveats[edit]

    Until Linux kernel 2.6.31,[3] write barriers were not supported (fully supported in 2.6.33). This means that the guarantee against filesystem corruption offered by journaled file systems like ext3and XFS was negated under some circumstances.[4]

    See also[edit]

    References[edit]

    1. Jump up^ Kroah-Hartman, Greg (8 December 2013). "Linux 3.12.4 released"Linux kernel mailing list. Retrieved 9 December 2013.
    2. Jump up^ Torvalds, Linus (6 December 2013). "Linux 3.13-rc3"Linux kernel mailing list. Retrieved 6 December 2013.
    3. Jump up^ "Bug 9554 - write barriers over device mapper are not supported". 2009-07-01. Retrieved 2010-01-24.
    4. Jump up^ "Barriers and journaling filesystems"LWN. 2008-05-22. Retrieved 2008-05-28.

    Further reading[edit]

    1. Lewis, AJ (2006-11-27). "LVM HOWTO"Linux Documentation Project. Retrieved 2008-03-04..
    2. US patent 5129088, Auslander, et al., "Data Processing Method to Create Virtual Disks from Non-Contiguous Groups of Logically Contiguous Addressable Blocks of Direct Access Storage Device", issued 1992-7-7 (fundamental patent).
    3. "RedHat Linux: What is Logical Volume Manager or LVM?"techmagazinez.com. 6 August 2013. Retrieved 4 September 2013.
    4. "LVM2 Resource Page"sourceware.org. 8 June 2012. Retrieved 4 September 2013.
    5. "How-To: Install Ubuntu on LVM partitions"Debuntu.org. 28 July 2007. Retrieved 4 September 2013.
    6. "Logical Volume Manager"markus-gattol.name. 13 July 2013.

     

    转载于:https://www.cnblogs.com/baiyw/p/3470326.html

    展开全文
  • Linux LVM(Logical Volume Manager)逻辑卷管理是在Linux2.4内核以上实现的磁盘管理技术 基础概念:物理卷-PV(Pysical Volume)、卷组-VG (Volume Group)、逻辑卷-LV (Logic Volume) 关系:每个物理卷对应一个类型为...
  •  WARNING: Reducing active logical volume to 12.00 GiB  THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce lvoracle? [y/n]: y  Reducing logical volume lvoracle to 12.00 GiB  ...
  • Linux的LVM(Logical Volume Manager)
  • 假设有3个disk 分区(/dev/sda1,/dev/sda2,/dev/sda3),先用2个做一个logical volume,在上面分一个区出来,然后假设这个区数据满了,把另外一个disk 分区弄上去,不丢数据基本概念物理卷物理分区(physical extent)卷组...
  • 四、Linux服务器发现存储划分的磁盘 1.通过重启服务器可以完成磁盘的发现; 2.不重启服务器的情况下,使用命令发现: #echo "- - -" >>/sys/class/scsi_host/host0/scan 使用fdisk -l查看...
  • 案例环境:Oracle Linux Server release 5.7 进入Oracle Linux系统后,在右角点击声音图标时,则会弹出...The volume control did not find any elements and/or devices to control . This means either that y...
  • 系列How to use LVM in LinuxHow to Extend/Reduce LVM’s (Logical Volume Management) in LinuxHow to Take ‘Snapshot of Logical Volume and Restore’ in LVM概述 在Linux中扩展/缩减LVM前面我们已经了解了怎样...
  • Linux LVM(Logical Volume Manager)

    千次阅读 2006-11-27 17:34:00
    假设有3个disk 分区(/dev/sda1,/dev/sda2,/dev/sda3),先用2个做一个logical volume,在上面分一个区出来,然后假设这个区数据满了,把另外一个disk 分区弄上去,不丢数据 基本概念物理卷物理分区(physical extent)卷组...
  • Linux----volume group

    千次阅读 2016-10-13 14:52:20
    http://www.liusuping.com/ubuntu-linux/redhat-linux-lvm.html LVM基本概念 前面谈到,LVM是在磁盘分区和文件系统之间添加的一个逻辑层,来为文件系统屏蔽下层磁盘分区布局,提供一个抽象的盘卷,在盘...
  • Linux挂载报错:Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the ...
  • 系列How to use LVM in LinuxHow to Extend/Reduce LVM’s (Logical Volume Management) in LinuxHow to Take ‘Snapshot of Logical Volume and Restore’ in LVM在 LVM中 录制逻辑卷快照并恢复LVM快照是以空间换...
  • 关于linux 的文件系统卷标(volume label)

    千次阅读 2012-02-16 15:12:39
    关于linux 的文件系统卷标(volume label) 其实很早就注意到了linux下的/etc/fstab的第一个域已由块设备(/dev/sda1等)变成了LABEL(LABEL=/boot等),今天终于去查了一下LABEL是怎么用的了,如果你还不明白,可参考...
  • RedHat-Linux-Centos-5_Cluster_Logical_Volume_Manager
  • NBU在unix linux上的管理员英文手册。
  • 原文:http://www.cyberciti.biz/faq/howto-setup-debian-ubuntu-linux-iscsi-initiator/Debian / Ubuntu Linux Connect to an iSCSI Volumeby Vivek Gite<!--<! google_ad_client = "pub-782570510
  • Why the volume so big after coping file from Linux to Windows?

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 63,151
精华内容 25,260
关键字:

linux上怎么删除volume

linux 订阅