Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Add hdparm utility #935

Closed
polarina opened this issue Oct 18, 2015 · 12 comments
Closed

Add hdparm utility #935

polarina opened this issue Oct 18, 2015 · 12 comments

Comments

@polarina
Copy link

Is it possible to have the hdparm utility included in CoreOS? I need it to disable write-caching on boot on my hard disks in order to work around a firmware bug that causes them to lock-up when doing heavy I/O.

Symptoms are described here (esp. dmesg output and the disks' model number): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625922

Currently I have a copy of the hdparm binary in my home directory, which is sub-optimal.

@mmelnyk
Copy link

mmelnyk commented Nov 12, 2015

hdparm can be deployed in container. I am using it in this way.
example:

docker run -it --privileged --rm repos/tools/hdparm -g /dev/sda
geometry = 121601/255/63, sectors = 1953525168, start = 0

docker run -it --privileged --rm repos/tools/hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 1142 MB in 2.00 seconds = 570.99 MB/sec

@mischief
Copy link

mischief commented Dec 1, 2015

@polarina is using a container sufficient for you?

@polarina
Copy link
Author

polarina commented Dec 1, 2015

Running hdparm within a container would work for me. I would much prefer the binary to be distributed with CoreOS though.

It would complicate my setup slightly as I would now need to start up docker and have the hdparm container finish executing before starting up subsequent containers that depends on the mount-point backed by these disks being available.

@crawford
Copy link
Contributor

crawford commented Dec 1, 2015

@polarina this is where systemd-nspawn or rkt are going to be much more useful. Because of their process model, you can just run hdparm inside of the container and wait for the exit; just like a standard process.

@mischief
Copy link

mischief commented Dec 1, 2015

perhaps the toolbox could be useful here...

@crawford
Copy link
Contributor

crawford commented Dec 1, 2015

Good idea.

ExecStartPre=/usr/bin/toolbox yum install --assumeyes hdparm
ExecStart=/usr/bin/toolbox hdparm ${BLAH}

@gsakkar
Copy link

gsakkar commented Apr 26, 2016

Hi
We require to power down one of the disk during runtime.as part of the testcase
is it possible to achieve without installing the hdparm in coreos
Can you please suggest any alternative method

@mmelnyk
Copy link

mmelnyk commented Apr 27, 2016

@gsakkar - Use this Dockerfile:

FROM alpine
RUN /sbin/apk update && \
    /sbin/apk upgrade && \
    /sbin/apk add hdparm && \
    /bin/rm -rf /tmp/* /var/tmp/* /var/cache/apk/*

ENTRYPOINT ["/sbin/hdparm"]

After that you can do:

$ docker build -t hdparm .
....
$ docker run -it --privileged --rm hdparm -g /dev/sda
/dev/sda:
 geometry      = 4177/255/63, sectors = 67108864, start = 0

@gsakkar
Copy link

gsakkar commented Apr 27, 2016

Thanks mmelnyk
if we execute hdparam -Y /dev/diskn it will go for sleep mode let me know if we try to write/read on the diskn will it automatically spin up happen? or we require to reboot

i want to perform power down disk without using hdparm in container or host machine is it possible

@gsakkar
Copy link

gsakkar commented Apr 27, 2016

i want to know how to recover the disk after issue sleep command through hdparm -Y option

@victorgp
Copy link

This command works:

docker run -it --privileged --rm chriswayg/toolbox hdparm -T -t /dev/sda

@crawford
Copy link
Contributor

We aren't going to include this in the base image since it can be easily installed in a container.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants