{"id":794,"date":"2019-06-27T00:42:33","date_gmt":"2019-06-26T15:42:33","guid":{"rendered":"https:\/\/caciocavallo.jp\/?p=794"},"modified":"2019-07-01T03:17:48","modified_gmt":"2019-06-30T18:17:48","slug":"raspbian%e3%81%a7lvm","status":"publish","type":"post","link":"https:\/\/caciocavallo.jp\/?p=794","title":{"rendered":"Raspbian\u3067LVM"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u3044\u304d\u3055\u3064<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Raspbian\u3067<a href=\"https:\/\/ja.wikipedia.org\/wiki\/Time_Machine_(\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2)\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\">Time Machine<\/a>\u3092\u69cb\u7bc9\u3059\u308b\u306e\u306b\u3001\u8907\u6570\u306eHDD\u3092\u3072\u3068\u3064\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u3068\u3057\u3066\u4f7f\u3044\u305f\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8abf\u3079\u3066\u307f\u305f\u3068\u3053\u308d<a href=\"https:\/\/ja.wikipedia.org\/wiki\/\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"LVM (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\">LVM<\/a>\u3092\u4f7f\u3048\u3070\u5b9f\u73fe\u3067\u304d\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3001\u3084\u3063\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u74b0\u5883<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Raspberry Pi 3 Model B+<\/li><li>2019-04-08-raspbian-stretch<\/li><li>HDD\u30b1\u30fc\u30b9 <a rel=\"noreferrer noopener\" aria-label=\"\u7384\u4eba\u5fd7\u5411 GW3.5AX2-SU3\/REV2.0 (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\" href=\"https:\/\/www.kuroutoshikou.com\/product\/case\/35hdd\/gw3_5ax2-su3_rev2_0\/\" target=\"_blank\">\u7384\u4eba\u5fd7\u5411 GW3.5AX2-SU3\/REV2.0<\/a><\/li><li>WD 2TB HDD 2\u53f0<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">lvm2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install lvm2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u521d\u671f\u5316<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo pvcreate \/dev\/sda1\n$ sudo pvcreate \/dev\/sdb1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30dc\u30ea\u30e5\u30fc\u30e0\u30b0\u30eb\u30fc\u30d7\u3092\u300ctmlvm\u300d\u3067\u4f5c\u6210<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo vgcreate tmlvm \/dev\/sda1 \/dev\/sdb1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u4f5c\u6210<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"text-align:left\">-L  \u4f5c\u6210\u3059\u308b\u30dc\u30ea\u30e5\u30fc\u30e0\u30b5\u30a4\u30ba<br>-n  \u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u540d \u30dc\u30ea\u30e5\u30fc\u30e0\u30b0\u30eb\u30fc\u30d7\u540d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo lvcreate -L 3.6TB -n lvm1 tmlvm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u3001LVM\u306e\u7a3c\u50cd\u72b6\u6cc1\u3092\u78ba\u8a8d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo lvscan\n\n  ACTIVE            '\/dev\/tmlvm\/lvm1' [3.60 TiB] inherit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">ext4 \u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo mke2fs -t ext4 \/dev\/tmlvm\/lvm1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u3063\u3066\u3001\u30de\u30a6\u30f3\u30c8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo mkdir \/media\/tm\n$ sudo mount \/dev\/tmlvm\/lvm1 \/media\/tm<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a2\u30af\u30bb\u30b9\u6a29\u306e\u5909\u66f4<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u307e\u307e\u3060\u3068root\u6a29\u9650\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3082\u8aad\u307f\u66f8\u304d\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown &lt;username>:&lt;username> \/media\/tm<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">LVM\u60c5\u5831\u306e\u53d6\u5f97<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u60c5\u5831\u306e\u8868\u793a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo lvdisplay\n\n  --- Logical volume ---\n  LV Path                \/dev\/tmlvm\/lvm1\n  LV Name                lvm1\n  VG Name                tmlvm\n  LV UUID                xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n  LV Write Access        read\/write\n  LV Creation host, time xxxx.local, 2019-06-26 21:15:06 +0900\n  LV Status              available\n  # open                 1\n  LV Size                3.60 TiB\n  Current LE             943719\n  Segments               2\n  Allocation             inherit\n  Read ahead sectors     auto\n  - currently set to     256\n  Block device           254:0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7269\u7406\u30dd\u30ea\u30e5\u30fc\u30e0\u60c5\u5831\u306e\u8868\u793a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo pvdisplay\n\n  --- Physical volume ---\n  PV Name               \/dev\/sda1\n  VG Name               tmlvm\n  PV Size               1.82 TiB \/ not usable 4.07 MiB\n  Allocatable           yes (but full)\n  PE Size               4.00 MiB\n  Total PE              476931\n  Free PE               0\n  Allocated PE          476931\n  PV UUID               xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n   \n  --- Physical volume ---\n  PV Name               \/dev\/sdb1\n  VG Name               tmlvm\n  PV Size               1.82 TiB \/ not usable 4.07 MiB\n  Allocatable           yes \n  PE Size               4.00 MiB\n  Total PE              476931\n  Free PE               10143\n  Allocated PE          466788\n  PV UUID               xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">fdisk\u3067\u898b\u305f\u3068\u304d\u306e\u60c5\u5831<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo fdisk -l\n\nDisk \/dev\/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: gpt\nDisk identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\nDevice     Start        End    Sectors  Size Type\n\/dev\/sda1   2048 3907029134 3907027087  1.8T Linux LVM\n\n\nDisk \/dev\/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: gpt\nDisk identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\nDevice     Start        End    Sectors  Size Type\n\/dev\/sdb1   2048 3907029134 3907027087  1.8T Linux LVM\n\n\nDisk \/dev\/mapper\/tmlvm-lvm1: 3.6 TiB, 3958244376576 bytes, 7730946048 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u52d5\u30de\u30a6\u30f3\u30c8\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">fstab\u3092\u7de8\u96c6\u3057\u3066\u3001\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3088\u3046\u306b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6307\u5b9a\u3059\u308b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306f\u3001UUID\u3067\u6307\u5b9a\u3059\u308c\u3070\u30c7\u30a3\u30b9\u30af\u306e\u69cb\u6210\u304c\u5909\u308f\u3063\u3066\u3082\u6b63\u5e38\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u3002<br>\u3053\u306e\u3068\u304d\u306eUUID\u306f\u3001\u8ad6\u7406\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u3082\u306e\u3067\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo nano \/etc\/fstab\n\nUUID=\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"     \/media\/tm       ext4    defaults,user_xattr,usrquota    0       2<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Raspbian\u3067Time Machine\u3092\u69cb\u7bc9\u3059\u308b\u306e\u306b\u3001\u8907\u6570\u306eHDD\u3092\u3072\u3068\u3064\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u3068\u3057\u3066\u4f7f\u3044\u305f\u3044\u306e\u3067\u3001LVM\u3067\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[105,173,153,154,102],"tags":[161,162,155,160,156],"class_list":["post-794","post","type-post","status-publish","format-standard","hentry","category-linux","category-lvm","category-raspberry-pi","category-raspbian","category-102","tag-lvm","tag-lvm2","tag-raspberry-pi","tag-raspberry-pi-3-model-b","tag-raspbian"],"_links":{"self":[{"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=\/wp\/v2\/posts\/794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=794"}],"version-history":[{"count":8,"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=\/wp\/v2\/posts\/794\/revisions"}],"predecessor-version":[{"id":828,"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=\/wp\/v2\/posts\/794\/revisions\/828"}],"wp:attachment":[{"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/caciocavallo.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}