Copied prtvtoc to original disk


 
Thread Tools Search this Thread
Operating Systems Solaris Copied prtvtoc to original disk
# 1  
Old 03-10-2016
Copied prtvtoc to original disk

Hi,
It is Solaris-10 with ZFS. c0t1d0 is original disk. c0t0d0 was faulty disk, which was replaced with new one and by mistake somebody ran opposite command
Code:
# prtvtoc /dev/rdsk/c0t0d0s0 | fmthard -s - /dev/rdsk/c0t1d0s0

Now rpool is in suspended state. Right now server is up, but allowing ssh connections only from console. Rebooting it may screw it more, so I want to take any action carefully. Can somebody give some pointer ?
Code:
# zpool status rpool 
 pool: rpool 
 state: SUSPENDED 
 status: One or more devices are faulted in response to IO failures. 
 action: Make sure the affected devices are connected, then run 'zpool clear'. 
 see: http://www.sun.com/msg/ZFS-8000-JQ 
 scan: none requested 
 config: 
  NAME STATE READ WRITE CKSUM 
 rpool UNAVAIL 171 39 0 experienced I/O failures 
 mirror-0 UNAVAIL 610 8 0 experienced I/O failures 
 c0t0d0s0 UNAVAIL 0 0 6 experienced I/O failures 
 c0t1d0s0 UNAVAIL 0 8 0 experienced I/O failures

# 2  
Old 03-10-2016
If you have a backup of the old vtoc, then restoring is still possible, and data becomes accessable again.
Perhaps you have another system with the same partitioning?
BTW we have a special system where we run a weekly prtvtoc backup:
Code:
# crontab -l | grep vtoc
50 23 * * 0 (/usr/sbin/prtvtoc /dev/dsk/c1t0d0s0;/usr/sbin/df -lk) > /partition_table

# 3  
Old 03-10-2016
Unfortunately that putty session was closed after changes, so we do not know, what was original vtoc. I am still trying to think hard, if there is another solution instead of restoring from backup, which will be a pain.
BTW, thanks for crontab entry. This is a good idea. Probably we can implement this, at least in production boxes.

Last edited by solaris_1977; 03-10-2016 at 06:44 PM..
# 4  
Old 03-10-2016
Another idea:
if you installed from opscenter you can lookup partitioning information there.
Might be unprecise though.
# 5  
Old 03-11-2016
As everything but the vtoc is still on disk, you might be able to rebuild the vtoc by analyzing the disk contents and searching for file system magic numbers.
# 6  
Old 03-11-2016
That is also good idea, which can work.
I got its explorer attached in a old Oracle SR. I pulled vtoc information from there and fixed it in failsafe mode. Now, it is good.
Thank you both of you.
# 7  
Old 03-12-2016
Quote:
Originally Posted by solaris_1977
Unfortunately that putty session was closed after changes, so we do not know, what was original vtoc. I am still trying to think hard, if there is another solution instead of restoring from backup, which will be a pain.
BTW, thanks for crontab entry. This is a good idea. Probably we can implement this, at least in production boxes.
Always a good idea to have putty take logs.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Prtvtoc not working

Hi, I am trying to mirror a disk (which was already mirror and after breaking it, doing it again). This is root disk and in control of veritas. Somehow, slice information is not coming correctly on this. Can somebody give some pointer to fix it ? root@tdrp091:/root# prtvtoc /dev/rdsk/c3t0d0s2 |... (6 Replies)
Discussion started by: solaris_1977
6 Replies

2. Windows & DOS: Issues & Discussions

Hard disk partition on Original windows 7 Home Premium

Respected Members, I am using compaq CQ41, with factory install windows 7, there is three drives namely (local Disk( c: ) 158 GB free of 281 GB), (RECOVERY( D: ) 2.69 GB free of 16.7GB) and (HP_TOOLS( E: ) 92.7 MB free of 99.3 MB). i don't want to lost it,but... (2 Replies)
Discussion started by: Vijay Tyagi
2 Replies

3. UNIX for Dummies Questions & Answers

I may have copied unix script !

How to write unix scripts which I may have been copied from the command prompt into the shell.. Can we do an FTP ? (1 Reply)
Discussion started by: Taekit
1 Replies

4. Solaris

fmthard showing error with prtvtoc

Hi all, I am trying to use the disk for mirror where in the mirror disk is of 160 gb and the rootdisk is of 80 gb. when i am trying to write the vtoc i am getting below error i tried the below command #prtvtoc /dev/rdsk/c0t0d0s0 |fmthard -s -/dev/rdsk/c0t2d0s0 and got below ... (26 Replies)
Discussion started by: kumarmani
26 Replies

5. Solaris

Output from prtvtoc

Hi All, when i run the command prtvtoc the output shows 38309 cylinders 38307 accessible cylinders as per my undertanding the 1st cylinder is used for storing the vtoc , how about the second cylinder ? where its used and for what purpose? Thanks (9 Replies)
Discussion started by: kumarmani
9 Replies

6. Solaris

prtvtoc command

If i have diks layout like below 0 root wm 0 - 634 471.29MB (635/0/0) 965200 1 var wm 635 - 2014 1.00GB (1380/0/0) 2097600 2 backup wm 0 - 2732 1.98GB (2733/0/0) 4154160 3 swap wu 2015 - 2704 ... (1 Reply)
Discussion started by: tpx99
1 Replies

7. Shell Programming and Scripting

How to check file is being copied

I wanna check whether a file is being copied ,i.e the file size is increasing. Thanks for your help (2 Replies)
Discussion started by: anhkeen
2 Replies

8. UNIX for Dummies Questions & Answers

Ignoring already copied files

I'm almost brand new to UNIX, so I have no idea if how easy or difficult this would be, or if it's even possible. I've been using FTP to copy a total of about 150gb of files to a remote drive. Since the directory being copied is so large, I've been trying to break it up into smaller chunks based... (0 Replies)
Discussion started by: nvandyke
0 Replies

9. Programming

monitoring files copied onto hard disk

hi... i need pointers to books/website... 'm trytin to write a daemon that monitors files of particular type(eg. text or pdfs) copied onto the hard disk. the daemon should detect the above n write the file name (along with the absolute path) to a file. please DO NOT give me the code... (2 Replies)
Discussion started by: abhi_abhijith
2 Replies
Login or Register to Ask a Question