CoreOS : Read-only file system
Asked Answered
C

1

8

When moving file to /usr/local/bin it says:

mv: inter-device move failed: 'kubectl' to '/usr/local/bin/kubectl';
unable to remove target: Read-only file system

I already try chmod

How can the CoreOS directory be made writable?

Cacomistle answered 14/6, 2016 at 11:8 Comment(4)
did you try chmod ?Sofia
Yes already tried.Cacomistle
Are you root ? Otherwise can you create a symlink ?Sofia
No, I can't even if I am root.Cacomistle
T
22

In CoreOS the /usr partition is read-only by design, so /usr/local/bin/ will be read-only too (unless you mount another disk there). This allows for the auto-updating CoreOS uses to keep the OS current. You can see the partition layout here.

You can install your binaries, etc. in another partition. I usually use /opt/ for this purpose. You can either mount another disk on /opt/ or rely on the fact that / is read-write, depending on your use case, size of files installed, etc.

Theta answered 14/6, 2016 at 14:38 Comment(1)
The default path on CoreOS is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bin. By default /opt/ and /opt/bin don't exist. Do mkdir -p /opt/bin; mv ./kubectl /opt/bin/kubectlGrill

© 2022 - 2024 — McMap. All rights reserved.