public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Dale <rdalek1967@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Testing a used hard drive to make SURE it is good.
Date: Tue, 16 Jun 2020 02:17:19 -0500	[thread overview]
Message-ID: <158351d5-27cc-88d0-951c-893d0b5ad8aa@gmail.com> (raw)
In-Reply-To: <20200615231836.xje3kkkihsxrvhaz@grusum.endjinn.de>

[-- Attachment #1: Type: text/plain, Size: 4072 bytes --]

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

:-)  :-) 

[-- Attachment #2: Type: text/html, Size: 5032 bytes --]

  reply	other threads:[~2020-06-16  7:17 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 16:07 [gentoo-user] Testing a used hard drive to make SURE it is good Dale
2020-06-15 19:20 ` Spackman, Chris
2020-06-15 19:54 ` Mark Knecht
2020-06-15 20:00   ` Rich Freeman
2020-06-15 20:04     ` Mark Knecht
2020-06-16  7:34   ` Dale
2020-06-16  8:22     ` Wols Lists
2020-06-16  9:04       ` Dale
2020-06-16 11:02         ` Wols Lists
2020-06-16 11:26           ` Dale
2020-06-16 11:36             ` Michael
2020-06-16 12:25               ` Rich Freeman
2020-06-16 23:38                 ` antlists
2020-06-17  9:47                   ` Rich Freeman
2020-06-23 16:14                 ` Sid Spry
2020-06-23 17:20                   ` Rich Freeman
2020-06-23 18:44                     ` Sid Spry
2020-06-16 13:14               ` Dale
2020-06-16 23:24             ` antlists
2020-06-17  4:47               ` Dale
2020-06-17 12:32                 ` Wols Lists
2020-06-17 12:04                   ` Rich Freeman
2020-06-16  8:29     ` Neil Bothwick
2020-06-16  8:52       ` Dale
2020-06-15 19:54 ` [gentoo-user] " Grant Edwards
2020-06-15 20:04   ` Grant Edwards
2020-06-15 23:03 ` [gentoo-user] " madscientistatlarge
2020-06-15 23:18 ` David Haller
2020-06-16  7:17   ` Dale [this message]
2020-06-16  7:32     ` William Kenworthy
2020-06-16  7:37       ` Dale
2020-06-17 15:27     ` David Haller
2020-06-18  8:07       ` Dr Rainer Woitok
2020-06-23 16:08     ` Sid Spry
2020-06-23 16:38       ` [gentoo-user] " Grant Edwards
2020-06-23 16:41         ` Sid Spry
2020-06-23 17:26           ` Dale
2020-06-23 18:32             ` Sid Spry
2020-06-23 19:37               ` Dale
2020-06-23 20:03                 ` Rich Freeman
2020-06-24  4:26               ` Wols Lists
2020-06-18  9:14   ` [gentoo-user] " Dale
2020-06-22  1:52     ` Pengcheng Xu
2020-06-22  2:15       ` Dale
2020-06-22 19:10     ` David Haller
2020-06-22 20:29       ` Dale
2020-06-22 22:59         ` David Haller
2020-06-23  4:18           ` Dale
2020-06-17  6:02 ` Dale
2020-06-20  9:50 ` Dale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158351d5-27cc-88d0-951c-893d0b5ad8aa@gmail.com \
    --to=rdalek1967@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox