How do I (re)install a partition table on a corrupted SATA disk?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I (re)install a partition table on a corrupted SATA disk?
I have a SATA disc, Samsung 500GB SATA2. It's fairly
new (~3 months) and came dual booted with XP and
Ubuntu 7.04. After a few weeks I started having trouble
with the Ubuntu partition and then the XP partition.
I'll skip the details of what that was, for now.
Main point is, that I tried to solve the problems
by reinstalling both OSs (and upgrading Ubuntu to 7.10).
Further problems. So I thought it could be the dual boot
configuration. I've used dual boots before but with the
systems on separate disks. I put Ubuntu on the whole disk. Same problems. Then XP on the whole disk. Same problems. I've also tried to put Fedora 8 and Debian (etch, r2) on the whole disk -- Debian wouldn't recognize the partitions and the installer wouldn't go beyond the partition stage, either manual or guided.
Now I'm guessing that, with all these reinstalls, I've mucked up the partition table. I've used RH9 for years (which uses MBR, not LVM) and didn't understand that the disk originally came with an entirely different setup.
I got Knoppix and tried to use gparted and QtParted to
reformat the disk. They gave peculiar results at first and now say that there is only a single partition, of 1.9GB, on the disk.
My question is: can I rescue this disk? Is it possible that it is corrupted beyond repair?
I'd be content with Debian on the whole disk, or preferably Debian with another Linux. I don't have to have the XP.
I've never really understood MBRs and I don't understand
GPT at all, though I'm reading the wikipedia article on it. I thought that a MBR or GPT would always remain, no matter how the actual entries in it changed (assuming that the disk wasn't physically damaged). There doesn't seem to be much about GPT on this or other forums.
If you can help, I'll be very grateful. I've been trying
different things on this for three weeks now.
Why don't I send it back to the vendor under warranty?
Partly because he's a small one-man show and so far is
not answering emails. I'm still trying to get through. Also, I'm feeling that I may have made the original problem worse by doing all these reinstalls.
Other specs: Athlon64 dual core 6000+, Asus Pundit P1-Ah2, 2GB DDR667.
I would download the ultimate boot CD and run some disk diagnostics first to see if the drive is failing. Then try to use testdisk to restore an old partition table.
Have a read of this thread. Maybe I should have another look at that drive - it' a "mobile backup" that I haven't touched in a couple of weeks. Was o.k. last I looked.
Thanks for these, pljvaldez and syg00. I didn't know about the UBCD. I've got that now.
I found Testdisk overwhelming so I started by using gparted to check and reformat each partition. This seemed to work. However Debian (etch, r2) still failed to install, though it got a lot further: it crashed about 12% into the package retrieval. I then ran Testdisk and it said `no harddisk found'. Loading the live disk, I got
On the UBCD there's some hard disk diagnostic tools under the "Hard Disk Tools" menu item that (use either SHDIAG or HUTIL for samsung drives) you can run to see if the disk is failing.
I took your advice,plj, and used HUTIL (2.03) from the UBCD. I ran all
the checks and the disc passed them all. The read surface scan
reported no errors (took 2.5 hours) and I did a low-level format
(14 hours).
I then ran testdisk on it and testdisk saw the disc. I wrote a
new MBR record on it and rebooted.
Then I started an install of Debian as before. It failed at about
the same stage as before --- having retrieved about 520 of the
673 files, it complains of a disc failure.
I have a few thoughts or queries that I'd appreciate any
comments on:
===> Testdisk 6.8 offered a menu of disc types which were only:
Intel, Mac, None, Sun, xbox. I chose Intel, but the processors
I have are AMD Athlon64s. The disc is a SATA.
===> When I ran `Analyse cylinder' it paused at cylinder 20565
out of 60800. Pause was about 90 seconds long. Before and after,
it ran steadily at about 100 cylinders/sec. This cylinder is
at 33% and the Debian installer also paused at 33% during the
formatting of /home and then skipped on without running to 100%.
Could there be some problem here that HUTIL did not see?
===> This box originally came with GPT. I used Testdisk to write
a new MBR, but maybe these are incompatible? Should I accept
the LVM option when partitioning?
Here, for the record, is the partition table debian offered:
[QUOTE=Kamoflauge;3035829]
===> When I ran `Analyse cylinder' it paused at cylinder 20565
out of 60800. Pause was about 90 seconds long. Before and after,
it ran steadily at about 100 cylinders/sec. This cylinder is
at 33% and the Debian installer also paused at 33% during the
formatting of /home and then skipped on without running to 100%.
Could there be some problem here that HUTIL did not see?
Might well be so. You could also boot from DVD (rescue mode) and do an e2fsck -cv on that partition to weed out any possible bad blocks.
Try using Wipedisk. This will format the whole disk including the boot section. Then you can try to reinstall everything. Or you can use Partion Magic. This will let you set up windows and Linux on the same hard drive. Or you can load Windows on 1 hard drive then disconnect it and then load Linux on the other one. Keep in mind that the last will not give you a duel boot, as you will have to use the bios to switch drives.
===> When I ran `Analyse cylinder' it paused at cylinder 20565
out of 60800. Pause was about 90 seconds long. Before and after,
it ran steadily at about 100 cylinders/sec. This cylinder is
at 33% and the Debian installer also paused at 33% during the
formatting of /home and then skipped on without running to 100%.
Could there be some problem here that HUTIL did not see?
Sounds like there is a sector issue, problem I see is that modern hard drives isolate bad sectors automatically when they require too many passes to be read. Then again, if the sectors are un-allocated, the system won't try to read them. I use SpinRite to isolate bad sectors, it works very well but costs money. There may be some open source applications from a Live CD that can do the same job, maybe Google that one.
Many zeroing utilities have the ability to isolate bad sectors when writing zeros to every sector, (wipe a drive).
Last edited by Junior Hacker; 02-05-2008 at 05:28 PM.
Reason: Added info.
===> Testdisk 6.8 offered a menu of disc types which were only:
Intel, Mac, None, Sun, xbox. I chose Intel, but the processors
I have are AMD Athlon64s. The disc is a SATA.
This refers to the architecture of the computer, the processor and hard drive type is irrelevant. Because Windows was installed, it is highly likely to be Intel.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.