Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004

    Question Checking a hd using badblocks

    I have a server that tends to break down and I would like to check the drive. I heard the command to do this is "badblocks" but the server is very important and I do not want to delete anything. Does anyone know the right command to scan a drive for bad blocks without deleting any data or partitions ? I found this command but I am not sure if it is safe:

    badblocks -o blocks-list.txt -s -w /dev/hda1 88326

    What is the correct command ?

  2. #2
    Join Date
    Dec 2003
    Sunny So. Calif.
    From the info screen for 'badblocks':

    Important note: If the output of badblocks is going to be fed to the
    e2fsck or mke2fs programs, it is important that the block size is prop-
    erly specified, since the block numbers which are generated is very
    dependent on the block size in use. For this reason, it is strongly
    recommended that users not run badblocks directly, but rather use the
    -c option of the e2fsck and mke2fs programs.

    So you may want to heed their own warning/advice and use the e2fsck program instead....

    More info on e2fsck:

    info e2fsck

    It does have an option (-n) to do a read-only test, you may want to do that first to see if it does find anything (and not make any changes). But definitely READ the info screens before doing anything! (I am not liable for any damage by using the program)

    If you do use it, I would also use the -v option (verbose)

    And *always* make a complete verified backup of your server before doing anything! (if it is possible anyways)
    Last edited by jamesyeeoc; 07-10-2005 at 08:35 AM.

Posting Permissions

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