inode number problem for files mounted by "minikube mount"

37 Views Asked by At

I am trying to mount the files from a directory in my local Windows PC to minikube v1.32.0, so that it can be used by minikube as the host path of a persistent volume. I first mounted the directory to minikube using the following command:

minikube mount mysql/data:/mnt/db --uid 999 --gid 999

Then in another command prompt, I went into the minikube to check whether the mounting is ok:

minikube ssh

Then I ran the ls command to check, and got the following results:

docker@minikube:~$ ls -lid /mnt/db
4098 drwxrwxrwx 1 999 docker 4096 Jan 12 01:40 /mnt/db
docker@minikube:~$ ls -lid /mnt/db/*
  196610 -rw-rw-rw- 1 999 docker   196608 Jan  6 12:53  /mnt/db/#ib_16384_0.dblwr
 8585218 -rw-rw-rw- 1 999 docker  8585216 Jan  6 08:51  /mnt/db/#ib_16384_1.dblwr
    4098 drwxrwxrwx 1 999 docker     4096 Jan  6 14:03  /mnt/db/#innodb_redo
    4098 drwxrwxrwx 1 999 docker     4096 Jan  6 14:03  /mnt/db/#innodb_temp
      58 -rw-rw-rw- 1 999 docker       56 Jan  6 08:51  /mnt/db/auto.cnf
 3040597 -rw-rw-rw- 1 999 docker  3040595 Jan  6 08:53  /mnt/db/binlog.000001
     182 -rw-rw-rw- 1 999 docker      180 Jan  6 08:59  /mnt/db/binlog.000002
     823 -rw-rw-rw- 1 999 docker      821 Jan  6 12:25  /mnt/db/binlog.000003
     182 -rw-rw-rw- 1 999 docker      180 Jan  6 12:29  /mnt/db/binlog.000004

(Result trimmed)

The result has a big problem: The inode numbers of /mnt/db/ is the same as /mnt/db/#innodb_redo and /mnt/db/#innodb_temp, which does not make sense because the inode numbers should be identical for each file.

And if we notice carefully, we find that the inode number for each file is always the file size in bytes plus 2. So if 2 files have the same size, they will be allocated the same inode number! This is bound to be an error when the files are used as the host path of the persistent volume, for example, when a pod running MySQL uses it.

I am not sure if this is a well-known error for minikube 1.32.0, but I cannot find any related webpages discussing it. Is it an error of my "minikube mount" command, and how should I fix it?

p.s. I tried to remove the --uid and --gid in the "minikube mount", the same result happened (except the uid of the files became docker instead of 999).

0

There are 0 best solutions below