2

I would like to run this command from within a docker-compose container:

 nvme smart-log /dev/nvme0n1p1

Unfortunately I get this error:

 /dev/nvme1n1p1: No such file or directory

How do I map this to the Docker environment?

Thanks!

2
  • 1
    Does the container have access to the hardware at the level where such a command could be run? I'd say that it isn't. The point of Docker and containers is to even further separate the software, such as it is, from the hardware. Perhaps explaining why you want to be able to interact directly with the storage hardware from within the container would allow us to suggest alternate ways of doing this. Commented Feb 17, 2021 at 4:36
  • 1
    Docker container is not a VM, unless you mount the /dev tree in your container (and I am not sure if that is possible) you will not be able to do this.
    – Sathyajith Bhat
    Commented Feb 17, 2021 at 7:21

1 Answer 1

1

Here's a partial answer, but still wishing for something better!


we were able to make this work by adding this flag:

--privileged -v /dev/nvme0n1p1:/dev/nvme0n1p1 \

Interestingly enough, there are two NVME drives, and adding this flag for one drive allowed us to check both in the container.

We would prefer not to give the container "privileged" access, however, read-only would be acceptable.

as to why we are doing this: we are running SAMSUNG NVME SSDs on our dev servers and (not surprisingly) we've had a few SSD failures :) - but like any potent drug, we refuse to give up the gains from these drives! Our goal is to actively monitor them for potential failure, by running daily managed scripts to check on their health. It's much easier for deployment to have them run within out docker environment(s), as it would fit nicely into the codebase. Thanks!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .