LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-08-2008, 10:29 PM   #1
BenMJ
LQ Newbie
 
Registered: Apr 2008
Distribution: Ubuntu
Posts: 8

Rep: Reputation: 0
Urgent! Computer lost power while the / partition was being resized.


I was helping my friend repartition his laptop, deleting his Windows partition and expanding his GNU/linux one to fill the space. It lost power while it was resizing the partition, and now when I look at it using GParted the partition table is all messed up. It is running Ubuntu 8.04, though I doubt that is relevant. GParted shows one, smaller partition of unknown type at one side of the space I wanted the / partition to fill. To my knowledge, this system has no backups, so I would really like to get data off of it or fix it.
 
Old 09-08-2008, 10:47 PM   #2
keithieopia
Member
 
Registered: Feb 2005
Location: Maryland, USA
Distribution: Arch x86_64
Posts: 69

Rep: Reputation: 18
Number 1 Rule: Always Backup

You might be able to retrieve the data by booting off a linux live CD and manually mounting the unknown partition, specifying what file system it is.

Other then that, you might try a forensics program to "scrape" the harddrive for files. Do a google search for one of the many free ones and install one that you feel you could understand (there's linux AND windows ones). Really though, teaching someone to use the forensics program in a forum is impractical so try to find one with good documentation.

For linux try using foremost, it's command line however.
 
Old 09-08-2008, 10:58 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
testdisk might be able to repair the partition table. It's usually very good at it, though no guarantees can be made. It all depends on what the concrete problem is. Use a livecd that has it.

I know that you don't want to hear it right now, but as the previous poster said, backup before attempting things like this, "in case there's a power outage" which is probably the most frequent phrase you can read on the manuals of partitioning tools and how-to's.
 
Old 09-08-2008, 11:01 PM   #4
keithieopia
Member
 
Registered: Feb 2005
Location: Maryland, USA
Distribution: Arch x86_64
Posts: 69

Rep: Reputation: 18
Oh, and it's happened to the best of us too. We all know you're frustration :-)
 
Old 09-08-2008, 11:13 PM   #5
BenMJ
LQ Newbie
 
Registered: Apr 2008
Distribution: Ubuntu
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks, everyone! I'm downloading a live cd image with testdisk now.
 
Old 09-09-2008, 12:06 AM   #6
BenMJ
LQ Newbie
 
Registered: Apr 2008
Distribution: Ubuntu
Posts: 8

Original Poster
Rep: Reputation: 0
Ok, I could use some help. I have run testdisk and it found the extended partition with the swap partition and one other one in it. I can pretty much guarantee that that one is correct. It also found two linux partitions, one of them marked bootable. Looking at the files in them, one looks like nothing is missing. The other looks strangely garbled and incomplete. Based on their positions and contents, I would think that the normal one was the original, pre-resize partition and the other one was where files were being copied to when it lost power. Does that make sense? Is that a reasonable assessment? Are the chances of fixing this as good as I hope?
 
Old 09-09-2008, 12:17 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by BenMJ View Post
Ok, I could use some help. I have run testdisk and it found the extended partition with the swap partition and one other one in it. I can pretty much guarantee that that one is correct. It also found two linux partitions, one of them marked bootable. Looking at the files in them, one looks like nothing is missing. The other looks strangely garbled and incomplete. Based on their positions and contents, I would think that the normal one was the original, pre-resize partition and the other one was where files were being copied to when it lost power. Does that make sense? Is that a reasonable assessment? Are the chances of fixing this as good as I hope?
It's very difficult to give you a definitive answer.

First, I will ask one question: if that HD too big? Is there a chance that you can make a full backup of it in raw mode? For that you will need to have spare space to save an image of that whole disk. If affirmative, use dd to make a raw copy of everything (it will works, since doesn't work at filesystem level).

This way, you can experiment without risking anything, you can always dump back the image into the disk for the next experiment.



Now, for the testdisk part, I can only talk about my experience. It's always been very good at it's work for me. That doesn't make it bullet-proof, and it might fail on this concrete case. If there are many partitions, I would try to restore them one by one, reboot and look how it went before proceeding any further. After repairing the partition, you might also need to run fsck (or the windows scandisk or whatever) to fix the filesystem as well.
 
Old 09-09-2008, 12:35 AM   #8
John VV
Guru
 
Registered: Aug 2005
Posts: 13,057

Rep: Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741Reputation: 1741
i was not making back ups UNTIL i was defraging xp when the 1 week NW USA power outage hit a few years back.

new clean reinstall .
 
Old 09-09-2008, 01:13 AM   #9
BenMJ
LQ Newbie
 
Registered: Apr 2008
Distribution: Ubuntu
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
It's very difficult to give you a definitive answer.

First, I will ask one question: if that HD too big? Is there a chance that you can make a full backup of it in raw mode? For that you will need to have spare space to save an image of that whole disk. If affirmative, use dd to make a raw copy of everything (it will works, since doesn't work at filesystem level).

This way, you can experiment without risking anything, you can always dump back the image into the disk for the next experiment.



Now, for the testdisk part, I can only talk about my experience. It's always been very good at it's work for me. That doesn't make it bullet-proof, and it might fail on this concrete case. If there are many partitions, I would try to restore them one by one, reboot and look how it went before proceeding any further. After repairing the partition, you might also need to run fsck (or the windows scandisk or whatever) to fix the filesystem as well.
I'm currently backing up to an external drive using dd. Good idea.
 
  


Reply

Tags
filesystem, filesystems, gparted, partioning, partition


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ext2 partition lost upon frozen computer jagot Linux - General 9 02-16-2007 03:51 AM
resized windows partition no longer accessible jboy22k MEPIS 3 01-24-2006 12:34 AM
Resized Linux Partition on Dual Boot - Lost Boot RationalRabbit Linux - Newbie 14 12-29-2005 01:02 AM
Resized root partition not showing new size dguse Red Hat 3 12-06-2005 07:45 AM
HELP resized partition and lost all data wolfbeast2 Linux - Newbie 15 08-14-2004 07:05 PM


All times are GMT -5. The time now is 08:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration