LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-28-2013, 10:09 AM   #1
farnsy
LQ Newbie
 
Registered: Nov 2008
Location: Pennsylvania
Distribution: Fedora 19
Posts: 24

Rep: Reputation: 2
Disappearing partition table--bad sectors or something else?


I have a 4TB spinning hard drive in my home file server with a single partition for data (no OS) and several times I have had the following situation:

* Suddenly the disk disappears from the system. I print out the partition table with parted and there isn't one or it's not recognized.

* I create a new gpt partition there using parted

* I choose recover partition (within parted) and it finds my old partition and restores it.

There hasn't been any data loss on my partition itself. This has happened 4 times or so in the last few months. I moved the disk from one computer to another and it happened in the second computer as well.

I figured I have some bad blocks or something, but when I run fsck with the -c option, it checks the partition and doesn't find anything wrong. This makes sense since I'm not actually having problems with data on the partition. With my limited knowledge it seems like I might have a hardware problem on the disk in the first few bytes of the disk, where partition table is stored. Unfortunately that theory is based on my imperfect understanding of the way these disks work. I don't know how (or if at all) one can check the partition table itself for bad sectors or if one can mark them as bad and use others.

Does my hypothesis even make sense? If so, how might you go about rectifying the situation so we don't have to recover the partition every couple of months or so? Is there an alternative explanation for what's going on?

Since the drive functions ok and doesn't even permanently lose any of my data, I'd prefer a solution that doesn't involve chucking it and getting a new one. Ideas?
 
Old 07-28-2013, 10:34 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
Quote:
Originally Posted by farnsy View Post
I figured I have some bad blocks or something, but when I run fsck with the -c option, it checks the partition and doesn't find anything wrong.
You could be right about this being related to bad blocks. This could be what's happening:
  • The drive has started developing bad sectors at the very beginning of the drive surface
  • A bad sector is detected by the drive when the OS tries to read it, and it is then marked for replacement by the drive firmware
  • Since the bad sector is in the middle of the partition table, the partitions appear to have "disappeared", but no data besides the primary copy of the partition table is actually lost
  • When you rewrite the partition table, the drive performs a sector reallocation and the write operation succeeds
If this is indeed what's been happening, there should be traces of it in the logs. Check /var/log/messages (or /var/log/syslog or whatever log file is appropriate for your distribution) for signs of read errors or ATA timeouts.

Also, smartctl -a /dev/sda | grep _Sector will tell if you how many sectors have been reallocated, and if any are pending (assuming the drive in question is /dev/sda, of course).
 
Old 07-28-2013, 11:53 PM   #3
farnsy
LQ Newbie
 
Registered: Nov 2008
Location: Pennsylvania
Distribution: Fedora 19
Posts: 24

Original Poster
Rep: Reputation: 2
Great comments. Unfortunately I don't have the relevant logs any more. I'll check it closely from here on, though. Appreciate your insights.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gparted says I have bad sectors in windows partition after deleting things silvyus_06 Linux - General 7 11-02-2010 05:54 PM
Best way/tool to back up and restore an NTFS partition with bad sectors? Robert Carnegie Linux - Software 3 01-27-2010 07:56 PM
Isolate bad sectors on an ext3 partition? Cinematography Linux - Hardware 4 05-04-2007 03:31 PM
Bad Sectors on Linux Partition svoltmer Linux - Newbie 1 08-06-2004 10:45 PM
bad sectors in windows partition okok Linux - Hardware 1 05-12-2002 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration