Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recover partition table?

Status
Not open for further replies.

motor98

Programmer
Mar 30, 2005
3
US
I have two disks on a sun blade 100. I just installed a solaris8 on the first disk. The installation was successful. But the problem is now I lost all data / partition on my second hard disk.

The possible reason could be:
1. I used default web start install. During the installation I didn't select the disk2. so I am not sure if solaris 8 will automatically erase the whole partition table on all disks in the system.
2. I did something like:
fdisk /dev/rdsk/c0t2d0s0 (the 2nd disk)
and answered 'yes' when it asked "type 'y' to accept the default partition. otherwise type 'n' to edit the partition table.

Now I guess 2 has caused the problem. and might have wiped out the partition table on the 2nd disk. Is there any way to recover it back? cuz the data are very important. I am a beginner in solaris. please offer your generous help here.

Thanks,
motor98
 
Motor98
I hope you have a back up of the disk. Fdisk destroys the file allocation table or in this case the superblock which contains all the file information.
 
motor98

Why not try to disconnect the hard disk 2 and restart your PC first. I take this first disk still operate normally.

Solaris does not take duplicate / and get confused, so use your first disk / and other partition then boot into OS. once this done.

#df -k
to check the disk usage. You also need to look at /etc/vfstab for details of your partition table. Comment out the /dev/rdsk/c0t2d0s0. Shutdown and attach your second disk again.

I have a quick question for you. When you do fdisk /dev/rdsk/c0t2d0s0 and answer 'y' to default. Did you make a new filysystem or just simply partition the disk. You need to make the filysystem and mount it, otherwise you will not see in the partition though.

good luck,
cafe12
 
Thanks Cafe12. I didn't make a filesystem on the second disk. So now disk2 is totally empty. But I guess the partition table was accidently wiped out.

Right now the system is still booting and still operating normally. My problem is I need those data on disk2. I would like to recover them back. Do you know if there is any ways to do that?

 
Motor98,
You can try this. Not sure if this is going to work on a PC based Solaris System. On a Sun box, copies of the superblock are stored in various locations on a disk partition. The file system uses the superblock stored on the first block.

Run the command "newfs -N /dev/rdsk/c0t2d0s0". The -N option will printout the file system parameters without actually creating the file system. Normally the 2nd superblock is stored in block 32. Not sure where it is on a PC based system.

Once you find an alternate superblock location, run the following command.

fsck -o b=<alternate superblock number> /dev/rdsk/c0t2d0s0

Example: fsck -o b=32 /dev/rdsk/c0t2d0s0


 
Thanks to bfitzmai very much. Your answer is exactly what I am looking for. I tried them and found some issues.

It's sparc cpu system. but it's disks are IDE disks. and I tried the following , and got:
#newfs -Nv /dev/rdsk/c0t2d0s0
/dev/rdsk/c0t2d0s0: I/O error
but
#newfs -Nv /dev/rdsk/c0t0d0s0 (my first disk) was ok. It printed a lot of disk information. And the first disk is using 32 as the alternate superblock.
so I also tried this:
#fsck -o b=32 /dev/rdsk/c0t2d0s0
Alternate super block location : 32
Can't open /dev/rdsk/c0t2d0s0

Do you know what's going on with the second disk? Is it damaged physically?

Thanks very much,
 
I have never used fdisk on a Solaris system. Reading the man pages for fdisk, if you answered "Y", the VTOC (Virtual Table Of Contents) will be erased. This table contains the file information something like the FAT (File Allocation Table) for windows. I called it the superblock in my first post. The superblock contains all the file inode information. Without this table, the data on the disk is just a bunch of 1s and 0s. Hopefully someone will read this post and has some kind solution for you. Unfortunately, I think your data is gone.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top