<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>STRIPE | 徒然なるままに</title>
	<atom:link href="https://www.seichan.org/tag/stripe/feed" rel="self" type="application/rss+xml" />
	<link>https://www.seichan.org</link>
	<description>徒然と日々の出来事(ネタ)を書いていこうかと．主に FreeBSD，Unix系の話題が中心ですが，その他の話題もあつかってみたり．</description>
	<lastBuildDate>Sun, 24 Mar 2024 00:43:46 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>GEOM STRIPE (ストライプ/RAID0) を使ってみる</title>
		<link>https://www.seichan.org/2023/12/geom-stripe-%e3%82%b9%e3%83%88%e3%83%a9%e3%82%a4%e3%83%97-raid0-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html</link>
					<comments>https://www.seichan.org/2023/12/geom-stripe-%e3%82%b9%e3%83%88%e3%83%a9%e3%82%a4%e3%83%97-raid0-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html#respond</comments>
		
		<dc:creator><![CDATA[seichan]]></dc:creator>
		<pubDate>Sat, 02 Dec 2023 13:00:00 +0000</pubDate>
				<category><![CDATA[GEOM]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[STRIPE]]></category>
		<guid isPermaLink="false">https://www.seichan.org/blog/?p=817</guid>

					<description><![CDATA[今回は GEOM によるディスクのストライピング (RAID0) について纏めてみたいと思います．ストライピングは複数のディスクを分散して読み書き利用する技術で，大きなディスク領域の確保，読み書き速度の向上を図る技術です [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">今回は GEOM によるディスクのストライピング (RAID0) について纏めてみたいと思います．<br>ストライピングは複数のディスクを分散して読み書き利用する技術で，大きなディスク領域の確保，読み書き速度の向上を図る技術です．</p>



<ul class="wp-block-list">
<li>GEOM に関するお話
<ul class="wp-block-list">
<li><a href="https://www.seichan.org/2023/11/freebsd-geom-%e5%86%8d%e3%80%85%e5%ad%a6%e7%bf%92.html" target="_blank">FreeBSD GEOM 再々学習</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-concat-%e3%83%87%e3%82%a3%e3%82%b9%e3%82%af%e3%81%ae%e9%80%a3%e7%b5%90-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM CONCAT (ディスクの連結) を使ってみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-stripe-%e3%82%b9%e3%83%88%e3%83%a9%e3%82%a4%e3%83%97-raid0-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM STRIPE (ストライプ/RAID0) を使ってみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-mirror-%e3%83%9f%e3%83%a9%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%b0-raid1-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b-1.html" target="_blank">GEOM MIRROR (ミラーリング/RAID1) を使ってみる (1)</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-mirror-%e3%83%9f%e3%83%a9%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%b0-raid1-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b-2.html" target="_blank">GEOM MIRROR (ミラーリング/RAID1) を使ってみる (2)</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-stripe-mirror-%e3%81%a7-raid10-%e3%82%92%e6%a7%8b%e6%88%90%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM STRIPE + MIRROR で RAID10 を構成してみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-raid3%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM RAID3を使ってみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-cache-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM CACHE を使ってみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-gvirstor%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM GVIRSTORを使ってみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-gate-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html" target="_blank">GEOM GATE を使ってみる</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-label-%e3%81%a7%e5%90%8d%e5%89%8d%e3%81%ab%e3%82%88%e3%82%8b%e7%ae%a1%e7%90%86%e3%82%92%e8%a1%8c%e3%81%86.html" target="_blank">GEOM LABEL で名前による管理を行う</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-part-%e3%81%a7%e3%83%87%e3%82%a3%e3%82%b9%e3%82%af%e3%83%91%e3%83%bc%e3%83%86%e3%82%a3%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e7%ae%a1%e7%90%86%e3%82%92%e8%a1%8c%e3%81%86.html" target="_blank">GEOM PART でディスクパーティションの管理を行う</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-multipath-%e3%81%a7%e3%83%9e%e3%83%ab%e3%83%81%e3%83%91%e3%82%b9%e3%82%92%e6%a7%8b%e6%88%90%e3%81%99%e3%82%8b-1.html" target="_blank">GEOM MULTIPATH でマルチパスを構成する (1)</a></li>



<li><a href="https://www.seichan.org/2023/12/geom-multipath-%e3%81%a7%e3%83%9e%e3%83%ab%e3%83%81%e3%83%91%e3%82%b9%e3%82%92%e6%a7%8b%e6%88%90%e3%81%99%e3%82%8b-2.html" target="_blank">GEOM MULTIPATH でマルチパスを構成する (2)</a></li>
</ul>
</li>
</ul>


<div class=".for-sp">
<div class="table">
<span class="body">
<!-- imobile wiki_上部_SP_1 -->
<script type="text/javascript">
 imobile_tag_ver = "0.3"; 
 imobile_pid = "81546"; 
 imobile_asid = "1846007"; 
 imobile_type = "inline";
</script>
<script type="text/javascript" src="https://spad.i-mobile.co.jp/script/adssp.js?20110215"></script>
<!-- imobile wiki_上部_SP_1 -->
</span>
<span class="body">
<!-- imobile wiki_下部_SP_1 -->
<script type="text/javascript">
 imobile_tag_ver = "0.3"; 
 imobile_pid = "81546"; 
 imobile_asid = "1846017"; 
 imobile_type = "inline";
</script>
<script type="text/javascript" src="https://spad.i-mobile.co.jp/script/adssp.js?20110215"></script>
<!-- imobile wiki_下部_SP_1 -->
</span>
</div>
</div>

<div class=".for-pc">
<div class="table">
<span class="body">
<!-- imobile blog_seichan_記事中_1 -->
<script type="text/javascript">
 imobile_pid = "81546"; 
 imobile_asid = "1846028"; 
 imobile_width = 300; 
 imobile_height = 250;
</script>
<script type="text/javascript" src="https://spdeliver.i-mobile.co.jp/script/ads.js?20101001"></script>
<!-- imobile blog_seichan_記事中_1 -->
</span>
<span class="body">
<!-- imobile blog_seichan_記事中_2 -->
<script type="text/javascript">
 imobile_pid = "81546"; 
 imobile_asid = "1845876"; 
 imobile_width = 300; 
 imobile_height = 250;
</script>
<script type="text/javascript" src="https://spdeliver.i-mobile.co.jp/script/ads.js?20101001"></script>
<!-- imobile blog_seichan_記事中_2 -->
</span>
</div>
</div>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2" checked><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">GEOM STRIPE のイメージ</a></li><li><a href="#toc2" tabindex="0">GEOM STRIPE の利用・管理</a></li><li><a href="#toc3" tabindex="0">create で作った場合はどうなるのか?</a></li><li><a href="#toc4" tabindex="0">恒久的に使う場合は label を利用しよう</a></li><li><a href="#toc5" tabindex="0">IOについて確認してみる</a></li><li><a href="#toc6" tabindex="0">ディスクを拡張する</a></li><li><a href="#toc7" tabindex="0">GEOM STRIPE デバイスを終了 (破壊) する</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">GEOM STRIPE のイメージ</span></h2>



<p class="wp-block-paragraph">ストライピングのイメージはこのような形です．ディスクが2本の場合，３本の場合を表しています．</p>



<figure class="wp-block-image aligncenter size-large"><img fetchpriority="high" decoding="async" width="546" height="258" src="https://www.seichan.org/blog/wp-content/uploads/2023/12/image-3-546x258.png" alt="" class="wp-image-820" srcset="https://www.seichan.org/blog/wp-content/uploads/2023/12/image-3-546x258.png 546w, https://www.seichan.org/blog/wp-content/uploads/2023/12/image-3-300x142.png 300w, https://www.seichan.org/blog/wp-content/uploads/2023/12/image-3-768x362.png 768w, https://www.seichan.org/blog/wp-content/uploads/2023/12/image-3.png 856w" sizes="(max-width: 546px) 100vw, 546px" /></figure>



<h2 class="wp-block-heading"><span id="toc2">GEOM STRIPE の利用・管理</span></h2>



<p class="wp-block-paragraph">GEOM STRIPE は <strong><em>gstripe</em></strong> というコマンドを通じて利用・管理を行います．簡単に触れますが，詳細はコマンドのオプションの詳細は FreeBSD の マニュアル「<a rel="noopener" href="http://www.koganemaru.co.jp/cgi-bin/mroff.cgi?subdir=man&amp;lc=1&amp;cmd=&amp;man=gstripe&amp;dir=jpman-13.2.2%2Fman&amp;sect=0" target="_blank">gstripe</a>」を見てください．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe
usage: gstripe clear [-v] prov ...
       gstripe create [-v] [-s stripesize] name prov prov ...
       gstripe destroy [-fv] name ...
       gstripe dump prov ...
       gstripe label [-hv] [-s stripesize] name prov prov ...
       gstripe stop [-fv] name ...
       gstripe help
       gstripe list [-a] [name ...]
       gstripe status [-ags] [name ...]
       gstripe load [-v]
       gstripe unload [-v]</pre>



<p class="wp-block-paragraph">GEOM 関連のコマンドは gconcat の際にも触れましたが <strong><em>create</em></strong> と <strong><em>label</em></strong> の両方があり分かりづらいのですが，<strong>create は一時的，label は恒久的</strong>と覚えるのがよいです．</p>



<h2 class="wp-block-heading"><span id="toc3">create で作った場合はどうなるのか?</span></h2>



<p class="wp-block-paragraph"><br><strong><em>create</em></strong> で作成してマウント，再起動を行うとどのようになるのかを以下に一連の流れを記載します．</p>



<p class="wp-block-paragraph"><strong><em>gstripe create</em></strong> コマンドで ディスク da1 と da2 をストライピングして stripe0 を作成します．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe create stripe0 da1 da2</pre>



<p class="wp-block-paragraph"><strong><em>gstripe create</em></strong> や <strong><em>label</em></strong> コマンドを実行するとカーネルモジュールが自動的にロードされます．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">root@bsd13:/ # kldstat
Id Refs Address                Size Name
 1   10 0xffffffff80200000  1f3e2d0 kernel
 3    1 0xffffffff82319000     3218 intpm.ko
 4    1 0xffffffff8231d000     2180 smbus.ko
 5    1 0xffffffff82320000     7490 vmci.ko
 6    1 0xffffffff82328000     44a0 geom_stripe.ko</pre>



<p class="wp-block-paragraph">ですが，再起動時に必ず有効になるように明示的にロードさせる事をお勧めします．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># cat /boot/loader.conf
geom_stripe_load="YES"</pre>



<p class="wp-block-paragraph"><strong><em>gstripe status</em></strong> コマンドでステータスを表示できます．<br>以下は stripe0 のステータスです．da1, da2 がコンポーネントとして含まれており，ステータスがアップの状態です．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe status
          Name  Status  Components
stripe/stripe0      UP  da1
                        da2</pre>



<p class="wp-block-paragraph"><strong><em>gstripe list</em></strong> コマンドで詳細を表示する事ができます．<br>da1, da2 が 100GB のディスクでこれを RAID0 でストライピングしている為，stripe0 は 200G となっています．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe list
Geom name: stripe0
State: UP
Status: Total=2, Online=2
Type: MANUAL
Stripesize: 65536
ID: 2870193427
Providers:
1. Name: stripe/stripe0
   Mediasize: 214748364800 (200G)
   Sectorsize: 512
   Stripesize: 65536
   Stripeoffset: 0
   Mode: r0w0e0
Consumers:
1. Name: da1
   Mediasize: 107374182400 (100G)
   Sectorsize: 512
   Mode: r0w0e0
   Number: 0
2. Name: da2
   Mediasize: 107374182400 (100G)
   Sectorsize: 512
   Mode: r0w0e0
   Number: 1</pre>



<p class="wp-block-paragraph"><strong><em>newfs</em></strong> でファイルシステムを作成します．指定するデバイスは GEOM STRIPE の場合は <strong>/dev/stripe 以下に指定した名前のデバイスファイルが作成されます</strong>ので，これを指定します．<br>今回は create の際に stripe0 を名前としたため，<strong>/dev/stripe/stripe0</strong> がデバイスファイルとなります．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># newfs /dev/stripe/stripe0
/dev/stripe/stripe0: 204800.0MB (419430400 sectors) block size 32768, fragment size 4096
        using 328 cylinder groups of 625.22MB, 20007 blks, 80128 inodes.
super-block backups (for fsck_ffs -b #) at:
 192, 1280640, 2561088, 3841536, 5121984, 6402432, 7682880, 8963328, 10243776, 11524224, 12804672, 14085120, 15365568,
 16646016, 17926464, 19206912, 20487360, 21767808, 23048256, 24328704, 25609152, 26889600, 28170048, 29450496, 30730944,
 32011392, 33291840, 34572288, 35852736, 37133184, 38413632, 39694080, 40974528, 42254976, 43535424, 44815872, 46096320,
....</pre>



<p class="wp-block-paragraph">マウントおよびマウントの結果です．/mnt にマウントをしています．<br>これを /etc/fstab に記載した状態で再起動を行ってみます．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># mount /dev/stripe/stripe0 /mnt

# df
Filesystem          1K-blocks    Used     Avail Capacity  Mounted on
/dev/da0p2           19279260 2582452  15154468    15%    /
devfs                       1       1         0   100%    /dev
/dev/stripe/stripe0 203123608       8 186873712     0%    /mnt

# cat /etc/fstab
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/da0p2      /               ufs     rw      1       1
/dev/da0p3      none            swap    sw      0       0
/dev/stripe/stripe0     /mnt    ufs     rw      1       1</pre>



<p class="wp-block-paragraph">残念な事に (想定どおりです)，デバイスが無く起動途中に失敗してしまっています．<br>これは <strong><em>create</em></strong> で作成した為，ディスクに GEOM STRIPE の情報が記録されてい為作成したデバイスが存在しておらず，この状態となります．</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ab8fa7127186&quot;}" data-wp-interactive="core/image" data-wp-key="6ab8fa7127186" class="wp-block-image aligncenter size-full is-resized wp-lightbox-container"><img decoding="async" width="764" height="556" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://www.seichan.org/blog/wp-content/uploads/2023/12/SnapCrab_bsd13seichanlocal-VMware-Workstation_2023-12-1_19-0-52_No-00.png" alt="" class="wp-image-822" style="width:768px" srcset="https://www.seichan.org/blog/wp-content/uploads/2023/12/SnapCrab_bsd13seichanlocal-VMware-Workstation_2023-12-1_19-0-52_No-00.png 764w, https://www.seichan.org/blog/wp-content/uploads/2023/12/SnapCrab_bsd13seichanlocal-VMware-Workstation_2023-12-1_19-0-52_No-00-300x218.png 300w, https://www.seichan.org/blog/wp-content/uploads/2023/12/SnapCrab_bsd13seichanlocal-VMware-Workstation_2023-12-1_19-0-52_No-00-546x397.png 546w" sizes="(max-width: 764px) 100vw, 764px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>


<div class=".for-sp">
<div class="table">
<span class="body">
<!-- imobile wiki_上部_SP_1 -->
<script type="text/javascript">
 imobile_tag_ver = "0.3"; 
 imobile_pid = "81546"; 
 imobile_asid = "1846007"; 
 imobile_type = "inline";
</script>
<script type="text/javascript" src="https://spad.i-mobile.co.jp/script/adssp.js?20110215"></script>
<!-- imobile wiki_上部_SP_1 -->
</span>
<span class="body">
<!-- imobile wiki_下部_SP_1 -->
<script type="text/javascript">
 imobile_tag_ver = "0.3"; 
 imobile_pid = "81546"; 
 imobile_asid = "1846017"; 
 imobile_type = "inline";
</script>
<script type="text/javascript" src="https://spad.i-mobile.co.jp/script/adssp.js?20110215"></script>
<!-- imobile wiki_下部_SP_1 -->
</span>
</div>
</div>

<div class=".for-pc">
<div class="table">
<span class="body">
<!-- imobile blog_seichan_記事中_1 -->
<script type="text/javascript">
 imobile_pid = "81546"; 
 imobile_asid = "1846028"; 
 imobile_width = 300; 
 imobile_height = 250;
</script>
<script type="text/javascript" src="https://spdeliver.i-mobile.co.jp/script/ads.js?20101001"></script>
<!-- imobile blog_seichan_記事中_1 -->
</span>
<span class="body">
<!-- imobile blog_seichan_記事中_2 -->
<script type="text/javascript">
 imobile_pid = "81546"; 
 imobile_asid = "1845876"; 
 imobile_width = 300; 
 imobile_height = 250;
</script>
<script type="text/javascript" src="https://spdeliver.i-mobile.co.jp/script/ads.js?20101001"></script>
<!-- imobile blog_seichan_記事中_2 -->
</span>
</div>
</div>



<h2 class="wp-block-heading"><span id="toc4">恒久的に使う場合は label を利用しよう</span></h2>



<p class="wp-block-paragraph">先ほどと変わって <strong><em>create</em></strong> ではなく <strong><em>label</em></strong> で stripe0 を作成しました．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe label stripe0 da1 da2</pre>



<p class="wp-block-paragraph">同じディスクを同じように指定している為，<strong><em>status</em></strong> および <strong><em>list</em></strong> の結果は先ほどと変わりません．<br>また，<strong><em>create</em></strong> で作成した際に <strong><em>newfs</em></strong> していますが，再作成の際にディスク連結順番に変更を入れていませんのでファイルシステムとしては正しく生成された状態となっていますのでこのままマウントさせる事も可能です．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe status stripe0
          Name  Status  Components
stripe/stripe0      UP  da1
                        da2

# gstripe list stripe0
Geom name: stripe0
State: UP
Status: Total=2, Online=2
Type: AUTOMATIC
Stripesize: 65536
ID: 2858675290
Providers:
1. Name: stripe/stripe0
   Mediasize: 214748233728 (200G)
   Sectorsize: 512
   Stripesize: 65536
   Stripeoffset: 0
   Mode: r1w1e1
Consumers:
1. Name: da1
   Mediasize: 107374182400 (100G)
   Sectorsize: 512
   Mode: r1w1e2
   Number: 0
2. Name: da2
   Mediasize: 107374182400 (100G)
   Sectorsize: 512
   Mode: r1w1e2
   Number: 1</pre>



<p class="wp-block-paragraph">ですので，<strong><em>create</em></strong> と <strong><em>label</em></strong> を間違った&#8230; という場合でも正しくコマンドを発行してあげる事で今までの状態を復元できますので，データがなくなってしまった．という事は起きませんので安心してください．<br>いずれにせよ&#8230; <strong><em>label</em></strong> で作成しましょう．が教訓となりますが&#8230;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># mount /dev/stripe/stripe0 /mnt

# df
Filesystem          1K-blocks    Used     Avail Capacity  Mounted on
/dev/da0p2           19279260 2582484  15154436    15%    /
devfs                       1       1         0   100%    /dev
/dev/stripe/stripe0 203123608       8 186873712     0%    /mnt</pre>



<h2 class="wp-block-heading"><span id="toc5">IOについて確認してみる</span></h2>



<p class="wp-block-paragraph">コンカチと違い RAID0 でのストライピングですので分散して書き込みが行われます．実際にどの様な IO が発生しているのかを確認してみます．</p>



<p class="wp-block-paragraph">dd でランダムデータを生成，random.img としてファイル書き込みの IO を発生させました．<br>見て頂くと分かる通り da1 と da2 の両方に IO がかかっています．<br>このことから，分散してのディスクの読み書きが行われる事が分かります．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># dd if=/dev/random of=/mnt/random.img

# iostat 2
       tty             da0              da1              da2             cpu
 tin  tout KB/t  tps  MB/s  KB/t  tps  MB/s  KB/t  tps  MB/s  us ni sy in id
   1    89 18.3    5   0.1  60.0   10   0.6  61.6   10   0.6   0  0  1  0 99
   0   228 13.3    1   0.0  62.7  832  50.9  62.1  863  52.4   2  0 38  2 59
   0   163  0.0    0   0.0  64.0   77   4.8  56.9   90   5.0   0  0  4  0 96
   0    80  0.0    0   0.0  64.0  422  26.4  59.6  425  24.7   1  0 21  1 78
   0    73  0.0    0   0.0  61.1  549  32.8  64.0  552  34.5   1  0 25  2 72
   0    83  0.0    0   0.0  60.9  852  50.7  64.0  793  49.5   4  0 37  1 58

# ls /mnt
.snap           random.img</pre>



<p class="wp-block-paragraph">イメージとしてはこのような形ですね．</p>



<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="312" height="513" src="https://www.seichan.org/blog/wp-content/uploads/2023/12/image-4.png" alt="" class="wp-image-823" srcset="https://www.seichan.org/blog/wp-content/uploads/2023/12/image-4.png 312w, https://www.seichan.org/blog/wp-content/uploads/2023/12/image-4-300x493.png 300w" sizes="(max-width: 312px) 100vw, 312px" /></figure>



<h2 class="wp-block-heading"><span id="toc6">ディスクを拡張する</span></h2>



<p class="wp-block-paragraph">結論から先に．<strong><span class="bold-red">GEOM STRIPE によるディスクの拡張(追加)は不可能です．</span></strong><br>GEOM CONCAT と同様のオペレーションは完了するのですが，<strong><em>growfs</em></strong> した後におかしくなります．<br>当然ですが，再作成であれば問題ありません．</p>



<h2 class="wp-block-heading"><span id="toc7">GEOM STRIPE デバイスを終了 (破壊) する</span></h2>



<p class="wp-block-paragraph">ファイルシステムとして用済みになった．であったり，別用途に転用する為に初期化したい場合を説明します．</p>



<p class="wp-block-paragraph">当然ながら，ファイルシステムはアンマウントする必要があります．<br>また，完全に終了 (停止・破壊) する場合は <strong><em>stop</em></strong> ではなく <strong><em>destroy</em></strong> を利用します．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># umount /mnt
# gstripe destroy stripe0
# gstripe list</pre>



<p class="wp-block-paragraph">もし間違って <strong><em>destory</em></strong> を実行してしまった場合ですが，これだけのオペレーションの場合だとラベル情報がなくなっただけなので，再度 <strong><em>label</em></strong> を同じ引数で渡すことで復活させる事が可能です．<br>やらかしてしまった&#8230; という事案の場合は慌てずにそっと元に戻しましょう．</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gstripe label stripe0 da1 da2
# mount /dev/stripe/stripe0 /mnt
# df
Filesystem          1K-blocks    Used     Avail Capacity  Mounted on
/dev/da0p2           19279260 2582504  15154416    15%    /
devfs                       1       1         0   100%    /dev
/dev/stripe/stripe0 203123480  139048 186734556     0%    /mnt

# ls /mnt
.snap           random.img</pre>



<p class="wp-block-paragraph">以上で GEOM STRIPE によるストライピング (RAID0) のやり方についての解説を終了します．</p>


<div class=".for-sp">
<div class="table">
<span class="body">
<!-- imobile wiki_上部_SP_1 -->
<script type="text/javascript">
 imobile_tag_ver = "0.3"; 
 imobile_pid = "81546"; 
 imobile_asid = "1846007"; 
 imobile_type = "inline";
</script>
<script type="text/javascript" src="https://spad.i-mobile.co.jp/script/adssp.js?20110215"></script>
<!-- imobile wiki_上部_SP_1 -->
</span>
<span class="body">
<!-- imobile wiki_下部_SP_1 -->
<script type="text/javascript">
 imobile_tag_ver = "0.3"; 
 imobile_pid = "81546"; 
 imobile_asid = "1846017"; 
 imobile_type = "inline";
</script>
<script type="text/javascript" src="https://spad.i-mobile.co.jp/script/adssp.js?20110215"></script>
<!-- imobile wiki_下部_SP_1 -->
</span>
</div>
</div>

<div class=".for-pc">
<div class="table">
<span class="body">
<!-- imobile blog_seichan_記事中_1 -->
<script type="text/javascript">
 imobile_pid = "81546"; 
 imobile_asid = "1846028"; 
 imobile_width = 300; 
 imobile_height = 250;
</script>
<script type="text/javascript" src="https://spdeliver.i-mobile.co.jp/script/ads.js?20101001"></script>
<!-- imobile blog_seichan_記事中_1 -->
</span>
<span class="body">
<!-- imobile blog_seichan_記事中_2 -->
<script type="text/javascript">
 imobile_pid = "81546"; 
 imobile_asid = "1845876"; 
 imobile_width = 300; 
 imobile_height = 250;
</script>
<script type="text/javascript" src="https://spdeliver.i-mobile.co.jp/script/ads.js?20101001"></script>
<!-- imobile blog_seichan_記事中_2 -->
</span>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.seichan.org/2023/12/geom-stripe-%e3%82%b9%e3%83%88%e3%83%a9%e3%82%a4%e3%83%97-raid0-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
