Results 1 to 5 of 5

Thread: What's the benefit of btrfs-scrub when you only have one drive?

  1. #1
    Join Date
    Apr 2016
    Location
    North America
    Posts
    537

    Default What's the benefit of btrfs-scrub when you only have one drive?

    btrfs scrub is used to scrub a btrfs filesystem, which will read all data and metadata blocks from all devices and verify checksums. Automatically repair corrupted blocks if there’s a correct copy available.
    Note: Scrub is not a filesystem checker (fsck) and does not verify nor repair structural damage in the filesystem.
    https://btrfs.wiki.kernel.org/index....ge/btrfs-scrub


    Scrub operation reads all data and metadata from the devices and verifies the checksums. It's not mandatory, but may point out problems with faulty hardware early as it touches data that might not be in use and bitrot.


    If there's a redundancy of data/metadata, ie. the DUP or RAID1/5/6 profiles, scrub is able to repair the data automatically if there's a good copy available.
    https://github.com/kdave/btrfsmainte...ster/README.md

    I understand the benefit if you have RAID data duplication, but I'm curious about the benefits when you don't have that.

    The quote above indicates it might "point out problems with faulty hardware". Has anyone ever encountered that? What do you do in that situation -- reformat or start shopping for a new drive?

    I'm also wondering about the benefit of it being done automatically by btrfsmaintenance on a single drive. How am I going to be informed if it does find "problems with faulty hardware"?

  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,769

    Default Re: What's the benefit of btrfs-scrub when you only have one drive?

    Makes installing Linux harder maybe??? Other then that I don't know of an advantage

  3. #3
    Join Date
    Sep 2012
    Posts
    5,233

    Default Re: What's the benefit of btrfs-scrub when you only have one drive?

    Single drive can still have DUP profile and this is default for metadata. Also periodical scrub gives you early warning of data corruption. It is always better to be notified in advance and have time to decide how to handle it than to get EIO when actually working with data.

  4. #4
    Join Date
    Apr 2016
    Location
    North America
    Posts
    537

    Default Re: What's the benefit of btrfs-scrub when you only have one drive?

    Quote Originally Posted by arvidjaar View Post
    Single drive can still have DUP profile and this is default for metadata.
    Thanks -- I missed that; although, it looks like it's not the default for a SSD.

    A single device filesystem will default to DUP, unless a SSD is detected. Then it will default to single.
    https://btrfs.wiki.kernel.org/index....age/mkfs.btrfs

    If it tells me there is some corrupt data, is the first step to check if an old snapshot is clean?

  5. #5
    Join Date
    Sep 2012
    Posts
    5,233

    Default Re: What's the benefit of btrfs-scrub when you only have one drive?

    [QUOTE=ravas;2913200]looks like it's not the default for a SSD.
    Indeed, you are right.
    If it tells me there is some corrupt data, is the first step to check if an old snapshot is clean?
    I would say "yes".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •