> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/mount-the-s3-bucket-on-the-windows.md).

# Mount an S3 Bucket on Windows

ในกรณีที่ต้องการ mount S3 บน Windows OS สามารถดำเนินการได้ตามขั้นตอนด้านล่าง

## Prerequisite

* Create s3 bucket  (<https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket> )&#x20;
* Create an Object Storage Sub-User (<https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/create-an-object-storage-sub-user> )

## Instructions

### 1. Install Rclone

* Download the Rclone from the official website (<https://downloads.rclone.org/rclone-current-windows-amd64.zip>).&#x20;
* Extract the downloaded zip file. (Ex. C:\Program Files\rclone\\)&#x20;
* open Command Prompt (CMD) and change the directory to ( C:\Program Files\rclone\rclone-v1.69.2-windows-amd64 )  then type command  rclone&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FOiLbxAkcZS59rUQws2OD%2Fimage.png?alt=media&amp;token=f8cbb07d-dc00-4097-8fc1-6d2736ea58e3" alt=""><figcaption></figcaption></figure>

### 2. Configure Rclone with S3

Now that we have installed rclone, we will continue with the configuration by typing config command  rclone config  &#x20;

* select n for a new remote configuration.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FYpL7d7tp0ay37mvQ5Etq%2Fimage.png?alt=media&amp;token=22141b25-0214-469b-8d57-7a4bd992d82f" alt=""><figcaption></figcaption></figure>

* give a name to the connection (e.g. S3)&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FsEH9RnN2ShfzcNqcNuWU%2Fimage.png?alt=media&amp;token=17529145-039c-44b3-bb24-7eaa9d86a51a" alt=""><figcaption></figcaption></figure>

* select 4 for “Amazon S3 Compliant Storage Provider&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2F9AxbIcowpysR5EOAiCrl%2Fimage.png?alt=media&amp;token=f7a4eba2-af29-44fd-b846-fd4849d933db" alt=""><figcaption></figcaption></figure>

* select 1 for the S3 provider.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2F6Ib6IVXCsFcLDx5lhXjQ%2Fimage.png?alt=media&amp;token=d58e6045-f145-47cb-bc42-9e421321f49d" alt=""><figcaption></figcaption></figure>

* select 2 to use AWS credentials from the Instance Profile we defined earlier.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FoCQe6UdBsKWPAVEzXE4T%2Fimage.png?alt=media&amp;token=5ce1887c-2867-4d51-9771-7ec08d86dc28" alt=""><figcaption></figcaption></figure>

* Use the access\_key\_id and secret\_access\_key of your Sub-User

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FPyNAwMU4hL8tzT4EYFM4%2Fimage.png?alt=media&amp;token=9d4df68d-508e-4f42-adcb-cde78aa35daf" alt=""><figcaption></figcaption></figure>

* select 12 (ap-southeast-1)  AWS region in which the S3 bucket has been created.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FM0OsSc0zsQIYpB8yY4dB%2Fimage.png?alt=media&amp;token=f19da59e-00a7-465e-8255-13c00e2ae42c" alt=""><figcaption></figcaption></figure>

* Specify a name for the connection: s3-bkk.nipa.cloud&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2Fknttq20KMOM18qj3EMKu%2Fimage.png?alt=media&amp;token=eb6ec47a-426b-48ab-aa5e-b3bad8473aa1" alt=""><figcaption></figcaption></figure>

* Leave the remaining fields blank, then press Enter to continue.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FkHSmFdTGFOUTt5qmX0hR%2Fimage.png?alt=media&amp;token=404095be-158d-472f-8107-ad12a90ef411" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FyzQzkzxu1haj4fLsX903%2Fimage.png?alt=media&amp;token=e89633e2-0969-416e-b0f8-8c735a99a5ce" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FipM0MPzn0hReHF9McOsm%2Fimage.png?alt=media&amp;token=2caa07e3-ac7d-4977-a487-fae3f29e12ee" alt=""><figcaption></figcaption></figure>

* finally, skip the advanced configuration by typing n. We get a summary of the configuration. If everything is fine we can type y. Otherwise n to restart the configuration process.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FflBVmIjzDMpfcGaDty1c%2Fimage.png?alt=media&amp;token=7af637d2-9210-4ba0-97a2-1b12402c3370" alt=""><figcaption></figcaption></figure>

### 3. Mount the S3 Bucket as a Windows Drive

In order to make rclone work we need [winfsp](http://www.secfs.net/winfsp/rel/), an open source Windows File System Proxy which makes it easy to write user space filesystems for Windows. It provides a FUSE emulation layer which rclone uses in combination with cgofuse.&#x20;

To get rid of this error, we need to download and install [winfsp-1.7.20172.msi](https://github.com/billziss-gh/winfsp/releases/download/v1.7/winfsp-1.7.20172.msi).&#x20;

&#x20;

Mount the S3 Bucket as a Windows Drive by command:&#x20;

```
 rclone mount <configuration_name>:<bucket_name>  X:  --vfs-cache-mode full ---links 
```

ตัวอย่าง

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FowGcqBrz1Akohi5KKfVQ%2Fimage.png?alt=media&amp;token=47c2f596-396b-4992-99a9-4c0bfaf7dc90" alt=""><figcaption></figcaption></figure>

### 4. Verify Mount

Open File Explorer, We can now see a new disk mounted on the instance.&#x20;

&#x20;Let’s drop a file at the root of the disk to see if everything is working.&#x20;

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FbW2gzHw9myUYfTgBOvUb%2Fimage.png?alt=media&amp;token=40602f9a-0f2d-4769-88f4-a911842c6720" alt=""><figcaption></figcaption></figure>

Referrence <https://blog.spikeseed.cloud/mount-s3-as-a-disk/>
