写入挂载的文件系统时出现OSError输入/输出错误

时间:2019-03-27 17:01:59

标签: google-cloud-platform mount fuse gcsfuse

我创建了Google Cloud Storage Bucket,并使用以下方式将其安装到我的VM:
df -H
当我键入mkdir /path/to/mount/point/test时,其列为已挂载的文件系统。
我有以下问题:

如果我使用GCP Web控制台将文件上传到存储桶,则可以从VM中看到文件。但是,如果我尝试创建从VM到挂载的文件系统mkdir: cannot create directory ‘/path/to/mount/point/test’: Input/output error 的目录,它会显示:

A

2 个答案:

答案 0 :(得分:1)

我找到了原因。我按照其他建议启用了调试选项。谢谢。不幸的是,日志并没有告诉我太多。幸运的是,我又有一个虚拟机,并在那里进行了测试,它运行良好(挂载+读取/写入存储桶)。我了解它不是存储桶端的权限。通过“允许默认访问”创建虚拟机,该虚拟机将“存储”设置为只读。我授予读取/写入存储权限。还可以指定“允许对所有Cloud API的完全访问权限”,尽管最好不要授予所有权限。

答案 1 :(得分:0)

尝试使用以下命令,它将显示更多信息。

gcsfuse --foreground --debug_gcs --debug_http \
        --debug_fuse --debug_invariants \
        --key-file=/src/gcloud_service_account.json \
        my-bucket /path/to/mount/point

您可能会看到这样的错误消息

"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."

如果是,则需要为此实例启用此API。

相关问题