Solved

Solaris : Corrupt label; wrong magic number errors

Posted on 2013-01-30
8
5,985 Views
Last Modified: 2013-02-07
Hi experts,

I have  a sun server with solaris 10 configured with ZFS.

One of the disks has Wrong magic number error.

The server is a production server with critical datas. I saw this procedure on oracle website but I don't know if there is a risk of data loss http://docs.oracle.com/cd/E19455-01/806-1075/msgs-1187/index.html

please help!


Log errors
Jan 18 02:00:03 sd1b scsi: [ID 107833 kern.warning] WARNING:
/pci@0/pci@0/pci@2/scsi@0/sd@6,0 (sd8):
Jan 18 02:00:03 sd1b Corrupt label; wrong magic number
0
Comment
Question by:cismoney
8 Comments
 
LVL 76

Expert Comment

by:arnold
ID: 38836012
Is this a replacement non SUN labeled drive or one that went bad??

The situation will dictate.
I.e. use format and partition to print the partition table
0
 
LVL 11

Expert Comment

by:un1x86
ID: 38836087
Is your ZFS pool mirrored?

zpool status
0
 
LVL 16

Accepted Solution

by:
Joseph Gan earned 100 total points
ID: 38837662
Follow this link from Oracle website should work:
http://docs.oracle.com/cd/E19963-01/html/821-1459/disksprep-52.html

Because took me while to find following info online:

"Now with ZFS if you don't specify a slice, you're essentially asking  
ZFS to use and autolabel the entire disk which will put an EFI style  
label on since the older sun style VTOC labels have an upper limit of  
1TB per disk (EFI should work up to 2^64 LBAs.)  The older sun VTOC  
labels typically use slice 2 as a backup to show the entire disk and  
will store the label in the first 512B, whereas the EFI labels will  
use 34 sectors at the start of the disk to store the label, and will  
also reserve a portion at the tail end of the disk for a backup label.

With the older sun style VTOC labels, if you ever overwrite the first  
the first 512B on cylinder 0 of the disk (eg: dd if=/dev/zero of=/dev/
rdsk/c1t1d0s2 where s2 is the typical backup label starting at  
cylinder 0) you'll overwrite the label, whereas with the EFI label  
you have to overwrite both protected sections of the disk."
0
 

Author Comment

by:cismoney
ID: 38837678
@un1x86 , yes the ZFS Pool is mirrored but the 2 disks with corrupt label don't appear in the zpool status, i am not sure if there are data in these disk, don't really know how to check.

@Arnold , no its not a replacement drive. It seems that the drive went bad.

If there are data on these disks, do you think relabel the disk can erase data???

bash-3.00# zpool status -v rpool
 
 pool: rpool
 state: ONLINE
 scrub: scrub completed after 0h31m with 0 errors on Wed Jan 30 20:23:38 2013
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c1t0d0s0  ONLINE       0     0     0
            c1t1d0s0  ONLINE       0     0     0
        spares
          c1t3d0s0    AVAIL   
          c1t2d0s0    AVAIL   

errors: No known data errors

Open in new window



bash-3.00# format
bash-3.00# format 
Searching for disks...done

c1t6d0: configured with capacity of 136.71GB
c1t7d0: configured with capacity of 136.71GB


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@0,0
       1. c1t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@1,0
       2. c1t2d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@2,0
       3. c1t3d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@3,0
       4. c1t4d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@4,0
       5. c1t5d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@5,0
       6. [b]c1t6d0 [/b]<SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@6,0
       7. [b]c1t7d0[/b] <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0/pci@0/pci@2/scsi@0/sd@7,0
Specify disk (enter its number): 7
selecting c1t7d0
[disk formatted]
[b]Disk not labeled.  Label it now?[/b] 

Open in new window


bash-3.00# prtvtoc /dev/dsk/c1t7d0s2
Jan 30 20:52:04 sd1b scsi: WARNING: /pci@0/pci@0/pci@2/scsi@0/sd@7,0 (sd0):
prtvtoc: /dev/rdsk/c1t7d0s2: Unable to read Disk geometry errno = 0x16
Jan 30 20:52:04 sd1b   Corrupt label; wrong magic number

bash-3.00# prtvtoc /dev/dsk/c1t6d0s2
Jan 30 20:55:03 sd1b scsi: WARNING: /pci@0/pci@0/pci@2/scsi@0/sd@7,0 (sd0):
prtvtoc: /dev/rdsk/c1t7d0s2: Unable to read Disk geometry errno = 0x16
Jan 30 20:55:03 sd1b   Corrupt label; wrong magic number
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 76

Expert Comment

by:arnold
ID: 38837725
You enable/query smart status on the drive.
Do not specify the slice
prtvtoc /dev/dsk/c1t6d0

Do not label or try until you confirm that it is not used anywhere. At this point it is not reflected as mounted.
You may want to explore whether you want to clone it using dd though it is a 146GB in size.
0
 

Author Comment

by:cismoney
ID: 38838462
@arnold , how do I enable/query smart status on the drive. Do I only need to type prtvtoc /dev/dsk/c1t6d0 or there are additional commands to enable the smart status.

How can I confirm that the disk is not used... I am not familiar with zfs
0
 
LVL 76

Expert Comment

by:arnold
ID: 38838547
0
 
LVL 2

Assisted Solution

by:GeertJon
GeertJon earned 400 total points
ID: 38857174
a corrupt label is not about ZFS, it might be UFS as well : The disks c1t6d0 and  c1t7d0 have never been labeled before using format => so it's not used. that's it. wanna learn something more ? read on.

a starter how can I tell it's not used
look for the disk in ZFS/zpool
zpool status will show details of all zpools created.
where
zpool status -v rpool
will only show the disks in the rpool.
so
zpool status |grep c1t6d0
or leave the pipe grep out to see all devices
BUT
It might be used by UFS in some kind of mirror...
how to identify ...
metastat -c |grep c1t6d0
or leave the pipe grep out to see all meta devices
BUT it might be used directly in /etc/vfstab
grep C1t6d0 /etc/vfstab
as mentionned before, I'm pretty sure it's not the case.

now we are going to change something to your system !!

use :
format c1t6d0
select:
volname
give it a name, max 8 character, enclosed with " (double quote) , confirm, ...
Exit at the end should do it.
In the action it will label the disk and it will be more than enough in most cases, you shouldn't have the error anymore.

want some details :
http://docs.oracle.com/cd/E19082-01/819-2723/disksconcepts-14/index.html

hope this helps
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now