トップ 差分 一覧 ソース 検索 ヘルプ PDF RSS ログイン

lvmcache

  • lvmcache を使ってみようとしたができなかった。
  • lvm mirror
[root@c2q nonaka]# lvs -v vg_data/lv_data
   Using logical volume(s) on command line.
 LV      VG      #Seg Attr       LSize Maj Min KMaj KMin Pool Origin Data%  Meta%  Move Cpy%Sync Log            Convert LV UUID                                LProfile
 lv_data vg_data    1 mwi-aom--- 4.48t  -1  -1  253    6                                100.00   [lv_data_mlog]         cs3h1n-Cjhu-RMX6-jaZi-nIhM-rTGZ-lg45ks 
  • SSD /dev/sdk を vg_data に追加
[root@c2q nonaka]# pvcreate /dev/sdk1
 Physical volume "/dev/sdk1" successfully created
[root@c2q nonaka]# vgextend vg_data /dev/sdk1
 Volume group "vg_data" successfully extended
  • lvmcache 作成しようとしたができなかった。
[root@c2q nonaka]# lvcreate -n CacheMetaLV -L 1G vg_data /dev/sdk1
 Logical volume "CacheMetaLV" created.
[root@c2q nonaka]# lvcreate -n CacheDataLV -L 220g vg_data /dev/sdk1
 Logical volume "CacheDataLV" created.
[root@c2q nonaka]# lvs
 LV          VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log            Cpy%Sync Convert
 CacheDataLV vg_data -wi-a----- 220.00g
 CacheMetaLV vg_data -wi-a-----   1.00g
 lv_data     vg_data mwi-aom---   4.48t                                [lv_data_mlog] 100.00
[root@c2q nonaka]# lvconvert --type cache-pool --poolmetadata vg_data/CacheMetaLV vg_data/CacheDataLV
 WARNING: Converting logical volume vg_data/CacheDataLV and vg_data/CacheMetaLV to pool's data and metadata volumes.
 THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert vg_data/CacheDataLV and vg_data/CacheMetaLV? [y/n]: y
 Converted vg_data/CacheDataLV to cache pool.
[root@c2q nonaka]# lvs
 LV          VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log            Cpy%Sync Convert
 lv_bak      vg_bak  -wi-a-----   3.64t
 CacheDataLV vg_data Cwi---C--- 220.00g
 lv_data     vg_data mwi-aom---   4.48t                                [lv_data_mlog] 100.00
[root@c2q nonaka]# lvconvert --type cache --cachepool vg_data/CachePoolLV vg_data/lv_data
 Cache is not supported with mirror segment type of the original logical volume vg_data/lv_data.
  • vg_data/lv_data をどうすれば lvmcache を利用できるか?
  • mirrorlog を解除する必要がある?
[root@c2q nonaka]# pvs -v --segments /dev/sda3 /dev/sdc3 /dev/sdd3 /dev/sde1 /dev/sdg3 /dev/sdj3
   Using physical volume(s) on command line.
   Wiping cache of LVM-capable devices
   Wiping internal VG cache
 PV         VG      Fmt  Attr PSize PFree   Start  SSize  LV                      Start  Type   PE Ranges
 /dev/sda3  vg_data lvm2 a--u 1.80t  32.52g      0 463100 [lv_data_mimage_0]      710148 linear /dev/sda3:0-463099
 /dev/sda3  vg_data lvm2 a--u 1.80t  32.52g 463100      1 [lv_data_mlog_mimage_1]      0 linear /dev/sda3:463100-463100
 /dev/sda3  vg_data lvm2 a--u 1.80t  32.52g 463101    256 [lvol0_pmspare]              0 linear /dev/sda3:463101-463356
 /dev/sda3  vg_data lvm2 a--u 1.80t  32.52g 463357   8326                              0 free
 /dev/sdc3  vg_data lvm2 a--u 1.80t      0       0 471683 [lv_data_mimage_1]      471683 linear /dev/sdc3:0-471682
 /dev/sdd3  vg_data lvm2 a--u 1.80t   1.80t      0      1 [lv_data_mlog_mimage_0]      0 linear /dev/sdd3:0-0
 /dev/sdd3  vg_data lvm2 a--u 1.80t   1.80t      1 471682                              0 free
 /dev/sde1  vg_data lvm2 a--u 2.73t  20.50g      0 710148 [lv_data_mimage_0]           0 linear /dev/sde1:0-710147
 /dev/sde1  vg_data lvm2 a--u 2.73t  20.50g 710148   5248                              0 free
 /dev/sdg3  vg_data lvm2 a--u 1.80t 944.54g      0 229882 [lv_data_mimage_1]      943366 linear /dev/sdg3:0-229881
 /dev/sdg3  vg_data lvm2 a--u 1.80t 944.54g 229882 241801                              0 free
 /dev/sdj3  vg_data lvm2 a--u 1.80t      0       0 471683 [lv_data_mimage_1]           0 linear /dev/sdj3:0-471682