LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-30-2007, 10:55 PM   #46
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116

The command is sudo sfdisk -l /dev/sda

Testdisk is often capable of identifying all the partitions on the drive and recovering the partition table.

Since sda1 is now identified as a Linux partition (not swap) if you run fsck on it you should be able to recover the superblock and restore the structure. Once this is done it shouldn't be hard to find the second partition and restore the partition table.
 
Old 07-30-2007, 11:00 PM   #47
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8
The command is sudo sfdisk -l /dev/sda

Testdisk is often capable of identifying all the partitions on the drive and recovering the partition table.

Since sda1 is now identified as a Linux partition (not swap) if you run fsck on it you should be able to recover the superblock and restore the structure. Once this is done it shouldn't be hard to find the second partition and restore the partition table.
Ok I did

Sudo fsck /dev/sda1

/dev/sda1: recovering journal
/dev/sda1: clean, 11/16285696 files, 559099/32561739 blocks

Now what is the next step? testdisk again?
 
Old 07-30-2007, 11:04 PM   #48
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
what does sfdisk -l say????

You need to force fsck to run: fsck -f /dev/sda1

Then you should be able to mount it and see your files.

Then, yes, run testdisk again, using the settings that cause it to search for partitions.
 
Old 07-30-2007, 11:11 PM   #49
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8
what does sfdisk -l say????

You need to force fsck to run: fsck -f /dev/sda1

Then you should be able to mount it and see your files.

Then, yes, run testdisk again, using the settings that cause it to search for partitions.
/dev/sda1: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 11/16285696 files (9.1% non-contiguous), 559099/32561739 blocks


I am going to run testdisk now and see what it looks like. I can't mount it and see the files, do I need to reboot? It may have just been screwed up by lack of knowledge on my part. I will post the testdisk analysis as soon as it is done.
 
Old 07-30-2007, 11:14 PM   #50
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
I think I did do something wrong between last night and now. I am not seeing anything except an empty partition, and old DesktopBSD partition and a small linux partition I think was DreamLinux. I am going to copy all of this thread and refer to it if this ever happens again, also to learn from it.

OH WAIT, lol. I forgot to do something with testdisk, it is searching it now. All I can say is Duh on my part, lol. I will show the results shortly.

Last edited by Neo-Leper; 07-30-2007 at 11:16 PM.
 
Old 07-30-2007, 11:22 PM   #51
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
What. Does. Sfdisk -l /dev/sda Say.
 
Old 07-30-2007, 11:23 PM   #52
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Disk /dev/sda: 19457 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 16214 16215- 130246956 83 Linux
/dev/sda2 0 - 0 0 0 Empty
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
 
Old 07-30-2007, 11:30 PM   #53
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
I am not seeing what I saw before. The first Linux on the list below is the current one and is empty, except for the lost and found folder. The last two are the smaller Linux (Knoppix or DreamLinux.) I did notice two on the top of the list as it was searching but it didn't list it when it was done like it did before. Did something get screwed up then, something I did?




* Linux 0 1 1 16214 254 63 260493912
P FreeBSD 16215 0 1 17744 254 63 24579450
D Linux 17745 0 1 19456 254 63 27503280
D Linux 17867 0 1 19456 254 63 25543350
 
Old 07-30-2007, 11:40 PM   #54
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Alright. At least mkswap didn't resize sda1; sda2 is still present at the back of the volume.

Try running e2fsck with an alternate superblock, since the front superblock appears to have had the files removed (I wondered if mkswap would do that).

First we need to find where the alternate superblocks are. First, unmount the drive, then enter:

mke2fs -n

This will list the location of the alternate superblocks on the partition. Then, enter this:

e2fsck -f -b ##### /dev/sda1

where ##### is the number of an alternate superblock.

Presuming that not all the superblocks have been cleared (they haven't been because if they had been probably the files would be gone too) then one of the alternates should yield your entire directory structure and recover the information.
 
Old 07-30-2007, 11:44 PM   #55
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Before I go to far here is the output of mke2fs -n

sudo mke2fs -n /dev/sda1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
16285696 inodes, 32561739 blocks
1628086 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
994 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
 
Old 07-30-2007, 11:45 PM   #56
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Neo-Leper
I am not seeing what I saw before. The first Linux on the list below is the current one and is empty, except for the lost and found folder. The last two are the smaller Linux (Knoppix or DreamLinux.) I did notice two on the top of the list as it was searching but it didn't list it when it was done like it did before. Did something get screwed up then, something I did?




* Linux 0 1 1 16214 254 63 260493912
P FreeBSD 16215 0 1 17744 254 63 24579450
D Linux 17745 0 1 19456 254 63 27503280
D Linux 17867 0 1 19456 254 63 25543350
So you did have 4 partitions? If so it found them. It says sda2 is a FreeBSD partition. Is this right?
 
Old 07-30-2007, 11:46 PM   #57
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8
So you did have 4 partitions? If so it found them. It says sda2 is a FreeBSD partition. Is this right?

Yes BSD and the two Linux below would have been on sda2
 
Old 07-30-2007, 11:47 PM   #58
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
No, that isn't right. The 4th partition is overlaying the 3rd partition partially. You can't have that. Better blow it off.
 
Old 07-30-2007, 11:48 PM   #59
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Neo-Leper
Yes BSD and the two Linux below would have been on sda2
BSD and both Linux on the SAME partition???

Doesn't match what testdisk found...
 
Old 07-30-2007, 11:49 PM   #60
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8
No, that isn't right. The 4th partition is overlaying the 3rd partition partially. You can't have that. Better blow it off.

They where installed at different times though. BSD and the two Linux after that were never on the HD at the same time.
 
  


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
Recover lost data under Solaris10 intel (Urgent) dsids Solaris / OpenSolaris 4 07-06-2007 07:08 AM
urgent! how to recover files from os x? stairwayoflight Other *NIX 12 06-10-2007 06:55 PM
recover a missing partition pankaj99 Linux - General 5 06-03-2006 07:09 PM
Recover Partition??? HELP!!!! villusion Linux - Hardware 7 10-11-2005 04:34 PM
Recover a lost partition!!!!! Caveman Linux - Newbie 4 09-26-2003 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:52 AM.

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