Find the answer to your Linux question:
Results 1 to 5 of 5
We have a system that is regularly checked with smartctl. Recently, smartctl tests have begun failing and the LBA of the first error is within the swap partition. I found ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    4

    Error on LBA within swap Partition


    We have a system that is regularly checked with smartctl. Recently, smartctl tests have begun failing and the LBA of the first error is within the swap partition. I found this neat little guide:

    http://smartmontools.sourceforge.net/BadBlockHowTo.txt

    Since tools such as tunefs and fsck do not work on swap partitions, I am unsure as to how to force the bad sector to reallocate.

    I have already tried disabling swap with swapoff, mkswap'ing the appropriate partition, and then swapon'ing it (essentially formatting swap). The errors persist.

    I'm not sure how concerned I should be about this. If the kernel is unable to grab swap from this location on the disk I would think it would simply try again until it gets a valid block. Unless we have full swap usage, I don't believe this would present an error. It's not creating any issues in terms of system performance/usability, but I'd like to correct the error so smartctl will stop complaining.

    My alternative at this point would be to disable my swap partition and use a swap file. Optimally, I'd like to reallocate this bad sector so that smartctl passes its selftests again.

    I'm running CentOS 4.6 if it makes a difference.

  2. #2
    Just Joined!
    Join Date
    Sep 2005
    Posts
    4
    Additionally, I've read that mkswap -c /dev/hda3 (obviously hda3 is my swap partition) will check it for bad blocks while it formats. I'm not sure if it just reports them or if it reallocates them as well. Last time I ran it, the machine stopped responding. Now that it's the wee hours, I'm running it again to see how it goes. I'll repost with details, but I'd certainly appreciate any suggestions.

  3. #3
    Just Joined!
    Join Date
    Sep 2005
    Posts
    4
    mkswap -c /dev/hda3 reported 32 bad pages. Sadly, it does not appear to have corrected the issue:

    Code:
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Short offline       Completed: read failure       20%      8737         28812755
    another error in selftest.

  4. #4
    Just Joined!
    Join Date
    Sep 2005
    Posts
    4
    Oddly enough, after running mkswap -c on the swap partition and rebooting the machine, I haven't had any smartctl errors.

  5. #5
    Just Joined! nigelc's Avatar
    Join Date
    Oct 2006
    Location
    Silverwater,NSW Australia
    Posts
    32
    Hi,
    it might ok now. you could try "dd if=/dev/hda3 of=/dev/null"
    see if it gets any errors.
    than go "dd if=/dev/hda3 of=/dev/hda3"
    or, then "dd if=/dev/zero of=/dev/hda3" this should write zeros all over the partiition.
    Do a swapoff first
    cheers

Posting Permissions

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