在ECS实例中挂载Overlayfs失败,存在该问题的ECS实例有以下特征:
dmesg
命令,在内核日志中会出现以下错误日志的一条:
overlayfs: lowerdir is in-use as upperdir/workdir
overlayfs: lowerdir path overlapping in-use upperdir/workdir
overlayfs: upperdir is in-use by another mount, mount with '-o index=off' to override exclusive upperdir protection.
overlayfs: workdir is in-use by another mount, mount with '-o index=off' to override exclusive workdir protection.
overlayfs: lowerdir is in-use as upperdir/workdir of another mount, mount with '-o index=off' to override exclusive upperdir protection.
overlayfs: workdir is in-use as upperdir/workdir of another mount, mount with '-o index=off' to override exclusive upperdir protection.
overlayfs: upperdir is in-use as upperdir/workdir of another mount, mount with '-o index=off' to override exclusive upperdir protection.
Overlayfs的挂载参数lowerdir、upperdir或workdir不能同时作为另一个挂载点的upperdir或workdir,否则可能存在未知风险。即在挂载过程中当内核检测到以上情况时,会返回-EBUSY
错误信息,同时打印错误日志。
阿里云提醒您:
- 如果您对实例或数据有修改、变更等风险操作,务必注意实例的容灾、容错能力,确保数据安全。
- 如果您对实例(包括但不限于ECS、RDS)等进行配置与数据修改,建议提前创建快照或开启RDS日志备份等功能。
- 如果您在阿里云平台授权或者提交过登录账号、密码等安全信息,建议您及时修改。
注意:
- 使用该临时解决方法可能存在未知风险,使用之前请慎重评估。
- Overlayfs的主要使用场景是容器服务,容器服务中一直存在多个挂载点共用同一个upperdir或workdir现象,但是系统内核支持通过关闭
index
特性(即指定index=off
挂载参数),来规避这个问题。
dmesg
命令后,如果您出现以下错误日志的一条,则可以参考后续步骤进行处理。注意:如果您出现另外两条报错信息,本方案无法解决该问题。
overlayfs: upperdir is in-use by another mount, mount with '-o index=off' to override exclusive upperdir protection.
overlayfs: workdir is in-use by another mount, mount with '-o index=off' to override exclusive workdir protection.
index=off
挂载参数,则可以规避以上报错,成功挂载Overlayfs。此时内核会打印以下其中一条日志。
overlayfs: lowerdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.
overlayfs: upperdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.
overlayfs: workdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.
mount
命令,查看之前挂载Overlayfs的相关参数,包括每个挂载点的lowerdir、upperdir、workdir参数,其输出格式类似如下。
overlay on /.../merged type overlay (rw,relatime,lowerdir=...,upperdir=...,workdir=...)
在文档使用中是否遇到以下问题
更多建议
匿名提交