{"id":4242,"date":"2014-07-30T12:53:29","date_gmt":"2014-07-30T03:53:29","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=4242"},"modified":"2018-11-14T16:33:51","modified_gmt":"2018-11-14T07:33:51","slug":"introduction-to-unionfs","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2014\/07\/30\/introduction-to-unionfs\/","title":{"rendered":"\u307e\u3068\u3081\u3066\u675f\u306d\u308bUnionFS\u306e\u4e0d\u601d\u8b70\u306a\u4e16\u754c"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>UnionFS \u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>Docker \u3092\u4f7f\u3044\u59cb\u3081\u3066\u304b\u3089 UnionFS \u306e\u5b58\u5728\u3092\u77e5\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3061\u3087\u3063\u3068\u9762\u767d\u3044\u52d5\u304d\u3092\u3059\u308b\u306e\u3067\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>UnionFS \u3068\u306f<\/h2>\n<p>UnionFS (Union FileSystem) \u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u3064\u306e\u5834\u6240\u306b\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001taro \u3068 jiro \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u3042\u308b\u3068\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6301\u3063\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">taro\/hoge\r\ntaro\/piyo\r\njiro\/fuga\r\njiro\/gofu<\/pre>\n<p>\u3053\u308c\u3092 hanako \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u307e\u3068\u3081\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u898b\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">hanako\/hoge\r\nhanako\/piyo\r\nhanako\/fuga\r\nhanako\/gofu<\/pre>\n<p>&nbsp;<\/p>\n<h2>UnionFS \u3092\u4f7f\u3063\u3066\u307f\u308b<\/h2>\n<p>\u4ee5\u4e0b\u306f Ubuntu \u3067\u8a66\u3057\u307e\u3057\u305f\u3002unionfs-fuse \u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">sudo apt-get install unionfs-fuse<\/pre>\n<p>\u6b21\u306b taro \u3068 jiro \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u305e\u308c\u306e\u4e2d\u306b\u9069\u5f53\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">mkdir taro jiro\r\necho hoge &gt; taro\/hoge\r\necho piyo &gt; taro\/piyo\r\necho fuga &gt; jiro\/fuga\r\necho gofu &gt; jiro\/gofu<\/pre>\n<p>\u305d\u308c\u3067\u306f\u3044\u3088\u3044\u3088\u3001\u8907\u6570\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4e00\u3064\u306e\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u306b\u675f\u306d\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>hanako \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u305d\u3053\u306b taro \u3068 jiro \u3092\u30de\u30a6\u30f3\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">mkdir hanako\r\nunionfs-fuse taro=RW:jiro=RW hanako<\/pre>\n<p>unionfs-fuse \u30b3\u30de\u30f3\u30c9\u3067\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5f15\u6570\u306f taro \u3068 jiro \u3092\u4e00\u3064\u306b\u307e\u3068\u3081\u3066 hanako \u306b\u30de\u30a6\u30f3\u30c8\u3059\u308b\uff08\u3069\u3061\u3089\u3082 RW=\u8aad\u307f\u66f8\u304d\u53ef\u80fd\uff09\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>tree \u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3059\u308b\u3068\u3001taro \u3068 jiro \u304c\u4e00\u3064\u306b\u675f\u306d\u3089\u308c\u3066\u3001hanako \u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ tree\r\n.\r\n\u251c\u2500\u2500 hanako\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fuga\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 gofu\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 hoge\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 piyo\r\n\u251c\u2500\u2500 jiro\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fuga\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 gofu\r\n\u2514\u2500\u2500 taro\r\n    \u251c\u2500\u2500 hoge\r\n    \u2514\u2500\u2500 piyo\r\n\r\n3 directories, 8 files<\/pre>\n<p>\u8aad\u307f\u66f8\u304d\u53ef\u80fd\u3068\u3057\u3066\u30de\u30a6\u30f3\u30c8\u3057\u305f\u306e\u3067\u3001hanako \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30de\u30a6\u30f3\u30c8\u6642\u306b\u300cRW\u300d\u3067\u306f\u306a\u304f\u300cRO\u300d\u3092\u6307\u5b9a\u3059\u308c\u3070\u3001\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u3057\u3066\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u4e00\u5ea6\u30de\u30a6\u30f3\u30c8\u3092\u89e3\u9664\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">sudo umount hanako<\/pre>\n<p>&nbsp;<\/p>\n<h2>Copy on Write<\/h2>\n<p>\u6b21\u306f Copy on Write \u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u65b0\u3057\u304f changed \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001taro \u3068 jiro \u3068 changed \u3092\u307e\u3068\u3081\u3066 hanako \u306b\u30de\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001taro \u3068 jiro \u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3001changed \u3060\u3051\u66f8\u304d\u8fbc\u307f\u53ef\u80fd\u3068\u3057\u3066\u30de\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">mkdir changed\r\nunionfs-fuse -o cow changed=RW:taro=RO:jiro=RO hanako<\/pre>\n<p>\u3053\u306e\u72b6\u614b\u3067\u5404\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ tree\r\n.\r\n\u251c\u2500\u2500 changed\r\n\u251c\u2500\u2500 hanako\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fuga\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 gofu\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 hoge\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 piyo\r\n\u251c\u2500\u2500 jiro\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fuga\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 gofu\r\n\u2514\u2500\u2500 taro\r\n    \u251c\u2500\u2500 hoge\r\n    \u2514\u2500\u2500 piyo\r\n\r\n4 directories, 8 files<\/pre>\n<p>hanako\/hoge \u306e\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">echo change! &gt; hanako\/hoge<\/pre>\n<p>\u3082\u3046\u4e00\u5ea6\u5404\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ tree\r\n.\r\n\u251c\u2500\u2500 changed\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 hoge\r\n\u251c\u2500\u2500 hanako\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fuga\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 gofu\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 hoge\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 piyo\r\n\u251c\u2500\u2500 jiro\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fuga\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 gofu\r\n\u2514\u2500\u2500 taro\r\n    \u251c\u2500\u2500 hoge\r\n    \u2514\u2500\u2500 piyo\r\n\r\n4 directories, 9 files<\/pre>\n<p>\u305d\u3057\u3066\u5404\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb hoge \u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \">$ cat hanako\/hoge\r\nchange!\r\n$ cat taro\/hoge\r\nhoge\r\n$ cat changed\/hoge\r\nchange!<\/pre>\n<p>hanako\/hoge \u306e\u5185\u5bb9\u3092 \"change!\" \u306b\u5909\u66f4\u3057\u305f\u306e\u3067 hanako\/hoge \u306e\u5185\u5bb9\u304c \"change!\" \u3068\u306a\u3063\u3066\u3044\u308b\u306e\u306f\u5f53\u7136\u3067\u3059\u304c\u3001\u5143\u3005\u306e hoge \u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u305f taro\/hoge \u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u5909\u66f4\u524d\u306e \"hoge\" \u306e\u307e\u307e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u8aad\u307f\u66f8\u304d\u53ef\u80fd\u3067\u3042\u308b changed \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b hoge \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3001\u5185\u5bb9\u306f \"change!\" \u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3068\u3057\u3066\u3001\u5909\u66f4\u3055\u308c\u305f\u5834\u5408\u306f\u5225\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u4eca\u56de\u306f changed \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09\u306b\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3055\u305b\u308b\u3001\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u79fb\u52d5\u3084\u524a\u9664\u3092\u3057\u305f\u5834\u5408\u3082\u3001\u30de\u30a6\u30f3\u30c8\u5143\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u5909\u66f4\u3055\u308c\u305a\u3001changed \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u73fe\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u6027\u8cea\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u30de\u30a6\u30f3\u30c8\u5143\u3092\u5909\u66f4\u3055\u305b\u305f\u304f\u306a\u3044 or \u8aad\u307f\u53d6\u308a\u5c02\u7528\u30e1\u30c7\u30a3\u30a2\u306b\u3042\u308b\u306e\u3067\u5909\u66f4\u3067\u304d\u306a\u3044\u3001\u3068\u3044\u3046\u5834\u5408\u306b\u3082\u6d3b\u7528\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>Docker \u306e\u5185\u90e8\u3067\u3053\u306e\u3088\u3046\u306a\u9762\u767d\u3044\u6280\u8853\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u3068\u5206\u304b\u308b\u3068\u3001\u306a\u3093\u3060\u304b\u697d\u3057\u304f\u306a\u3063\u3066\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>UnionFS \u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>Docker \u3092\u4f7f\u3044\u59cb\u3081\u3066\u304b\u3089 UnionFS \u306e\u5b58\u5728\u3092\u77e5\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3061\u3087\u3063\u3068\u9762\u767d\u3044\u52d5\u304d\u3092\u3059\u308b\u306e\u3067\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2014\/07\/30\/introduction-to-unionfs\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[137,23],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4242"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=4242"}],"version-history":[{"count":13,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4242\/revisions"}],"predecessor-version":[{"id":17879,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4242\/revisions\/17879"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=4242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=4242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=4242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}