LVM                                                
*   LinWin                    
  4/20/20   LVM                    
                                                   
   
  Home http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/
  Install / Fedora
  cronjobs Disk(s) = Volume Group
  Info (inxi) Partition(s) = Logical Volume
  Desktops
  dnf
  DNS http://www.linux4beginners.info/linux-how-to/quick-how-to-on-logical-volume-manager-lvm/
  firewalld
  LVM Important terms : PV (Physical Volume) VG (Volume Group) LV (Logical Volume)
  LVM2 PV : Physical Voume :  hard disks, harddisk partitions or LUN (Logical Unit Numbers).
  N.Neighbor'd VG : Volume Group :  One physical volume or multiple physical volumes can make one volume group. /dev/sda2 vg_rr /dev/vg_rr/lv_swap' [1.00 GiB] inherit
  NM LV : Logical Volume :  one volume group or multiple volume groups can make one logical volume. /dev/vg_rr/lv_home' [60.28 GiB] inherit
  Wireless /dev/vg_rr/lv_root' [50.00 GiB] inherit
  Services
  Sys Jour [root@RR ~]# pvdisplay   --- Physical volume --- /dev/sdb2 fedora /dev/fedora/swap' [2.00 GiB] inherit
      PV Name               /dev/sdb2 /dev/fedora/root' [34.78 GiB] inherit
      VG Name               fedora
      PV Size               36.78 GiB / not usable 0                          
      Allocatable           yes  
      PE Size               4.00 MiB d   fdisk -l Disk /dev/sdb: 40.0 GB, 40020664320 bytes
      Total PE              9416   255 heads, 63 sectors/track, 4865 cylinders, total 78165360 sectors
      Free PE               1   Units = sectors of 1 * 512 = 512 bytes
      Allocated PE          9415   Sector size (logical/physical): 512 bytes / 512 bytes
      PV UUID               n6bsMD-1THa-eU1Z-rmwe-koDn-fMGq-PhMD5y   I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disk identifier: 0x8bfc5aa4
      --- Physical volume ---  
      PV Name               /dev/sda2      Device Boot      Start            End         Blocks    Id  System
      VG Name               vg_rr   /dev/sdb1   *          2048      1026047       512000   83  Linux
      PV Size               111.30 GiB / not usable 20.00 MiB   /dev/sdb2         1026048    78163967    38568960   8e  Linux LVM
      Allocatable           yes (but full)  
      PE Size               32.00 MiB  
      Total PE              3561  
      Free PE               0   testdisk   Bad sector count
      Allocated PE          3561   Bad relative sector
      PV UUID               VfFleO-j7MM-Ey1P-uw8q-w6QB-BjgE-txa7hX   LBA = 1026048 1089363
     
      Analyse > quick search
    [root@RR ~]# pvscan   PV   /dev/sdb2   VG fedora   lvm2 [36.78 GiB / 4.00 MiB free]  
      PV   /dev/sda2   VG vg_rr    lvm2 [111.28 GiB / 0    free]   Disk /dev/sdb - 40 GB / 37 GiB - CHS 4866 255 63
      Total: 2 [148.06 GiB] / in use: 2 [148.06 GiB] / in no VG: 0 [0   ]  
           Partition                  Start        End    Size in sectors
    http://www.linuxindia.co.in/linux-how-to/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif
http://www.linuxindia.co.in/linux-how-to/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif
 
    [root@RR ~]# vgscan   Reading all physical volumes.  This may take a while...    1 * Linux                      0  32 33        63 221 30    1024000
      Found volume group "fedora" using metadata type lvm2    2 P Linux LVM             63 221 31  4865 122 57   77137920
      Found volume group "vg_rr" using metadata type lvm2  
     
      Deeper Search
    [root@RR ~]# lvscan   ACTIVE /dev/fedora/swap' [2.00 GiB] inherit  
      ACTIVE /dev/fedora/root' [34.78 GiB] inherit     Linux                    0  32 33    63 221 30    1024000
      ACTIVE /dev/vg_rr/lv_swap' [1.00 GiB] inherit     Linux                    0  32 31    63 221 28    1024000
      ACTIVE /dev/vg_rr/lv_home' [60.28 GiB] inherit     Linux                    0  32 31    63 221 28    1024000
      ACTIVE /dev/vg_rr/lv_root' [50.00 GiB] inherit     Linux                    0  32 31    63 221 28    1024000
        Linux                    0  32 31    63 221 28    1024000
        Linux                    0  32 31    63 221 28    1024000
        Linux                    0  32 31    63 221 28    1024000
    http://superuser.com/questions/116617/how-to-mount-an-lvm-volume     Linux                    0  32 31    63 221 28    1024000
        Linux                    0  32 31    63 221 28    1024000
        Linux LVM           63 221 31  4865 122 57   77137920
        Linux Swap          63 253 63   325  19 62    4194288
    [root@RR ~]# lvmdiskscan   /dev/vg_rr/lv_swap [       1.00 GiB]     Linux                 325  20 16  4864 247 55   72933376
      /dev/sda1          [     500.00 MiB]  
      /dev/vg_rr/lv_root [      50.00 GiB]
      /dev/sda2          [     111.30 GiB] LVM physical volume cat testdisk.log
      /dev/fedora/swap   [       2.00 GiB] /dev/dm-3: /dev/mapper/fedora-root:
      /dev/fedora/root   [      34.78 GiB]
      /dev/vg_rr/lv_home [      60.28 GiB]
      /dev/sdb1          [     500.00 MiB]
      /dev/sdb2          [      36.78 GiB] LVM physical volume
      5 disks
      2 partitions
      0 LVM physical volume whole disks
      2 LVM physical volumes
   
   
   
    [root@RR ~]# lvdisplay   --- Logical volume ---
      LV Path                /dev/fedora/swap
      LV Name                swap [root@RR ~]# mount  /dev/dm-3   /mnt/test
      VG Name                fedora
      LV UUID                miBV9f-FwEF-ds3p-I36b-DkIv-EWDD-U845zC mount: wrong fs type, bad option, bad superblock on /dev/mapper/fedora-root,
      LV Write Access        read/write        missing codepage or helper program, or other error
      LV Creation host, time localhost, 2015-11-21 14:05:05 -0600        In some cases useful info is found in syslog - try
      LV Status              available        dmesg | tail or so
      # open                 0
      LV Size                2.00 GiB
      Current LE             512
      Segments               1 [   20.764629] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
      Allocation             inherit [   23.624148] EXT4-fs (dm-4): mounted filesystem with ordered data mode. Opts: (null)
      Read ahead sectors     auto
      - currently set to     256 [ 6213.399958] SGI XFS with ACLs, security attributes, large block/inode numbers, no debug enabled
      Block device           253:2 [ 6213.406057] XFS (dm-3): bad version
    [ 6213.406095] XFS (dm-3): SB validate failed
      --- Logical volume --- [23431.618300] XFS (dm-3): bad version
      LV Path                /dev/fedora/root [23431.618323] XFS (dm-3): SB validate failed
      LV Name                root [24017.231543] XFS (dm-3): bad version
      VG Name                fedora [24017.231565] XFS (dm-3): SB validate failed
      LV UUID                O0CSGl-wbts-KIo1-V2j0-lYJb-XVU2-vW0t4L [33271.424827] XFS (dm-3): bad version
      LV Write Access        read/write [33271.424850] XFS (dm-3): SB validate failed
      LV Creation host, time localhost, 2015-11-21 14:05:06 -0600
      LV Status              available
      # open                 0 [root@RR ~]# cat /proc/partitions
      LV Size                34.78 GiB major minor  #blocks  name
      Current LE             8903
      Segments               1    8        0  117220824 sda
      Allocation             inherit    8        1     512000 sda1
      Read ahead sectors     auto    8        2  116707328 sda2
      - currently set to     256   11        0    1048575 sr0
      Block device           253:3    8       16   39082680 sdb
    l    8       17     512000 sdb1
      --- Logical volume ---    8       18   38568960 sdb2
      LV Path                /dev/vg_rr/lv_swap  253        0    1048576 dm-0
      LV Name                lv_swap  253        1   52428800 dm-1
      VG Name                vg_rr  253        2    2097152 dm-2
      LV UUID                sSBLst-H0Yb-TnxN-VLUe-Ro32-OmTt-f82rha  253        3   36466688 dm-3
      LV Write Access        read/write  253        4   63209472 dm-4
      LV Creation host, time RR, 2001-12-31 18:19:35 -0600
      LV Status              available
      # open                 2 [root@RR mnt]# lsblk
      LV Size                1.00 GiB NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
      Current LE             32
      Segments               1 sda                        8:0    0 111.8G  0 disk
      Allocation             inherit ├─sda1                     8:1    0   500M  0 part /boot
      Read ahead sectors     auto └─sda2                     8:2    0 111.3G  0 part
      - currently set to     256   ├─vg_rr-lv_swap (dm-0) 253:0    0     1G  0 lvm  [SWAP]
      Block device           253:0   ├─vg_rr-lv_root (dm-1) 253:1    0    50G  0 lvm  /
      └─vg_rr-lv_home (dm-4) 253:4    0  60.3G  0 lvm  /home
   
    [root@RR ~]# vgchange -a y fedora sdb                        8:16   0  37.3G  0 disk
      2 logical volume(s) in volume group "fedora" now active ├─sdb1                     8:17   0   500M  0 part
    └─sdb2                     8:18   0  36.8G  0 part
      ├─fedora-swap (dm-2)   253:2    0     2G  0 lvm
      └─fedora-root (dm-3)   253:3    0  34.8G  0 lvm
   
    sr0                       11:0    1  1024M  0 rom
   
   
    [root@RR mnt]# lsblk -f
    NAME                     FSTYPE      LABEL UUID                                   MOUNTPOINT
    sda
    ├─sda1                   ext4              0ded5a4e-bc0f-41d7-a59b-fd5e88b8ed46   /boot
    └─sda2                   LVM2_member       VfFleO-j7MM-Ey1P-uw8q-w6QB-BjgE-txa7hX
      ├─vg_rr-lv_swap (dm-0) swap              fc9a3d84-3e23-4c52-a573-e144a9cdcd29   [SWAP]
      ├─vg_rr-lv_root (dm-1) ext4              dd298357-e517-4cc1-a3b4-d73a674fe63c   /
      └─vg_rr-lv_home (dm-4) ext4              f8b99a10-fe26-4236-9f0c-6f6ad3a93646   /home
    sdb
    ├─sdb1                   ext4              312ce935-e780-4c5b-9025-190504024bb5
    └─sdb2                   LVM2_member       n6bsMD-1THa-eU1Z-rmwe-koDn-fMGq-PhMD5y
      ├─fedora-swap (dm-2)   swap              5b198295-db4c-46eb-a804-635857fe8867
      └─fedora-root (dm-3)   xfs               1884aa47-c304-426e-ac82-0c722524987f
    sr0