User Tools

Site Tools


general:linux:lvmcache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
general:linux:lvmcache [2020/11/17 22:19] – created sunkangeneral:linux:lvmcache [2021/02/11 08:24] – [Remove caching from the thinpool] sunkan
Line 179: Line 179:
  
 Attach cache LV to previously separated cache pool Attach cache LV to previously separated cache pool
 +<code>
 +bigbang:~# lvconvert --type cache --cachemode writeback --cachepool F3_2TB/ThinPool0_CDLV F3_2TB/ThinPool0
 +Do you want wipe existing metadata of cache pool F3_2TB/ThinPool0_CDLV? [y/n]: y
 +  WARNING: Cached thin pool's data cannot be currently resized and require manual uncache before resize!
 +  Logical volume F3_2TB/ThinPool0_tdata is now cached.
 +</code>
 +
 +===== Extending size of ThinPool0 =====
 +==== Remove caching from the thinpool ====
 +As it does not seem to be possible to extend a cached thinpool, we first need to remove the cache.
 +Follow first two steps above from section "Removing cache from ThinPool0" (do not re-attach the cache of course)
 +
 +Some - before information
 +<code>
 +bigbang:~# lvdisplay -a F3_2TB/ThinPool0_tdata
 +  --- Logical volume ---
 +  Internal LV Name       ThinPool0_tdata
 +  VG Name                F3_2TB
 +  LV UUID                Fyc9Md-c1XD-xpib-dJDw-Obr4-SYL5-G88yqS
 +  LV Write Access        read/write
 +  LV Creation host, time bigbang, 2019-10-12 14:17:30 +0200
 +  LV Cache pool name     ThinPool0_CDLV
 +  LV Cache origin name   ThinPool0_tdata_corig
 +  LV Status              available
 +  # open                 1
 +  LV Size                500.00 GiB
 +  Cache used blocks      99.99%
 +  Cache metadata blocks  18.54%
 +  Cache dirty blocks     0.00%
 +  Cache read hits/misses 644218163 / 453243621
 +  Cache wrt hits/misses  1046297083 / 31441523
 +  Cache demotions        1455727
 +  Cache promotions       1455727
 +  Current LE             128000
 +  Segments               1
 +  Allocation             inherit
 +  Read ahead sectors     auto
 +  - currently set to     256
 +  Block device           253:36
 +</code>
 +
 +<code>
 +bigbang:~# lvchange --cachemode writethrough F3_2TB/ThinPool0_tdata
 +  Flushing 55 blocks for cache F3_2TB/ThinPool0_tdata.
 +  Logical volume F3_2TB/ThinPool0_tdata changed.
 +</code>
 +
 +<code>
 +bigbang:~# lvconvert --splitcache F3_2TB/ThinPool0
 +  Logical volume F3_2TB/ThinPool0_tdata is not cached and cache pool F3_2TB/ThinPool0_CDLV is unused.
 +</code>
 +==== Now extend the ThinPool0 LV ====
 +<code>
 +bigbang:~# lvextend -L 1t F3_2TB/ThinPool0
 +  Size of logical volume F3_2TB/ThinPool0_tdata changed from 500.00 GiB (128000 extents) to 1.00 TiB (262144 extents).
 +  Logical volume F3_2TB/ThinPool0_tdata successfully resized.
 +</code>
 +
 +==== And now reattach the cache ====
 +Do the last step from section "Removing cache from ThinPool0" to reattach the cache to the thinpool
 +
 <code> <code>
 bigbang:~# lvconvert --type cache --cachemode writeback --cachepool F3_2TB/ThinPool0_CDLV F3_2TB/ThinPool0 bigbang:~# lvconvert --type cache --cachemode writeback --cachepool F3_2TB/ThinPool0_CDLV F3_2TB/ThinPool0
general/linux/lvmcache.txt · Last modified: 2021/02/11 08:25 by sunkan

Donate Powered by PHP Valid HTML5 Valid CSS Run on Debian Driven by DokuWiki