{"id":14857,"date":"2023-09-03T16:54:23","date_gmt":"2023-09-03T07:54:23","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=14857"},"modified":"2023-09-04T06:17:47","modified_gmt":"2023-09-03T21:17:47","slug":"linux%e3%81%a7lvm%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/14857","title":{"rendered":"Linux\u3067\u30c7\u30fc\u30bf\u7528\u306eLVM\u3092\u65b0\u898f\u306b\u4f5c\u6210\u3059\u308b\uff01"},"content":{"rendered":"<p>\u30c7\u30fc\u30bf\u9818\u57df\u7528\u306eLVM\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u4f5c\u696d\u306f\u3001\u7ba1\u7406\u8005\u6a29\u9650\uff08root\u6a29\u9650\uff09\u3067\u884c\u3044\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>PV\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08pvcreate\uff09<\/h2>\n<p>\u65b0\u898f\u306b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u300c\/dev\/sdb1\u300d\u3092\u4f5c\u6210\u5f8c\u3001pvcreate\u30b3\u30de\u30f3\u30c9\u3067PV\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# pvcreate \/dev\/sdb1                                                      \r\n  Physical volume &quot;\/dev\/sdb1&quot; successfully created.\r\n<\/pre>\n<p>PV\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,6,9]; title: ; notranslate\" title=\"\">\r\n# pvdisplay\r\n  --- Physical volume ---\r\n  PV Name               \/dev\/sda3\r\n  VG Name               rhel\r\n  PV Size               18.41 GiB \/ not usable 2.00 MiB\r\n  Allocatable           yes (but full)\r\n  PE Size               4.00 MiB\r\n  Total PE              4713\r\n  Free PE               0\r\n  Allocated PE          4713\r\n  PV UUID               Imf2Nf-VqdY-joiy-ijym-PLQ2-SfVm-IQqNUf\r\n   \r\n  &quot;\/dev\/sdb1&quot; is a new physical volume of &quot;&lt;20.00 GiB&quot;\r\n  --- NEW Physical volume ---\r\n  PV Name               \/dev\/sdb1\r\n  VG Name               \r\n  PV Size               &lt;20.00 GiB\r\n  Allocatable           NO\r\n  PE Size               0   \r\n  Total PE              0\r\n  Free PE               0\r\n  Allocated PE          0\r\n  PV UUID               cBXj6a-W20h-YWi2-taIm-8aiG-PXIt-goIyb8   \r\n<\/pre>\n<h2>VG\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08vgcreate\uff09<\/h2>\n<p>vgcreate\u30b3\u30de\u30f3\u30c9\u3067\u3001VG\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vgcreate vg-data01 \/dev\/sdb1\r\n  Volume group &quot;vg-data01&quot; successfully created\r\n<\/pre>\n<p>VG\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vgdisplay\r\n  --- Volume group ---\r\n  VG Name               vg-data01\r\n  System ID             \r\n  Format                lvm2\r\n  Metadata Areas        1\r\n  Metadata Sequence No  1\r\n  VG Access             read\/write\r\n  VG Status             resizable\r\n  MAX LV                0\r\n  Cur LV                0\r\n  Open LV               0\r\n  Max PV                0\r\n  Cur PV                1\r\n  Act PV                1\r\n  VG Size               &lt;20.00 GiB\r\n  PE Size               4.00 MiB\r\n  Total PE              5119\r\n  Alloc PE \/ Size       0 \/ 0   \r\n  Free  PE \/ Size       5119 \/ &lt;20.00 GiB\r\n  VG UUID               040qi4-DyXV-ia33-00Ub-UZQk-Pz5Q-J1MAJ3\r\n   \r\n  --- Volume group ---\r\n  VG Name               rhel\r\n  System ID             \r\n  Format                lvm2\r\n  Metadata Areas        1\r\n  Metadata Sequence No  3\r\n  VG Access             read\/write\r\n  VG Status             resizable\r\n  MAX LV                0\r\n  Cur LV                2\r\n  Open LV               2\r\n  Max PV                0\r\n  Cur PV                1\r\n  Act PV                1\r\n  VG Size               18.41 GiB\r\n  PE Size               4.00 MiB\r\n  Total PE              4713\r\n  Alloc PE \/ Size       4713 \/ 18.41 GiB\r\n  Free  PE \/ Size       0 \/ 0   \r\n  VG UUID               PEtIb8-108P-asba-oJi1-xTOM-aky2-MAAG0k   \r\n <\/pre>\n<h2>LV\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08lvcreate\uff09<\/h2>\n<p>lvcreate\u30b3\u30de\u30f3\u30c9\u3067\u3001LV\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002VG\u3092\u5168\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# lvcreate -l 100%Free -n lv-data01 vg-data01\r\n  Logical volume &quot;lv-data01&quot; created.\r\n<\/pre>\n<p>LV\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# lvdisplay\r\n  --- Logical volume ---\r\n  LV Path                \/dev\/vg-data01\/lv-data01\r\n  LV Name                lv-data01\r\n  VG Name                vg-data01\r\n  LV UUID                Y97r7K-p4CB-mAoM-RHd9-kvKl-Hd4e-ln01cV\r\n  LV Write Access        read\/write\r\n  LV Creation host, time vmsrhe21.loc.lab4ict.com, 2023-09-03 16:50:17 +0900\r\n  LV Status              available\r\n  # open                 0\r\n  LV Size                &lt;20.00 GiB\r\n  Current LE             5119\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:2\r\n   \r\n  --- Logical volume ---\r\n  LV Path                \/dev\/rhel\/swap\r\n  LV Name                swap\r\n  VG Name                rhel\r\n  LV UUID                Ljx0eL-Ff8Z-477r-s5gY-kSaA-Tc8f-0nuRzE\r\n  LV Write Access        read\/write\r\n  LV Creation host, time localhost.localdomain, 2023-08-27 20:14:34 +0900\r\n  LV Status              available\r\n  # open                 2\r\n  LV Size                2.00 GiB\r\n  Current LE             512\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:1\r\n   \r\n  --- Logical volume ---\r\n  LV Path                \/dev\/rhel\/root\r\n  LV Name                root\r\n  VG Name                rhel\r\n  LV UUID                1Sok04-6nJ3-9sgO-WJmi-Oepb-rjTA-86xJLk\r\n  LV Write Access        read\/write\r\n  LV Creation host, time localhost.localdomain, 2023-08-27 20:14:34 +0900\r\n  LV Status              available\r\n  # open                 1\r\n  LV Size                16.41 GiB\r\n  Current LE             4201\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:0\r\n<\/pre>\n<h2>\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>ext4\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# mkfs.ext4 \/dev\/vg-data01\/lv-data01\r\nmke2fs 1.46.5 (30-Dec-2021)\r\nCreating filesystem with 5241856 4k blocks and 1310720 inodes\r\nFilesystem UUID: c78924f0-5ec5-4041-9422-5e90f81be978\r\nSuperblock backups stored on blocks: \r\n\t32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, \r\n\t4096000\r\n\r\nAllocating group tables: done                            \r\nWriting inode tables: done                            \r\nCreating journal (32768 blocks): done\r\nWriting superblocks and filesystem accounting information: done   \r\n<\/pre>\n<h2>\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u30de\u30a6\u30f3\u30c8\u3059\u308b\uff01<\/h2>\n<p>\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u30de\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002\u307e\u305a\u3001\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# mkdir \/var\/local\/data01\r\n<\/pre>\n<p>\u30de\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# mount \/dev\/vg-data01\/lv-data01 \/var\/local\/data01\r\n<\/pre>\n<p>\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# mount | grep data01\r\n\/dev\/mapper\/vg--data01-lv--data01 on \/var\/local\/data01 type ext4 (rw,relatime,seclabel)\r\n<\/pre>\n<h2>\u518d\u8d77\u52d5\u5f8c\u3082\u30de\u30a6\u30f3\u30c8\u3059\u308b\uff01<\/h2>\n<p>\u518d\u8d77\u52d5\u5f8c\u3082\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3088\u3046\u306b\u3001\/etc\/fstab\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vi \/etc\/fstab\r\n...\r\nUUID=&quot;c78924f0-5ec5-4041-9422-5e90f81be978&quot; \/var\/local\/data01 ext4 defaults 0 2\r\n<\/pre>\n<p>\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4]; title: ; notranslate\" title=\"\">\r\n# umount \/var\/local\/data01\r\n# df -h | grep \/var\/local\/data01\r\n# mount \/var\/local\/data01\r\n# mount | grep data01\r\n\/dev\/mapper\/vg--data01-lv--data01 on \/var\/local\/data01 type ext4 (rw,relatime,seclabel)\r\n<\/pre>\n<p>\u30b5\u30fc\u30d0\u306e\u518d\u8d77\u52d5\u3082\u884c\u3063\u3066\u3001\u30de\u30a6\u30f3\u30c8\u3055\u308c\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>LVM\u306e\u4f5c\u6210\u3068\u30de\u30a6\u30f3\u30c8\u306f\u3001\u9577\u3044\u624b\u9806\u306b\u306f\u306a\u308a\u307e\u3059\u304c\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u4f5c\u6210\u2192PV\u4f5c\u6210\u2192VG\u4f5c\u6210\u2192LV\u4f5c\u6210\u2192\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u4f5c\u6210\u3068\u9806\u756a\u306b\u4f5c\u696d\u3057\u3066\u3044\u3051\u3070\u96e3\u3057\u3044\u3068\u3053\u308d\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/14777\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Linux\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c7\u30fc\u30bf\u9818\u57df\u7528\u306eLVM\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u4f5c\u696d\u306f\u3001\u7ba1\u7406\u8005\u6a29\u9650\uff08root\u6a29\u9650\uff09\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1017],"tags":[282,1042,1045,653,1040,1043,1041,1044,25,630],"class_list":["post-14857","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-filesystem","tag-linux","tag-lvcreate","tag-lvdisplay","tag-lvm","tag-pvcreate","tag-pvdisplay","tag-vgcreate","tag-vgdisplay","tag-25","tag-630"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=14857"}],"version-history":[{"count":7,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14857\/revisions"}],"predecessor-version":[{"id":14879,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14857\/revisions\/14879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5527"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=14857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=14857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=14857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}