recovery partition table from fdisk?


 
Thread Tools Search this Thread
Operating Systems Solaris recovery partition table from fdisk?
# 1  
Old 03-31-2005
recovery partition table from fdisk?

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
# 2  
Old 03-31-2005
without interaction solaris don't "format" other disks then the selected (!) normaly there is no way to get a partition table back

see:

https://www.unix.com/solaris/17766-big-uh-oh-bad-magic-number-disk-label.html

gP

**
i am working a long time with solaris now, but i've used fdisk only 2 times for scripting. always wondering what everyone does with that tool.... you can manage the partition table with the CLI-tool "format" or with the GUI "smc"
**
# 3  
Old 03-31-2005
you may be able to get a good guess at the lost partition table if you can look at another box with an approximate build ... if not, try setting the partition table on the second drive to hold everything in the root slice ...

for future use ... get a script that prints out the partition table on both drives regularly so you have a hard copy of it ... (see ugly code; use your disk designators)
Code:
for disk in c0t0d0s2 c0t1d0s2 (...)
do
    echo "Begin ${disk}"
    prtvtoc /dev/rdsk/${disk}
    echo "End ${disk}\n\n"
done > myfile
mailx -s "disk partitions for `hostname` - `date`" my.email < myfile

to recover,
Code:
awk '/Begin ${disk}/,/End ${disk}/' myfile | egrep -v "^Begin|^End" | fmthard -s - /dev/rdsk/${disk}


Last edited by Just Ice; 04-01-2005 at 07:31 PM.. Reason: code correction
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. BSD

OpenBSD fdisk - Linux fdisk compatibility ?

Hello, MBR partition table made by linux fdisk looks certainly not correct when printed by openbsd fdisk: Partition table created on linux (centos 6.3): # fdisk -l /dev/sdc Disk /dev/sdc: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 *... (2 Replies)
Discussion started by: vilius
2 Replies

2. Red Hat

Can I change the partition type with fdisk without disrupting data?

Hello, I have been going through our environment and I see we have a few servers with LVM's setup and the file system type is still set to "83" within fdisk. If I change this to "8e", will it hurt the data or cause any loss? I need to know for sure before I make the change. (1 Reply)
Discussion started by: s ladd
1 Replies

3. Shell Programming and Scripting

Non-interactive fdisk partition in script

Hi, How can I run fdisk partition in a script without interactive input? In manual procedure, I run fdisk device, select n, select p, presess enter for default start number (1), press enter to default end number, then select w for writing to the partition table. The command looks like... (3 Replies)
Discussion started by: hce
3 Replies

4. Solaris

Fdisk partitions on boot disk and disaster recovery

I'm preparing to recover a Oracle Fire X4170 server in a disaster recovery test at a different location than in prod. I have some questions about fdisk partitions. I'm using Solaris 10 update 10. On my prod server, the boot disk has 2 partitions, diagnostic and solaris. Is the diagnostic... (1 Reply)
Discussion started by: TKD
1 Replies

5. Filesystems, Disks and Memory

Recovery of formatted ext3 partition

Hi! I have a really big problem right now. I (accidently) formatted a ext3 partition with "mkfs.ext3 /dev/sda1". The problem is that I REALLY need some files from there. The partition had a size of about 4GB, after accidently formatting it, I accidently rewrote Grub on it :wall: I hope I didn't... (3 Replies)
Discussion started by: al0x
3 Replies

6. SCO

Backup MBR an Partition Table

hi How can I backup MBR an Partition Table of SCO 5.0.6? (7 Replies)
Discussion started by: ccc
7 Replies

7. Filesystems, Disks and Memory

Partition management: lvm? fdisk? parted? (on RAID)

Hello, I have a RHEL system with two 500GB hard drives in RAID 1 (I think hardware, but not 100% certain - any way to tell?). It looks like it was just set up in default configuration with a small boot partition and one huge partition for the rest, which composes a LVM volume. I want... (1 Reply)
Discussion started by: builder88
1 Replies

8. UNIX for Advanced & Expert Users

Remove /dev/sdb partition using fdisk - BY ACCIDENT!

Hello everyone - Please forgive me if I violate the forum's etiquette as this is my very first post. I'm posting this on both the dummies and the advance section with the hope for any responses. I stumbled on this forum while frantically looking for an answer to a dumb, ignorant thing I did... (5 Replies)
Discussion started by: kevindoman
5 Replies

9. UNIX for Dummies Questions & Answers

Remove /dev/sdb partition using fdisk - BY ACCIDENT!

Hello everyone - Please forgive me if I violate the forum's etiquette as this is my very first post. I'm posting this on both the dummies and the advance section with the hope for any responses. I stumbled on this forum while frantically looking for an answer to a dumb, ignorant thing I did... (2 Replies)
Discussion started by: kevindoman
2 Replies

10. UNIX for Advanced & Expert Users

resizing the partition table

Host 1 ------- Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 1911 18.56GB (1912/0/0) 38913024 1 swap wu 1912 - 5434 34.19GB (3523/0/0) 71700096 2 backup wm 0 - 14086 136.71GB ... (5 Replies)
Discussion started by: sriny
5 Replies
Login or Register to Ask a Question

Featured Tech Videos