{"id":19229,"date":"2016-07-16T05:56:50","date_gmt":"2016-07-15T21:56:50","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/07\/16\/%e5%9c%a8-freebsd-%e5%bb%ba%e7%ab%8b-raid-5\/"},"modified":"2021-03-18T17:24:45","modified_gmt":"2021-03-18T09:24:45","slug":"%e5%9c%a8-freebsd-%e5%bb%ba%e7%ab%8b-raid-5","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/07\/16\/%e5%9c%a8-freebsd-%e5%bb%ba%e7%ab%8b-raid-5\/","title":{"rendered":"\u5728 FreeBSD \u5efa\u7acb RAID 5"},"content":{"rendered":"<p>\u53c3\u8003\u6587\u7ae0\uff1a <br \/><a href=\"http:\/\/www.cyberycon.com\/freebsd-9-1-programmnyj-raid5\/\" target=\"_blank\" rel=\"noopener noreferrer\">FreeBSD 9.1 \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 RAID5 | Seclab<\/a> <br \/><span style=\"color: #0000ff\">OS\uff1aFreeBSD 10.3<\/span><br \/><span style=\"color: #0000ff\">HDD\uff1a<\/span><br \/><span style=\"color: #0000ff\">20G*1\uff1aFreeBSDSystem(\/dev\/da0)<\/span><br \/><span style=\"color: #0000ff\">20G *3 \uff1aRAID (\/dev\/da1,da2,da3)<\/span><\/p>\n<p>1. \u78c1\u789f\u6a5f\u4ee3\u865f <br \/># <span style=\"color: #ff0000\">sysctl kern.disks<\/span> <br \/><span style=\"color: #0000ff\">kern.disks: da3 da2 da1 da0 cd0<\/span> <\/p>\n<p>2. \u53d6\u5f97\u78c1\u789f\u6a5f\u76f8\u95dc\u8cc7\u8a0a <br \/># <span style=\"color: #ff0000\">fdisk da1 <\/span> <br \/><span style=\"color: #0000ff\">******* Working on device \/dev\/da1 ******* <\/span> <br \/><span style=\"color: #0000ff\">parameters extracted from in-core disklabel are: <\/span> <br \/><span style=\"color: #0000ff\">cylinders=2610 heads=255 sectors\/track=63 (16065 blks\/cyl) <\/span> <\/p>\n<p><span style=\"color: #0000ff\">Figures below won&#8217;t work with BIOS for partitions not in cyl 1 <\/span> <br \/><span style=\"color: #0000ff\">parameters to be used for BIOS calculations are: <\/span> <br \/><span style=\"color: #0000ff\">cylinders=2610 heads=255 sectors\/track=63 (16065 blks\/cyl) <\/span> <\/p>\n<p><span style=\"color: #0000ff\">fdisk: invalid fdisk partition table found <\/span> <br \/><span style=\"color: #0000ff\">Media sector size is 512 <\/span> <br \/><span style=\"color: #0000ff\">Warning: BIOS sector numbering starts with sector 1 <\/span> <br \/><span style=\"color: #0000ff\">Information from DOS bootblock is: <\/span> <br \/><span style=\"color: #0000ff\">The data for partition 1 is: <\/span> <br \/><span style=\"color: #0000ff\">sysid 165 (0xa5),(FreeBSD\/NetBSD\/386BSD) <\/span> <br \/> <span style=\"color: #0000ff\">start 63, size 41929587 (<\/span><span style=\"color: #ff0000\">20473<\/span> <span style=\"color: #0000ff\">Meg), flag 80 (active) <\/span> <br \/><span style=\"color: #0000ff\"> beg: cyl 0\/ head 1\/ sector 1; <\/span> <br \/><span style=\"color: #0000ff\"> end: cyl 561\/ head 254\/ sector 63 <\/span> <br \/><span style=\"color: #0000ff\">The data for partition 2 is: <\/span> <br \/><span style=\"color: #0000ff\">&lt;UNUSED&gt; <\/span> <br \/><span style=\"color: #0000ff\">The data for partition 3 is: <\/span> <br \/><span style=\"color: #0000ff\">&lt;UNUSED&gt; <\/span> <br \/><span style=\"color: #0000ff\">The data for partition 4 is: <\/span> <br \/><span style=\"color: #0000ff\">&lt;UNUSED&gt;<\/span>[@more@]3. \u5efa\u7acb\u639b\u8f09\u76ee\u9304 <br \/># <span style=\"color: #ff0000\">mkdir \/storage<\/span> <\/p>\n<p>4. \u5efa\u7acb<span style=\"color: #0000ff\"> \/etc\/gvinum.conf<\/span> \u8a2d\u5b9a\u6a94 <br \/># <span style=\"color: #ff0000\">vim \/etc\/gvinum.conf<\/span> <br \/><span style=\"color: #0000ff\">drive raid51 device \/dev\/da1<\/span> <br \/><span style=\"color: #0000ff\">drive raid52 device \/dev\/da2<\/span> <br \/><span style=\"color: #0000ff\">drive raid53 device \/dev\/da3<\/span> <br \/><span style=\"color: #0000ff\">volume raid5<\/span> <br \/><span style=\"color: #0000ff\">plex org raid5 256k<\/span> <br \/><span style=\"color: #0000ff\">sd len 20473m drive raid51<\/span> <br \/><span style=\"color: #0000ff\">sd len 20473m drive raid52<\/span> <br \/><span style=\"color: #0000ff\">sd len 20473m drive raid53<\/span> <\/p>\n<p>5. \u5efa\u7acb RAID5 <br \/># <span style=\"color: #ff0000\">gvinum create \/etc\/gvinum.conf<\/span> <\/p>\n<p>6. \u683c\u5f0f\u5316 <br \/># <span style=\"color: #ff0000\">newfs -U \/dev\/gvinum\/raid5<\/span> <br \/><span style=\"color: #0000ff\">\/dev\/gvinum\/raid5: 40946.0MB (83857408 sectors) block size 32768, fragment size 4096<\/span> <br \/><span style=\"color: #0000ff\"> using 66 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.<\/span> <br \/><span style=\"color: #0000ff\">super-block backups (for fsck_ffs -b #) at:<\/span> <br \/><span style=\"color: #0000ff\"> 192, 1282432, 2564672, 3846912, 5129152, 6411392, 7693632, 8975872, 10258112, 11540352,<\/span> <br \/><span style=\"color: #0000ff\"> 12822592, 14104832, 15387072, 16669312, 17951552, 19233792, 20516032, 21798272, 23080512,<\/span> <br \/><span style=\"color: #0000ff\"> 24362752, 25644992, 26927232, 28209472, 29491712, 30773952, 32056192, 33338432, 34620672,<\/span> <br \/><span style=\"color: #0000ff\"> 35902912, 37185152, 38467392, 39749632, 41031872, 42314112, 43596352, 44878592, 46160832,<\/span> <br \/><span style=\"color: #0000ff\"> 47443072, 48725312, 50007552, 51289792, 52572032, 53854272, 55136512, 56418752, 57700992,<\/span> <br \/><span style=\"color: #0000ff\"> 58983232, 60265472, 61547712, 62829952, 64112192, 65394432, 66676672, 67958912, 69241152,<\/span> <br \/><span style=\"color: #0000ff\"> 70523392, 71805632, 73087872, 74370112, 75652352, 76934592, 78216832, 79499072, 80781312,<\/span> <br \/><span style=\"color: #0000ff\"> 82063552, 83345792<\/span> <\/p>\n<p>7. \u639b\u8f09 <br \/># <span style=\"color: #ff0000\">mount \/dev\/gvinum\/raid5 \/storage<\/span> <br \/># <span style=\"color: #ff0000\">df -h<\/span> <br \/><span style=\"color: #0000ff\">Filesystem Size Used Avail Capacity Mounted on<\/span> <br \/><span style=\"color: #0000ff\">\/dev\/da0p2 18G 2.8G 14G 17% \/<\/span> <br \/><span style=\"color: #0000ff\">devfs 1.0K 1.0K 0B 100% \/dev<\/span> <br \/><span style=\"color: #ff0000\">\/dev\/gvinum\/raid5 39G 8.0K 36G 0% \/storage<\/span> <\/p>\n<p>8. \u4fee\u6539<span style=\"color: #0000ff\"> \/etc\/fstab<\/span> <br \/># <span style=\"color: #ff0000\">echo \/dev\/gvinum\/raid5 \/storage ufs rw 2 2 &gt;&gt; \/etc\/fstab<\/span> <\/p>\n<p>9. \u958b\u6a5f\u4fbf\u555f\u52d5 GVinum \u670d\u52d9 <br \/>\u4fee\u6539 <span style=\"color: #0000ff\">\/boot\/loader.conf<\/span> \u8a2d\u5b9a\u6a94 <br \/># <span style=\"color: #ff0000\">vim \/boot\/loader.conf<\/span> <br \/>\u52a0\u5165\u4e0b\u9762\u4e00\u884c <br \/><span style=\"color: #0000ff\">geom_vinum_load=&#8221;YES&#8221;<br \/><span style=\"color: #000000\">\u6216<br \/># <span style=\"color: #ff0000\">echo geom_vinum_load=&#8221;YES&#8221; &gt;&gt; \/boot\/loader.conf<\/span> <\/p>\n<p>10. \u91cd\u65b0\u555f\u52d5\u96fb\u8166 <br \/># <span style=\"color: #ff0000\">reboot<\/span> <\/p>\n<p>11. RAID5 \u7cfb\u7d71\u72c0\u614b <br \/># <span style=\"color: #ff0000\">gvinum l<\/span> <br \/> <\/span>3 drives:<\/span><span style=\"color: #000000\"><br \/><span style=\"color: #0000ff\">D raid51 State: up \/dev\/da1 A: 6\/20479 MB (0%)<\/span> <br \/><span style=\"color: #0000ff\">D raid52 State: up \/dev\/da2 A: 6\/20479 MB (0%)<\/span> <br \/><span style=\"color: #0000ff\">D raid53 State: up \/dev\/da3 A: 6\/20479 MB (0%)<\/span> <\/p>\n<p><span style=\"color: #0000ff\">1 volume:<\/span> <br \/><span style=\"color: #0000ff\">V raid5 State: up Plexes: 1 Size: 39 GB<\/span> <\/p>\n<p><span style=\"color: #0000ff\">1 plex:<\/span> <br \/><span style=\"color: #0000ff\">P raid5.p0 R5 State: up Subdisks: 3 Size: 39 GB<\/span> <\/p>\n<p><span style=\"color: #0000ff\">3 subdisks:<\/span> <br \/><span style=\"color: #0000ff\">S raid5.p0.s0 State: up D: raid51 Size: 19 GB<\/span> <br \/><span style=\"color: #0000ff\">S raid5.p0.s1 State: up D: raid52 Size: 19 GB<\/span> <br \/><span style=\"color: #0000ff\">S raid5.p0.s2 State: up D: raid53 Size: 19 GB<\/span> <br \/> <\/span> <span style=\"color: #0000ff\"><br \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c3\u8003\u6587\u7ae0\uff1a FreeBSD 9.1 \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 RAID5 | Seclab OS\uff1aFreeBSD &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/07\/16\/%e5%9c%a8-freebsd-%e5%bb%ba%e7%ab%8b-raid-5\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u5728 FreeBSD \u5efa\u7acb RAID 5\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,104],"tags":[],"class_list":["post-19229","post","type-post","status-publish","format-standard","hentry","category-c-98634","category-c-98643"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["648497"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19229"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19229"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19229\/revisions"}],"predecessor-version":[{"id":20791,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19229\/revisions\/20791"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}