From: Dave on
I'm trying to mirror a root disk on a Sun Ultra 27. The machine was supplied by
Sun with a single 500 GB disk, with a small diagnostic partition and Solaris 10
on the main partition.

I've added another almost identical disk (exactly the same Hitachi part number,
as the disk from Sun, but no Sun barcode). I believe I've partitioned the two
disks the same. The types of partition (Diagnostic and Solaris2 are the same.
The sizes of the partitions are the same (7 cylinders for Diagnostic, 60781 for
Solaris2).

When I try to attack a slice as a mirror, so I get an error

# zpool attach rpool c7t1d0s0 c7t2d0s0
cannot open '/dev/dsk/c7t2d0s0': I/O error
# ls -l /dev/dsk/c7t2d0s0
lrwxrwxrwx 1 root root 50 Nov 6 10:10 /dev/dsk/c7t2d0s0 ->
.../../devices/pci@0,0/pci108e,5354(a)1f,2/disk@2,0:a


I've not formatted the second disk. Is this necessary? I know it is not on
SPARC, but I'm not sure about x86.



Format shows for the original disk (disk #0, c7t1d0):

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c7t1d0 <DEFAULT cyl 60779 alt 2 hd 255 sec 63>
/pci@0,0/pci108e,5354(a)1f,2/disk@1,0
1. c7t2d0 <DEFAULT cyl 60779 alt 2 hd 255 sec 63>
/pci@0,0/pci108e,5354(a)1f,2/disk@2,0
2. c7t3d0 <ATA-Hitachi HUA72202-A20N-1.82TB>
/pci@0,0/pci108e,5354(a)1f,2/disk@3,0
3. c7t4d0 <ATA-Hitachi HUA72202-A20N-1.82TB>
/pci@0,0/pci108e,5354(a)1f,2/disk@4,0
Specify disk (enter its number): 0
selecting c7t1d0
Total disk size is 60801 cylinders
Cylinder size is 16065 (512 byte) blocks

Cylinders
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Diagnostic 1 7 7 0
2 Active Solaris2 8 60788 60781 100




SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Specify the active partition
3. Delete a partition
4. Change between Solaris and Solaris2 Partition IDs
5. Exit (update disk configuration and exit)
6. Cancel (exit without updating disk configuration)
Enter Selection: 5


format> par


PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> pri
Current partition table (original):
Total disk cylinders available: 60779 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 60778 465.58GB (60778/0/0) 976398570
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 60778 465.59GB (60779/0/0) 976414635
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0


I'm somewhat puzzled how the 'boot' slice (8) can start and end at cylinder 0,
but be 7.84 MB in size. But that is how it came set up from Sun.

Now for the other Hitachi disk, as far as I can see, the output is the same,
with the exception there is no report of ZFS pools on the disk


# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c7t1d0 <DEFAULT cyl 60779 alt 2 hd 255 sec 63>
/pci@0,0/pci108e,5354(a)1f,2/disk@1,0
1. c7t2d0 <DEFAULT cyl 60779 alt 2 hd 255 sec 63>
/pci@0,0/pci108e,5354(a)1f,2/disk@2,0
2. c7t3d0 <ATA-Hitachi HUA72202-A20N-1.82TB>
/pci@0,0/pci108e,5354(a)1f,2/disk@3,0
3. c7t4d0 <ATA-Hitachi HUA72202-A20N-1.82TB>
/pci@0,0/pci108e,5354(a)1f,2/disk@4,0
Specify disk (enter its number): 1
Total disk size is 60801 cylinders
Cylinder size is 16065 (512 byte) blocks

Cylinders
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Diagnostic 1 7 7 0
2 Active Solaris2 8 60788 60781 100




SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Specify the active partition
3. Delete a partition
4. Change between Solaris and Solaris2 Partition IDs
5. Exit (update disk configuration and exit)
6. Cancel (exit without updating disk configuration)
Enter Selection: 5


format> par


PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> pri
Current partition table (original):
Total disk cylinders available: 60779 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 60778 465.59GB (60779/0/0) 976414635
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

Anyway, when I try to attach the c7t2d0s0 slice as a mirror, I get an error message:


# zpool attach rpool c7t1d0s0 c7t2d0s0
cannot open '/dev/dsk/c7t2d0s0': I/O error

Any ideas?


--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.
From: Dave on
Dave wrote:
> I'm trying to mirror a root disk on a Sun Ultra 27. The machine was
> supplied by Sun with a single 500 GB disk, with a small diagnostic
> partition and Solaris 10 on the main partition.

I should have added, if it was not obvious from the title, that OpenSolaris has
now been installed on the machine, and the Solaris 10 partition wiped of the OS.
It's running OpenSolaris 06/2009


bash-3.2$ cat /etc/release
OpenSolaris 2009.06 snv_111b X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 07 May 2009


--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.
From: Oscar del Rio on
Dave wrote:

>
> Part Tag Flag Cylinders Size Blocks
> 0 unassigned wm 0 0 (0/0/0) 0
> 1 unassigned wm 0 0 (0/0/0) 0
> 2 backup wu 0 - 60778 465.59GB (60779/0/0) 976414635
> 3 unassigned wm 0 0 (0/0/0) 0
> 4 unassigned wm 0 0 (0/0/0) 0
> 5 unassigned wm 0 0 (0/0/0) 0
> 6 unassigned wm 0 0 (0/0/0) 0
> 7 unassigned wm 0 0 (0/0/0) 0
> 8 boot wu 0 - 0 7.84MB (1/0/0) 16065
> 9 unassigned wm 0 0 (0/0/0) 0

> # zpool attach rpool c7t1d0s0 c7t2d0s0
> cannot open '/dev/dsk/c7t2d0s0': I/O error

You have not defined the c7t2d0s0 slice. It has size 0.

When you use entire disks in the pools you don't need to define slices
(zpool would take care of it) but you do when using slices - which is
required for rpools.

Since both disks seem to be identical, the easiest is to copy the
partition table from the original disk:

prtvtoc /dev/rdsk/c7t1d0s2 | fmthard -s - /dev/rdsk/c7t2d0s2

Note that it uses "s2". See "man prtvtoc" and "man fmthard".
From: Dave on
Oscar del Rio wrote:
> Dave wrote:
>
>>
>> Part Tag Flag Cylinders Size Blocks
>> 0 unassigned wm 0 0
>> (0/0/0) 0
>> 1 unassigned wm 0 0
>> (0/0/0) 0
>> 2 backup wu 0 - 60778 465.59GB (60779/0/0)
>> 976414635
>> 3 unassigned wm 0 0
>> (0/0/0) 0
>> 4 unassigned wm 0 0
>> (0/0/0) 0
>> 5 unassigned wm 0 0
>> (0/0/0) 0
>> 6 unassigned wm 0 0
>> (0/0/0) 0
>> 7 unassigned wm 0 0
>> (0/0/0) 0
>> 8 boot wu 0 - 0 7.84MB (1/0/0)
>> 16065
>> 9 unassigned wm 0 0
>> (0/0/0) 0
>
>> # zpool attach rpool c7t1d0s0 c7t2d0s0
>> cannot open '/dev/dsk/c7t2d0s0': I/O error
>
> You have not defined the c7t2d0s0 slice. It has size 0.
>
> When you use entire disks in the pools you don't need to define slices
> (zpool would take care of it) but you do when using slices - which is
> required for rpools.
>
> Since both disks seem to be identical, the easiest is to copy the
> partition table from the original disk:
>
> prtvtoc /dev/rdsk/c7t1d0s2 | fmthard -s - /dev/rdsk/c7t2d0s2
>
> Note that it uses "s2". See "man prtvtoc" and "man fmthard".

Thank you Oscar. I did what you said, then used /sbin/installgrub to install
grub. After mirroring the disk, it seems to be ok.

I powered down the system, removed the original boot disk supplied by Sun, and
found the machine booted fine. Obvious 'zpool status' showed there was a
problem, but the machine was fine. So I am fairly confident the machine will now
boot, even if a disk fails.

Dave

--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.