From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2E1411382C5 for ; Tue, 16 Jun 2020 07:17:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B8A55E0DEE; Tue, 16 Jun 2020 07:17:23 +0000 (UTC) Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7066BE0DE3 for ; Tue, 16 Jun 2020 07:17:23 +0000 (UTC) Received: by mail-oo1-xc30.google.com with SMTP id x17so3892792oog.6 for ; Tue, 16 Jun 2020 00:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to; bh=SbEa40ZBe6RngZE8T1H0AXXcMfdKVZwsGUTqcpMB7ig=; b=HtMc15ozrb51eHWZLUftoqn11LHAeWkCsjTynyHPL4lHOeT/py48Yf36EP2bzeJh6B /azIgmv9ftLo51fxg1La+aPrzQ5vsAOtXw874vjWHLardMqfPAOIpBwEpriv08x7qm5w v8TJG9wyPAJ4eDn/gpeypM9yPl8Xq3DNVQlK3N15l+FXTEw6WXhnfmPzuzGbJmaSR1tO Bs4E6+gJftgdYniCE9TskpkDYqbsk3ZhE9xayEczDdQtIw7QZooodoWfiW94fKI/H+v9 +SMRWOf0gEFVvngvMoQDfb8/pjgpACNE87FUoq+9Szab0Z8fidIzENpKnBo+ch9iEKHB T3Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to; bh=SbEa40ZBe6RngZE8T1H0AXXcMfdKVZwsGUTqcpMB7ig=; b=UDz8dZfe9pYS3EINZ9mFcl6Zdof3q/M3/QfyuQD6x5piQYucisLLg5XdhWEc7DRHev T/qB8mQUfooqXpRYHNgApEU6+F1O0Pp7w4ZkWykUB3ge6KjQU10h6tvZkp56J+R6RR3d k0ivn2ZTIqs1N4oExWPgJaEFUWbC8qtrKHdbpcXxkVEXT8/5yBpS5ws0XdI+UvdJmvRU ZEpJWnxb7nss6S6mvCXT/ecxkwvJ5Pj96GwrjSMbPT360efbD/2lqzh2DZLD0Y2BcrvQ wPjFWPR5YGOK8K3gvZPgog8KsiQKpbacS/XGgyKSkrmO9F3TSLQzhsV0sAiUuTYpcVmr Vd3A== X-Gm-Message-State: AOAM531wcay8F8bYTpk39EHP8i3oDkgC1eT3H6a3jdjeeG0w4RkU35x8 CCGFo/+SZjW+VVo+TXWQe4g= X-Google-Smtp-Source: ABdhPJxmWDyvdn7Bh+yrJVo8HFZL7Pyhg/zTkbBN+dfs2k/zcN4H4FHPXRAPjZS6NodcooBiSCSNGg== X-Received: by 2002:a4a:980d:: with SMTP id y13mr1245483ooi.35.1592291842645; Tue, 16 Jun 2020 00:17:22 -0700 (PDT) Received: from [192.168.0.100] (adsl-074-188-241-018.sip.asm.bellsouth.net. [74.188.241.18]) by smtp.gmail.com with ESMTPSA id j89sm3980167otc.72.2020.06.16.00.17.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jun 2020 00:17:21 -0700 (PDT) Subject: Re: [gentoo-user] Testing a used hard drive to make SURE it is good. To: gentoo-user@lists.gentoo.org References: <6d77acb3-5754-06cb-b8ef-2f1a5d7d8084@gmail.com> <20200615231836.xje3kkkihsxrvhaz@grusum.endjinn.de> From: Dale Openpgp: preference=signencrypt Autocrypt: addr=rdalek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DgRHq9A3NknKRMcgFacX6eIhANkMFo6oJVjuEgy1dvu1wFfDq7c+i8GAHu L4pYzyXYu6PporlNNU0xSwdVgzM/uuK0lt+UxCimgC+YR3IezgDcbfudb7h9dGIwL+bbPL0A EQEAAYkCNgQYAQgAIBYhBNnuy6u48FpLrRsJhe8Qz9da75mcBQJcXOzIAhsMAAoJEO8Qz9da 75mcXZ4P/1YXgWDZek7mhzrf6uaQzMxa92P89HeWz4PlgB/32symeEFAV04WazzBZffI8AYY rGA1Xmu/2VaB9+FOODyKhUWBc2UL0NRWBk6POwboyTdKlclmpixaN9zLcBt0YLejoRfN1B/5 aQf9/lUDZMnAiCyz0FgeqEMUshldmwWC35RqnjrCbbuk2vIqSH6BLDIXU6jQrLHE1DF0ai41 wLtQFAFXPhn45n0ZwYhVs4Z32z4sjXrIvgBgCaXa4HM+L1Klne0KiNM8ReFTTpTE0SgyDOSZ O3MOa2n77i6JbVtsbiFYnNeP3J9S/l3jevGpZEtNQOKrIm1MW8jGuHWtsDeMkT/mCcSodlkt PxIo+mMK9GpGvG2hW80LiohqNfUbNwAmr3blOYY4URPXPRnEnPs4pmTmL5owjw2dkg145i9I D42Tq+XZ6YtWt3SGzGbAYow6XwTwZ5NFAzV9UQuCGrDw4KWan6O6Z+VIYWsn0UMZlu1Obxna aocofkaUCbISK26kImuD1aA8juSHC18Qv1xUage6/UakbSxyDtACqt6hOVFKX3IA59ApdNRT +2x3iCmlvF9MJsGgFq6IpqL+Fk7iWV8Kjbz0wQOId6N9+JdQh3LrLaS7a1PowUm1z9DK5/O0 Yg+gpDnEOOFI7WM5u7a7FSM2Z/LXGVwel/0eWvLk9tN6 Message-ID: <158351d5-27cc-88d0-951c-893d0b5ad8aa@gmail.com> Date: Tue, 16 Jun 2020 02:17:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 In-Reply-To: <20200615231836.xje3kkkihsxrvhaz@grusum.endjinn.de> Content-Type: multipart/alternative; boundary="------------99CA5545CF806F7A52A4A4F6" X-Archives-Salt: 7fba1d84-cdab-4b13-bd0b-1c562e5fbfe2 X-Archives-Hash: ebf4509277752a912acb652081489f5e This is a multi-part message in MIME format. --------------99CA5545CF806F7A52A4A4F6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit 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 > #include > #include > 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 /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 | col -b > /home/dale/Desktop/smartctl.txt print man pages to .pdf but has small text. man -t > /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 :-)  :-)  --------------99CA5545CF806F7A52A4A4F6 Content-Type: text/html; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit
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

:-)  :-) 
--------------99CA5545CF806F7A52A4A4F6--