Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Corrupt partition table?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
hannson
n00b
n00b


Joined: 03 May 2005
Posts: 39

PostPosted: Tue Jun 14, 2005 8:08 pm    Post subject: Corrupt partition table? Reply with quote

Hi.

After working like hell for more than a week I finally got the time to sit down home with my computer. It had been turned on for a while before and I didn't shut it down - The problem was that I got errors everywhere from fluxbox saying it couldn't write to some files in my home directory due to low disk space. I opened console and did:
Code:
df -h

Oh, damn! My root partition (I use a single partition for my whole system, except for /boot and swap, and my "legally" downloaded stuff.) was only 19 GB instead of 120+ GB. Of course this was only a typical computer drama for me, so I began: [/i]

Code:

fsck.ext3 -n /


Knowing that it would totally mess up my data running fsck on a mounted partition I used the -n switch to check. I got a couple of filesystem errors and I thought I should boot of liveCd and fix it. Round two, FIGHT!

Code:

fsck -p /


Successfully fixed the filesystem, Yay *reboot* :D. Everything worked flawlessly, or well, that's what I thought! :x It's still 19GB so I checked:
Code:
fdisk /dev/sda


My partition table looked like I thought,

    sda1 32M (linux)

    sda2 512M (swap)

    sda1 19G (linux)


Damn!:?
I haven't changed anything yet, exept for the fsck but I have no idea of when this happened and what has happened since then, it could have been corrupted when I left the computer a week ago.

My root partition is ext3, mostly defaults from the handbook (AMD64). Next time I will probably have a seperate partitions for different type of work :?

Asus A8n-SLI deluxe
3000+ Amd64
512 Ram
using Nforces sata controler for my 160Gb harddisk



Why did this happen?
- Was it a software or hardware failure?
- Maybe bios?
What options do I have from here?




Edit: Added system spec.
Back to top
View user's profile Send private message
nahpets
Veteran
Veteran


Joined: 05 Oct 2003
Posts: 1178
Location: Montreal, Canada

PostPosted: Tue Jun 14, 2005 11:38 pm    Post subject: Reply with quote

Since you have ~100GB of unpartitioned space, I'd suggest using that partition for "/home". You could copy over all of your current "/home" to the new partition, leaving you with 19GB for your system files. It's usually better to have "/home" mounted on another partition anyways...
_________________
Let me guess, you picked out yet another colorful box with a crank that I'm expected to turn and turn until OOP! big shock, a jack pops out and you laugh and the kids laugh and the dog laughs and I die a little inside.
Back to top
View user's profile Send private message
hannson
n00b
n00b


Joined: 03 May 2005
Posts: 39

PostPosted: Tue Jun 14, 2005 11:54 pm    Post subject: Reply with quote

No you see, the problem is that my partition was ~130Gb and suddenly it became 19Gb... why that happened I don't know and where is the rest of my data. I can't write on that harddrive atm because I could overwrite the prior data, right?
Back to top
View user's profile Send private message
nahpets
Veteran
Veteran


Joined: 05 Oct 2003
Posts: 1178
Location: Montreal, Canada

PostPosted: Wed Jun 15, 2005 3:37 am    Post subject: Reply with quote

How full was the drive before it "shrank"? You're right that you would lose data. I guess you have to do some searching for corrupted partition tables. Maybe just editing the partition manually will fix it. If you really want to make sure not to lose any data, I'd start with finding a 120GB drive, and copying your original to it using "dd". You can then play around with the copied drive without worrying about losing your data.
_________________
Let me guess, you picked out yet another colorful box with a crank that I'm expected to turn and turn until OOP! big shock, a jack pops out and you laugh and the kids laugh and the dog laughs and I die a little inside.
Back to top
View user's profile Send private message
hannson
n00b
n00b


Joined: 03 May 2005
Posts: 39

PostPosted: Wed Jun 15, 2005 1:57 pm    Post subject: Reply with quote

I don't remember, pretty full I guess :P

So I will:
Code:

dd if=/dev/sda of=sda.bak.iso conv=noerror


I put the conv=noerror there just in case if there are any problems with bad sectors

But then I will have a HUGE 140gb file, I'm just not sure I can store that :(
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Wed Jun 15, 2005 2:05 pm    Post subject: Reply with quote

What exactly is the output of 'p' from
Code:
fdisk /dev/sda

?
Partition corruption would likely have rendered the partition unusable, not resize it.
Back to top
View user's profile Send private message
hannson
n00b
n00b


Joined: 03 May 2005
Posts: 39

PostPosted: Wed Jun 15, 2005 11:18 pm    Post subject: Reply with quote

Basicly there's nothing wrong with the partition itself, the third/last partition is ~121GB smaller than before. The first (boot partition) is OK. I can use the partition, I can copy from it for example
Back to top
View user's profile Send private message
nahpets
Veteran
Veteran


Joined: 05 Oct 2003
Posts: 1178
Location: Montreal, Canada

PostPosted: Wed Jun 15, 2005 11:53 pm    Post subject: Reply with quote

Could it be that the problem is physical? Maybe your drive is dying??
_________________
Let me guess, you picked out yet another colorful box with a crank that I'm expected to turn and turn until OOP! big shock, a jack pops out and you laugh and the kids laugh and the dog laughs and I die a little inside.
Back to top
View user's profile Send private message
syg00
l33t
l33t


Joined: 23 Aug 2004
Posts: 907
Location: Brisbane, AUS

PostPosted: Thu Jun 16, 2005 12:08 am    Post subject: Reply with quote

hannson wrote:

So I will:
Code:

dd if=/dev/sda of=sda.bak.iso conv=noerror

I put the conv=noerror there just in case if there are any problems with bad sectors
But then I will have a HUGE 140gb file, I'm just not sure I can store that :(
Try dd_rescue
Back to top
View user's profile Send private message
CriminalMastermind
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 132
Location: toronto

PostPosted: Thu Jun 16, 2005 2:12 am    Post subject: Reply with quote

i'll start with a warning, i'm not sure i have ever done exactly this, but i have done some playing with the partition table and file systems in the past. as mentioned, working from a backup to another drive is safest if you'd like to keep your data for sure. at minimum, backing up your partition table would be a good idea. i've seen how to do that somewhere with dd, which would be best, or by piping
Code:
fdisk -l /dev/sda
to a file on a floppy disk or another hard drive.

now that the warning is out of the way.... getting your data back depends now i'd say on the physical location of your partitions on your drive and where the free space "appeared". if the ending location of your partition changes, you should still be able to get you data back by simply, firing up fdisk, deleting your corupt partition, making a new partition of the same type, with the same starting cylinder and an ending cylinder greater then or equal to where it was before it got corupted. if you are brave, write the partition table back to disk and run fsck.ext3 on the partition with your fingers crossed.

one thing i'm not sure of is you have already run fsck.ext3 on the partition when it was the wrong size. i'm not sure what that did. i'm sorry if anything i above is incorrect leads to making the problem worse... but i think that should work. good luck, and if you are brave enough to try this, let me know if it works.
_________________
"I can picture a perfect world that knows of no war... and I can picture me attacking that world, because they'd never expect it."
Back to top
View user's profile Send private message
hannson
n00b
n00b


Joined: 03 May 2005
Posts: 39

PostPosted: Sun Jun 19, 2005 12:09 am    Post subject: Reply with quote

I'm now working on it as we speak. I've deleted my third partition and created a new one same size as the old one. Now i'm fscking and crossing my fingers, I don't give a shit anymore, I saved all my critical data to another hdd :roll:


1. EDIT:
I've finished with no success! It looks like it's formated as 19GB but now if I check fdisk the partition is 130GB - bummer, may be I'll check dd_rescue

2. EDIT:
Looks like I've made a mistake. This drive was only using 19GB/160GB (that's good). I haven't lost any data so far (I think). I'm going to re-partition my harddisk - the smarter way
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum