In case no one has mentioned it, check out "stress" and "stress-ng" -
they have HDD tests available. (I am going to have to look into that
--ignite-cpu option ... :)
BillK
On 16/6/20 3:17 pm, Dale wrote:
> David Haller wrote:
>> Hello,
>>
>> On Mon, 15 Jun 2020, Dale wrote:
>> [..]
>>> While I'm at it, when running dd, I have zero and random in /dev. Where
>>> does a person obtain a one? In other words, I can write all zeros, I
>>> can write all random but I can't write all ones since it isn't in /dev.
>>> Does that even exist? Can I create it myself somehow? Can I download
>>> it or install it somehow? I been curious about that for a good long
>>> while now. I just never remember to ask.
>> I've wondered that too. So I just hacked one up just now.
>>
>> ==== ones.c ====
>> #include <unistd.h>
>> #include <stdlib.h>
>> #include <stdio.h>
>> static unsigned int buf[BUFSIZ];
>> int main(void) {
>> unsigned int i;
>> for(i = 0; i < BUFSIZ; i++) { buf[i] = (unsigned int)-1; }
>> while( write(STDOUT_FILENO, buf, sizeof(buf)) );
>> exit(0);
>> }
>> ====
>>
>> Compile with:
>> gcc $CFLAGS -o ones ones.c
>> or
>> gcc $(portageq envvar CFLAGS) -o ones ones.c
>>
>> and use/test e.g. like
>>
>> ./ones | dd of=/dev/null bs=8M count=1000 iflag=fullblock
>>
>> Here, it's about as fast as
>>
>> cat /dev/zero | dd of=/dev/null bs=8M count=1000 iflag=fullblock
>>
>> (but only about ~25% as fast as
>> dd if=/dev/zero of=/dev/null bs=8M count=1000 iflag=fullblock
>> for whatever reason ever, but the implementation of /dev/zero is
>> non-trivial ...)
>>
>> HTH,
>> -dnh
>>
>
>
> Thanks David for the reply and others as well. I got some good ideas
> from some experts plus gave me things to google. More further down.
>
> For the /dev/one, I found some which seems to work. They listed
> further down. I think my google search terms was poor. Google
> doesn't have ESP for sure. O_o
>
> I mentioned once long ago that I keep a list of frequently used
> commands. I do that because, well, my memory at times isn't that
> great. Here is some commands I ran up on based on posts here and what
> google turned up when searching for things related on those posts. I
> wanted to share just in case it may help someone else. ;-) dd
> commands first.
>
>
> root@fireball / # cat /root/freq-commands | grep dd
> dd commands
> dd if=/dev/zero of=/dev/sd bs=4k conv=notrunc
> dd if=/dev/zero of=/dev/sd bs=4k conv=notrunc oflag=direct #disables
> cache
> dd if=/dev/zero of=/dev/sd bs=1M conv=notrunc
> dd if=<(yes $'\01' | tr -d "\n") of=
> dd if=<(yes $'\377' | tr -d "\n") of=
> dd if=<(yes $'\xFF' | tr -d "\n") of=
> root@fireball / #
>
>
> The target device or file needs to be added to the end of course on
> the last three. I tend to leave out some of the target to make sure I
> don't copy and paste something that ends badly. dd can end badly if
> targeting the wrong device.
>
>
> root@fireball / # cat /root/freq-commands | grep smartctl
> smartctl -t long /dev/sd
> smartctl -t full ##needs research
> smartctl -c -t short -d sat /dev/sd ##needs research
> smartctl -t conveyance -d sat /dev/sd ##needs research
> smartctl -l selftest -d sat /dev/sd ##needs research
> smartctl -t <short|long|conveyance|select> /dev/sd ##needs research
> smartctl -c /dev/sd ##displays test times in minutes
> smartctl -l selftest /dev/sd
> root@fireball / #
>
>
> The ones where I have 'needs research' on the end, I'm still checking
> the syntax of the command. I haven't quite found exact examples of
> them yet. This also led to me wanting to print the man page for
> smartctl. That is a task in itself. Still, google found me some
> options which are here:
>
>
> root@fireball / # cat /root/freq-commands | grep man
> print man pages to text file
> man <command> | col -b > /home/dale/Desktop/smartctl.txt
> print man pages to .pdf but has small text.
> man -t <command> > /home/dale/Desktop/smartctl.pdf
> root@fireball / #
>
>
> It's amazing sometimes how wanting to do one thing, leads to learning
> how to do many other things, well, trying to learn how anyway. LOL
>
> I started the smartctl longtest a while ago. It's still running but
> it hasn't let the smoke out yet. It's a good sign I guess. I only
> have one SATA port left now. I got to order another PCI SATA card I
> guess. :/ I really need to think on the NAS project.
>
> Thanks to all.
>
> Dale
>
> :-) :-)