<?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>Google Cloud Storage FUSE &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/google-cloud-storage-fuse/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Tue, 01 Aug 2023 22:10:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Google Cloud Storage FUSE &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>GCSFuse + Docker: &#8220;Error while creating mount source path &#8216;/a&#8217;: mkdir /a: file exists.&#8221;</title>
		<link>https://myshittycode.com/2022/03/02/gcsfuse-docker-error-while-creating-mount-source-path-a-mkdir-a-file-exists/</link>
					<comments>https://myshittycode.com/2022/03/02/gcsfuse-docker-error-while-creating-mount-source-path-a-mkdir-a-file-exists/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Thu, 03 Mar 2022 00:34:34 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<category><![CDATA[Google Cloud Storage]]></category>
		<category><![CDATA[Google Cloud Storage FUSE]]></category>
		<guid isPermaLink="false">https://myshittycode.com/?p=1352</guid>

					<description><![CDATA[<p>This post illustrates how you can mount a GCS bucket using GCSFuse on your host machine and expose it as a volume to a Docker container. PROBLEM You want to volume mount a FUSE-mounted directory to a container, for example: When attempting to run the container&#8230; &#8230; an error occurred: SOLUTION Unmount the existing FUSE-mounted [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2022/03/02/gcsfuse-docker-error-while-creating-mount-source-path-a-mkdir-a-file-exists/">GCSFuse + Docker: &#8220;Error while creating mount source path &#8216;/a&#8217;: mkdir /a: file exists.&#8221;</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This post illustrates how you can mount a GCS bucket using GCSFuse on your host machine and expose it as a volume to a Docker container.</p>



<h2 class="wp-block-heading" id="problem">PROBLEM</h2>



<p>You want to volume mount a <a href="https://github.com/GoogleCloudPlatform/gcsfuse" target="_blank" rel="noopener">FUSE</a>-mounted directory to a container, for example:</p>



<figure class="wp-block-image size-large"><a href="https://myshittycode.com/wp-content/uploads/2022/03/aif_-2022-page-10-4.png?x45560"><img fetchpriority="high" decoding="async" width="888" height="560" src="https://myshittycode.com/wp-content/uploads/2022/03/aif_-2022-page-10-4.png?x45560" alt="" class="wp-image-1361" srcset="https://myshittycode.com/wp-content/uploads/2022/03/aif_-2022-page-10-4.png 888w, https://myshittycode.com/wp-content/uploads/2022/03/aif_-2022-page-10-4-300x189.png 300w, https://myshittycode.com/wp-content/uploads/2022/03/aif_-2022-page-10-4-768x484.png 768w" sizes="(max-width: 888px) 100vw, 888px" /></a></figure>



<p>When attempting to run the container&#8230;</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
docker run -it --rm -v /my-kfc-bucket:/home busybox
</pre></div>


<p>&#8230; an error occurred:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
docker: Error response from daemon: error while creating
mount source path &#039;/my-kfc-bucket&#039;: mkdir /my-kfc-bucket: 
file exists.
</pre></div>


<h2 class="wp-block-heading" id="solution">SOLUTION</h2>



<p>Unmount the existing FUSE-mounted directory.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
sudo umount /my-kfc-bucket
</pre></div>


<p>Mount it back with the following option. Because this command with <strong>-o allow_other</strong> must be executed with sudo privilege, you will need to change the root ownership to yourself (via <strong>&#8211;uid</strong> and <strong>&#8211;gid</strong>) so that you can easily read/write within the directory.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
sudo gcsfuse \
  -o allow_other \
  --uid $(id -u) \
  --gid $(id -g) \
  gcs-bucket /my-kfc-bucket  
</pre></div>


<p>If it is successful, the output should look like this:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Start gcsfuse/0.40.0 (Go version go1.17.6) for app &quot;&quot; using mount point: /my-kfc-bucket
Opening GCS connection...
Mounting file system &quot;gcs-bucket&quot;...
File system has been successfully mounted.
</pre></div>


<p>Rerun the docker container.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
docker run -it --rm -v /my-kfc-bucket:/home busybox
</pre></div>


<p>Now, you can read/write the GCS bucket&#8217;s data from the container. In this example, the GCS bucket&#8217;s data is located in <strong>/home</strong>.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2022/03/02/gcsfuse-docker-error-while-creating-mount-source-path-a-mkdir-a-file-exists/">GCSFuse + Docker: &#8220;Error while creating mount source path &#8216;/a&#8217;: mkdir /a: file exists.&#8221;</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2022/03/02/gcsfuse-docker-error-while-creating-mount-source-path-a-mkdir-a-file-exists/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1352</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching using Disk

Served from: myshittycode.com @ 2026-03-03 10:09:48 by W3 Total Cache
-->