问题
I have created Google Cloud Storage Bucket and mounted it to my VM using:gcsfuse my-bucket /path/to/mount/point
When I type df -H
its listed as mounted filesystem.
I have the following issue:
If I upload file to the bucket using the GCP web console I can see it from the VM. If I try to create a directory however from the VM to the mounted file system mkdir /path/to/mount/point/test
it says:
mkdir: cannot create directory ‘/path/to/mount/point/test’: Input/output error
回答1:
I found the cause. I enabled the debug options as others suggested. Thank you. Unfortunately the logs did not tell me much. Fortunately I had one more VM and I tested there and it worked fine (mount + read/write to bucket). I understood its not the permissions on the bucket side. The VM was created with "Allow default access" which gives readonly to "Storage". I granted read/write to store. One can specify also "Allow full access to all Cloud APIs" although its better not to grant all permissions if you do not need them.
回答2:
Try to use following command,and it will show more information.
gcsfuse --foreground --debug_gcs --debug_http \
--debug_fuse --debug_invariants \
--key-file=/src/gcloud_service_account.json \
my-bucket /path/to/mount/point
You might see such error message
"code": 403, "message": "Access Not Configured. The API (Cloud Storage JSON API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
If so , you need to enable this API for this instance.
来源:https://stackoverflow.com/questions/55382783/oserror-input-output-error-when-writing-to-mounted-filesystem