{"id":25,"date":"2007-07-13T02:34:31","date_gmt":"2007-07-12T17:34:31","guid":{"rendered":"http:\/\/192.168.24.51\/topics\/?p=25"},"modified":"2007-07-13T02:34:31","modified_gmt":"2007-07-12T17:34:31","slug":"linux-lvm2-%e3%82%b9%e3%83%8a%e3%83%83%e3%83%97%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%8b%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97","status":"publish","type":"post","link":"https:\/\/chidipy.jpn.com\/topics\/?p=25","title":{"rendered":"(linux) LVM2 \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\uff0b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7"},"content":{"rendered":"<p>LVM2 \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u5b89\u5168\u306a\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5<br \/>\n\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u5148\u306e\u30c7\u30fc\u30bf\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u306e\u3067\u5b89\u5168\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002<br \/>\n\uff08\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3088\u308a\u30b7\u30b9\u30c6\u30e0\u3088\u308a\u306eLVM\u306e\u5c64\u3067\u30aa\u30ea\u30b8\u30ca\u30eb\u30c7\u30fc\u30bf\u3068\u4e00\u7dd2\u306b\u5909\u66f4\u7ba1\u7406\u3092\u884c\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u5c0f\u5bb9\u91cf\u3067\u5b89\u5168\u306b\u3067\u304d\u308b\uff09<br \/>\n<strong>\u25cb \u691c\u8a3c\u74b0\u5883\u4f5c\u6210<\/strong><br \/>\n<code># mke2fs -j \/dev\/testvg\/testlv1<br \/>\n# mount \/dev\/testvg\/testlv1 \/mnt\/test<br \/>\n# echo \"aaaaaa\" &gt; \/mnt\/test\/aaaaaa<br \/>\n# echo \"bbbbbb\" &gt; \/mnt\/test\/bbbbbb<\/code><br \/>\n<strong>\u25cb lv\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8<\/strong><br \/>\n\u203bmysql\u306a\u3069\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3089\u3053\u3053\u3067\u30ed\u30c3\u30af\u3092\u304b\u3051\u308b\u3002\u300cFLUSH TABLES WITH READ LOCK;\u300d<br \/>\n<code># lvcreate -s -L 32M -n snaptestlv \/dev\/testvg\/testlv1<br \/>\nLogical volume \"snaptestlv\" created<\/code><br \/>\n\u203bmysql\u306a\u3069\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3089\u3053\u3053\u3067\u30ed\u30c3\u30af\u3092\u89e3\u9664\u3002\u300cUNLOCK TABLES;\u300d<br \/>\n<strong>\u25cb \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u53d6\u5f97\u691c\u8a3c<\/strong><br \/>\n\u30aa\u30ea\u30b8\u30ca\u30eb\u30c7\u30fc\u30bf\u306e\u5909\u66f4<br \/>\n<code># echo \"cccccc\" &gt; \/mnt\/test\/cccccc<br \/>\n# echo \"bbbaaa\" &gt; \/mnt\/test\/bbbbbb<\/code><br \/>\n<strong>\u25cb \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u30c7\u30fc\u30bf\u306e\u78ba\u8a8d<\/strong><br \/>\n<code># mkdir \/mnt\/snaptest<br \/>\n# mount \/dev\/testvg\/snaptestlv \/mnt\/snaptest<br \/>\n# ls \/mnt\/snaptest<br \/>\naaaaa  bbbbbb  lost+found<br \/>\n# cat \/mnt\/snaptest\/bbbbbb<br \/>\nbbbbbb<br \/>\n# cat \/proc\/mounts<br \/>\n\/dev\/testvg\/testlv1 \/mnt\/test ext3 rw 0 0<br \/>\n\/dev\/testvg\/snaptestlv \/mnt\/snaptest ext3 rw 0 0<br \/>\n# umount \/mnt\/snaptest<br \/>\n# lvm lvdisplay testvg<br \/>\n--- Logical volume ---<br \/>\nLV Name                \/dev\/testvg\/snaptestlv<br \/>\nVG Name                testvg<br \/>\nLV UUID                yoJjdE-LVJE-LHN1-zrBu-u8bB-ra3R-ijQn0Z<br \/>\nLV Write Access        read\/write<br \/>\nLV snapshot status     active destination for \/dev\/testvg\/testlv1<br \/>\nLV Status              available<br \/>\n# open                 0<br \/>\nLV Size                32.00 MB<br \/>\nCurrent LE             8<br \/>\nCOW-table size         32.00 MB<br \/>\nCOW-table LE           8<br \/>\nAllocated to snapshot  0.29%          <em>\u2190\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u5148lv\u306e\u4f7f\u7528\u7387 \u30aa\u30ea\u30b8\u30ca\u30eb\u30c7\u30fc\u30bf\u3092\u5909\u66f4\u3059\u308b\u307b\u3069\u5897\u52a0<\/em><br \/>\nSnapshot chunk size    8.00 KB<br \/>\nSegments               1<br \/>\nAllocation             inherit<br \/>\nRead ahead sectors     0<br \/>\nBlock device           253:5<br \/>\n<\/code><br \/>\n<strong>\u25cb \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/strong><br \/>\n<code># dump 0f \/tmp\/testlv.dmp \/dev\/testvg\/snaptestlv<br \/>\n# lvm lvremove \/dev\/testvg\/snaptestlv<\/code><br \/>\n<strong>\u203b\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u5148\u306elv\u3092\u6d88\u3055\u306a\u3044\u3068\u3001\u3044\u3064\u307e\u3067\u3082lv\u306e\u53e4\u3044\u30c7\u30fc\u30bf\u30b3\u30d4\u30fc\u3092\u7d9a\u3051\u308b<\/strong><br \/>\n<strong>\u25cb \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30c7\u30fc\u30bf\u306e\u691c\u8a3c<\/strong><br \/>\n<code># rm \/mnt\/test\/*<br \/>\n# cd \/mnt\/test<br \/>\n# restore rf \/tmp\/testlv.dmp<br \/>\n# ls<br \/>\naaaaaa  bbbbbb  lost+found  restoresymtable<br \/>\n# cat  \/mnt\/test\/bbbbbb<br \/>\nbbbbbb<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>LVM2 \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u5b89\u5168\u306a\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5 \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u5148\u306e\u30c7\u30fc\u30bf\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u306e\u3067\u5b89\u5168\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002 \uff08\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3088\u308a\u30b7\u30b9\u30c6\u30e0\u3088\u308a\u306eLVM\u306e &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/chidipy.jpn.com\/topics\/?p=25\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;(linux) LVM2 \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\uff0b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,18,2],"tags":[],"_links":{"self":[{"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=\/wp\/v2\/posts\/25"}],"collection":[{"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":0,"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chidipy.jpn.com\/topics\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}