Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1953808pxb; Fri, 5 Mar 2021 04:01:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjtLWJCGLE1ksfcsDtRy5MphRkUAEjZsuPDwuAdVzePdSx9vNWNy8G2Qp19TNo/tF+5Aw+ X-Received: by 2002:aa7:d416:: with SMTP id z22mr8584834edq.239.1614945687767; Fri, 05 Mar 2021 04:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614945687; cv=none; d=google.com; s=arc-20160816; b=r+HaqFp9pVyWFo/EIjWG7iyKNnRLmzvkh6vSYeJjg6PzkPRwQZlPDbut9VKAf5McXd eGvyeUeaNyopHpW8nAh4Oxp+ZYNeUl+YGlF0T487RpmMTVGdztahL8FQEX7V8KXIYcPP GxkuM1k9qOUwps7igwVRzEjNB8SkorwFfRp1mvkHPBWJ7p2/V6/dqjHQJb5lHhDv1E8J J284f9CdMDLLDFXR6SXJp5nOJ54487AD5xhOAk7LNkpVvrMPeT8FVFI9VAaTMlZaemSI GOLPa7so0U0gm1zXAHHvhkeeKOBO5B+j+jzpJPWlnzjPQBW1Sx7Nxf9odB/mfIoDIUJ+ WADw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dbRuqCLJ0qutCRyPJA4haV3cGk8yCCE3pYrj3olV3RY=; b=AaXxSo77T0JLpGuTKc9eprXPy6v268dcf+t6ZzTPNYW+oRCZhzOAYUyKC8EAJfk/AQ U+83J5ASBztEQw9c7IPsZZQFz10iVOEzfM6yBWSmFK9E/aklW114sZKyZO/d+VdCzxP7 jHSMH5+H0lsj5uVgN9LzeqXZo9lDYszv+utrE5ocGxWGejK4wLmCywH22bQTvjlHDaHK 6w31OJ61nGQn7MUOJ3ymwQKHbNew6ntdoXiyam39IhNz+UtEw9lor6mfHvih60w7MZp8 CUKXU2utOVI0Q8kt+kKrsFymXkSiAWr8U78erYrlwLqcyUvSmPBIO1acijppC2b16wWl BHZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y6qDVpW+; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si1384283edt.29.2021.03.05.04.01.03; Fri, 05 Mar 2021 04:01:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y6qDVpW+; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229493AbhCEMAJ (ORCPT + 99 others); Fri, 5 Mar 2021 07:00:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30926 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbhCEMAG (ORCPT ); Fri, 5 Mar 2021 07:00:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614945605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dbRuqCLJ0qutCRyPJA4haV3cGk8yCCE3pYrj3olV3RY=; b=Y6qDVpW+yiFv1bKgJFlFt5oeO3xdri0cUL4MPrOtNyl/8ZSAf67ZZJMgL806etOreNeb8e m/IycsENTsLr8OmJmxaV9PMCHRzMgcH71JcZAvG+QzfNZUtIBfKvT+jWlao8gxh59kfV8s dJZe1yj8qpP42jOJ53uKTG6rA6cG6l0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-544-pbvOxdsvOpeeu291v_adzQ-1; Fri, 05 Mar 2021 07:00:02 -0500 X-MC-Unique: pbvOxdsvOpeeu291v_adzQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9FE2A108BD11; Fri, 5 Mar 2021 12:00:01 +0000 (UTC) Received: from work (unknown [10.40.193.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5407100164C; Fri, 5 Mar 2021 12:00:00 +0000 (UTC) Date: Fri, 5 Mar 2021 12:59:57 +0100 From: Lukas Czerner To: Sedat Dilek Cc: Theodore Ts'o , linux-ext4@vger.kernel.org Subject: Re: badblocks from e2fsprogs Message-ID: <20210305115957.x4gbppxpzxuvn2kd@work> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Mar 01, 2021 at 04:42:26PM +0100, Sedat Dilek wrote: > On Mon, Mar 1, 2021 at 4:34 PM Theodore Ts'o wrote: > > > > On Mon, Mar 01, 2021 at 04:12:03PM +0100, Sedat Dilek wrote: > > > > > > OK, I see. > > > So I misunderstood the -o option. > > > > It was clearly documented in the man page: > > > > -o output_file > > Write the list of bad blocks to the specified file. > > Without this option, badblocks displays the list on > > its standard output. The format of this file is > > suitable for use by the -l option in e2fsck(8) or > > mke2fs(8). > > > > RTFM. > > > I will say that for modern disks, the usefulness of badblocks has > > decreased significantly over time. That's because for modern-sized > > disks, it can often take more than 24 hours to do a full read on the > > entire disk surface --- and the factory testing done by HDD > > manufacturers is far more comprehensive. > > > > In addition, SMART (see the smartctl package) is a much more reliable > > and efficient way of judging disk health. > > > > The badblocks program was written over two decades ago, before the > > days of SATA, and even IDE disks, when disk controlls and HDD's were > > far more primitive. These days, modern HDD and SSD will do their own > > bad block redirection from a built-in bad block sparing pool, and the > > usefulness of using badblocks has been significantly decreased. > > > > Thanks for the clarification on badblocks usage and usefulness. > > OK, I ran before badblocks: > > 1. smartctl -a /dev/sdc (shell) > 2. gsmartcontrol (GUI) > > The results showed me "this disk is healthy". > As you said: Both gave a very quick overview. > > - Sedat - Just note that not even the device firmware can't really know whether the block is good/bad unless it tries to read/write it. In that way I still find the badblocks useful because it can "force" the device to notice that there is something wrong and try to fix it (perhaps by remapping the bad block to spare one). Of course you could use dd for that, but there are several reasons why badblocks is still more convenient tool to do that. That said you should also check the SMART data _after_ you run the badblocks to see if it encountered any read errors and/or remapped some blocks. -Lukas > > [1] https://superuser.com/questions/171195/how-to-check-the-health-of-a-hard-drive >