usr/bin directory is not showing up in attached volume in gcp

105 Views Asked by At

GCP: I've created a snapshot of an VM using boot disk, and then i created a volume from this snapshot and attached and mount the volume to another VM. In the mount path, i don't find the /usr/bin directory.

The VM from which i've created the snapshot is running on COS(container optimize operating system).

1

There are 1 best solutions below

4
Kiran Kotturi On

/usr/bin contains executable files that are not part of the core operating system. These are considered to be system wide binaries. Since certain directories are excluded from snapshots, files belonging to these users will remain in the file system.

/bin contains executable files that are part of the core operating system. These files need to be accessible before /usr gets mounted. (for instance, the mount command is in /bin/mount).

If the snapshot was created from a boot disk that was formatted with a filesystem that does not include the /usr/bin directory, then the volume will not have the /usr/bin directory either. Reformat the volume with a filesystem that includes the /usr/bin directory. You can do this using the mkfs.ext4 command from the Medium blog written by Peter Hou. Also,you can refer to the linode community page replies from bellis and dwfreed for more details.

Once the volume has been reformatted, you can mount it again and the /usr/bin directory will be present.