Results 1 to 1 of 1

Thread: Marking Bad Blocks on Logical Volume Filesystem with Multiple Physical Volumes

  1. #1
    Join Date
    Apr 2020
    Beans
    7

    Marking Bad Blocks on Logical Volume Filesystem with Multiple Physical Volumes

    Hey everyone,


    I've encountered a situation where I needed to mark bad blocks on a ext4 - Logical Volume (LV) filesystem that spans multiple Physical Volumes (PVs) within a Volume Group (VG). I wanted to share my approach and confirm if it's the correct way to handle this scenario.


    I have a setup where my LV spans across two HDDs (sda and sdc) within a VG.
    One of the HDDs (sda) has bad blocks that need to be marked to prevent data corruption.

    Approach:

    Identify Bad Blocks:

    I used the badblocks command to scan the HDD (sda) and generated a list of bad blocks.
    Command:

    Code:
    sudo badblocks -sv /dev/sda > badblocks_sda.txt
    (would -w be beneficial?)


    Mark Bad Blocks on LV filesystem:


    After obtaining the list of bad blocks, I use fsck -l to mark them on the LV filesystem.

    Command:

    Code:
    sudo fsck -l badblocks.txt /dev/nfs_dir_vg/nfs_dir_lv
    Questions:


    Does this approach correctly mark bad blocks on the LV filesystem spanning multiple PV?
    Are there any potential pitfalls or better approaches to handle this scenario?
    I would appreciate any insights or feedback on this approach. Thank you!
    Last edited by pogo7; 3 Weeks Ago at 01:08 PM.

Bookmarks

Posting Permissions

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