OS 기술/Linux

LVM이 NOT available 상태일 때

DongT 2023. 9. 27. 11:53
728x90
반응형

시나리오

- 증상 : fstab 등록된 디바이스가 마운트되지 않음

- 점검1 : lvdisplay에서 확인되는 LV Path 존재하지 않음

[root@ DBS01]# ls -l /dev/dataVG/oradata
ls: cannot access /dev/dataVG/oradata: No such file or directory

- 점검2 : lvdisplay에서 LVM상태가 NOT available (정상 : available)

 


정상 LVM 비정상 LVM 비교 확인

[비정상 LVM]

[root@DBS01]# lvdisplay -v /dev/dataVG/oradata
    DEGRADED MODE. Incomplete RAID LVs will be processed.
    Using logical volume(s) on command line
  --- Logical volume ---
  LV Path                /dev/dataVG/oradata
  LV Name                oradata
  VG Name                dataVG
  LV UUID                Eje5UK-UDJU-SwP4-FOmG-O7dZ-NEy6-JJW63o
  LV Write Access        read/write
  LV Creation host, time DBS01, 2016-01-20 16:41:47 +0900
  LV Status              NOT available   <--  비정상
  LV Size                599.99 GiB
  Current LE             153597
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto

[정상 LVM]

[root@ DBS01]# lvdisplay -v /dev/backupVG/orabackup
    DEGRADED MODE. Incomplete RAID LVs will be processed.
    Using logical volume(s) on command line
  --- Logical volume ---
  LV Path                /dev/backupVG/orabackup
  LV Name                orabackup
  VG Name                backupVG
  LV UUID                RyO7Cd-V104-BhV5-koOg-mNcQ-YjXq-ReNu8y
  LV Write Access        read/write
  LV Creation host, time DBS01, 2016-01-20 16:42:06 +0900
  LV Status              available   <--  정상
  # open                 1
  LV Size                700.00 GiB
  Current LE             179200
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:4

 


 

해결방법

비정상 LVM에서 논리볼륨을 활성화해준다

lvchange -ay "LVM 논리볼륨 경로"
 * 논리볼륨 경로는 lvdiaplay에서 LV path 값으로 확인 가능
[root@ DBS01]# lvchange -ay /dev/dataVG/oradata
[root@ DBS01]# lvdisplay -v /dev/dataVG/oradata
    DEGRADED MODE. Incomplete RAID LVs will be processed.
    Using logical volume(s) on command line
  --- Logical volume ---
  LV Path                /dev/dataVG/oradata
  LV Name                oradata
  VG Name                dataVG
  LV UUID                Eje5UK-UDJU-SwP4-FOmG-O7dZ-NEy6-JJW63o
  LV Write Access        read/write
  LV Creation host, time DBS01, 2016-01-20 16:41:47 +0900
  LV Status              available
  # open                 0
  LV Size                599.99 GiB
  Current LE             153597
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:11

 

 


 

최초 목적인 마운트 정상 확인

[root@ DBS01]# mount /DBDATA
[root@ DBS01]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/dataVG-oradata
                      591G  432G  132G  77% /DBDATA

 

 


만약 반대로 논리볼륨을 비활성화 하고 싶다면

[root@ DBS01]# umount /MDMDBDATA
[root@ DBS01]# lvchange -an /dev/dataVG/oradata
[root@ DBS01]# lvdisplay -v /dev/dataVG/oradata
    DEGRADED MODE. Incomplete RAID LVs will be processed.
    Using logical volume(s) on command line
  --- Logical volume ---
  LV Path                /dev/dataVG/oradata
  LV Name                oradata
  VG Name                dataVG
  LV UUID                Eje5UK-UDJU-SwP4-FOmG-O7dZ-NEy6-JJW63o
  LV Write Access        read/write
  LV Creation host, time DBS01 , 2016-01-20 16:41:47 +0900
  LV Status              NOT available
  # open                 0
  LV Size                599.99 GiB
  Current LE             153597
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:11
[root@ DBS01]# ls -l /dev/dataVG/oradata
ls: cannot access /dev/dataVG/oradata: No such file or directory

(반드시 해당 경로는 언마운트 및 미사용 상태여야한다)

근데 비활성화는 쓸일 있을지 모르겠다.

728x90