How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
I had a question while testing Solaris 10 x86 on Oracle VirtualBox.
I can use various kinds of disk controllers in a virtual machine on VirtualBox. But I have checked that only SATA controllers support Hot Plug function.
I have used the devfsadm command on the Solaris OS (SPARC Server) to recognize a new disk. However, this command did not recognize the new disk in Solaris 10 x86 on VirtualBox.
So I used the cfgadm command to recognize the new disk.
# cfgadm -x sata_port_activate AP_ID
# cfgadm -c configure AP_ID
To perform some tests, such as OS disk mirroring, I removed the first disk and added a new disk to the same port.
Then, I had the following results and the disk that was replaced was not recognized.
-bash-3.2# cfgadm -al | grep 'sata0/[01]\>'
sata0/0 disk connected configured unusable
sata0/1::dsk/c0t1d0 disk connected configured ok
Normally I use the following commands to recognize the disk in Solaris 10 SPARC.
# devfsadm -Cv -c disk
# devfsadm -c disk
But not recognized by the above commands and could not be changed to ok condition by using the cfgadm command.
- unconfigure/configure
- disconnect/connect
- disconnect/delete /dev/(r)dsk/c#t# files/connect/configure
Of course, rebooting the Solaris will save the problem, but I want it to solve without rebooting.
How can I solve this problem? I need your help.
I'm not familiar with English. But thanks for reading so far.
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
I suspect the support in Solaris 10 would be more limited, for example at
Code: Select all
https://www.oracle.com/technetwork/server-storage/solaris10/overview/sata0-136306.html
Did you use SATA on Solaris SPARC ? I suppose not, you are comparing different technologies, for example "fibre channel" (FC) disk addition is much more advanced, and I suspect on SPARC you would have been using Emulex or Qlogic HBA with FC disk addition.
So it is a comparison "doomed to fail" because you'd have to see how it behaves on SPARC with SATA, which is not what you probably had to start with (I think you used FC on SPARC ?)
And VirtualBox as far as I know does not offer a "virtual" Emulex or Qlogic adapter to a guest.
On Solaris 11.4 there is a manpage:
Code: Select all
man cfgadm_sata
Anyway on Solaris 11.4 I tried on VirtualBox to add a SATA disk (hotplug) and then before the disk addition on a SATA controller with 2 ports (port count = 2) one port has the boot disk the 2nd port nothing.
Code: Select all
root@pluto:~# cfgadm -al | more
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 sata-port disconnected unconfigured failed
Code: Select all
root@pluto:~# cfgadm -x sata_port_activate sata0/1
root@pluto:~# cfgadm -c configure sata0/1
root@pluto:~# cfgadm -al | head -4
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
usb0/1 usb-input connected configured ok
Code: Select all
format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <VBOX-HARDDISK-1.0-16.00GB>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c1t1d0 <VBOX-HARDDISK-1.0-2.00GB>
/pci@0,0/pci8086,2829@d/disk@1,0
Specify disk (enter its number): ^C
root@pluto:~# zpool create qpool c1t1d0
root@pluto:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
qpool 1.98G 140K 1.98G 0% 1.00x ONLINE -
rpool 15.6G 3.67G 12.0G 23% 1.00x ONLINE -
In any case I'm pessimistic about the goal of simulating this operation on Solaris 10,
because I'm under the impression that you are trying to get the advanced features of Solaris SPARC hotadd fibre channel under the simple SATA virtualbox guest ?
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
Or with SCSI 15 LUNs or more and certainly SAS probably has plenty of features in this area.
So it is a bit unfair to compare the "high end" SPARC platform with its plugin possibilties to low-end VirtualBox guest with SATA.
The Solaris 11.4 has a package called
Code: Select all
# pkg list pkg:/system/dynamic-reconfiguration
system/dynamic-reconfiguration 11.4-11.4.0.0.1.15.0 i--
By default when I create a guest in VirtualBox it has SATA controller port count set to 2.
When I set the port count of the SATA controller to 4.
And reinstall the Solaris 11.4 guest (via the AI automated install).
I get:
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 sata-port empty unconfigured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 sata-port disconnected unconfigured failed
sata0/2 sata-port disconnected unconfigured failed
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# cfgadm -x sata_port_activate sata0/1
Activate the port: /devices/pci@0,0/pci8086,2829@d:1
This operation will enable activity on the SATA port
Continue (yes/no)? yes
root@pluto:~# cfgadm -x sata_port_activate sata0/2
Activate the port: /devices/pci@0,0/pci8086,2829@d:2
This operation will enable activity on the SATA port
Continue (yes/no)? yes
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 disk connected unconfigured unknown
sata0/2 disk connected unconfigured unknown
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# cfgadm -c configure sata0/1
root@pluto:~# cfgadm -c configure sata0/2
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2::dsk/c1t2d0 disk connected configured ok
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <VBOX-HARDDISK-1.0-16.00GB>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c1t1d0 <VBOX-HARDDISK-1.0-7.00GB>
/pci@0,0/pci8086,2829@d/disk@1,0
2. c1t2d0 <VBOX-HARDDISK-1.0-2.00GB>
/pci@0,0/pci8086,2829@d/disk@2,0
Specify disk (enter its number): ^C
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 sata-port empty unconfigured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
sata0/4 sata-port empty unconfigured ok
sata0/5 sata-port empty unconfigured ok
sata0/6 sata-port empty unconfigured ok
sata0/7 sata-port empty unconfigured ok
sata0/8 sata-port empty unconfigured ok
sata0/9 sata-port empty unconfigured ok
sata0/10 sata-port empty unconfigured ok
sata0/11 sata-port empty unconfigured ok
sata0/12 sata-port empty unconfigured ok
sata0/13 sata-port empty unconfigured ok
sata0/14 sata-port empty unconfigured ok
sata0/15 sata-port empty unconfigured ok
sata0/16 sata-port empty unconfigured ok
sata0/17 sata-port empty unconfigured ok
sata0/18 sata-port empty unconfigured ok
sata0/19 sata-port empty unconfigured ok
sata0/20 sata-port empty unconfigured ok
sata0/21 sata-port empty unconfigured ok
sata0/22 sata-port empty unconfigured ok
sata0/23 sata-port empty unconfigured ok
sata0/24 sata-port empty unconfigured ok
sata0/25 sata-port empty unconfigured ok
sata0/26 sata-port empty unconfigured ok
sata0/27 sata-port empty unconfigured ok
sata0/28 sata-port empty unconfigured ok
sata0/29 sata-port empty unconfigured ok
I haven't tried adding 28 disks, but for example after:
Code: Select all
VBoxManage storageattach pluto --storagectl SATA --medium "5d63e15c-5dd8-4c63-8c67-f16ea8b2ade0" --port 28 --type hdd
Code: Select all
root@pluto:~# cfgadm -al sata0/28
Ap_Id Type Receptacle Occupant Condition
sata0/28 sata-port disconnected unconfigured failed
Code: Select all
root@pluto:~# cfgadm -x sata_port_activate sata0/28
Activate the port: /devices/pci@0,0/pci8086,2829@d:28
This operation will enable activity on the SATA port
Continue (yes/no)? y
root@pluto:~# cfgadm -al sata0/28
Ap_Id Type Receptacle Occupant Condition
sata0/28 disk connected unconfigured unknown
Code: Select all
root@pluto:~# ls /dev/rdsk
c1t0d0 c1t0d0p1 c1t0d0p3 c1t0d0s0 c1t0d0s2 c1t0d0s4 c1t0d0s6
c1t0d0p0 c1t0d0p2 c1t0d0p4 c1t0d0s1 c1t0d0s3 c1t0d0s5
Code: Select all
root@pluto:~# cfgadm -c configure sata0/28
root@pluto:~# ls /dev/rdsk
c1t0d0 c1t0d0p3 c1t0d0s2 c1t0d0s6 c1t28d0p2 c1t28d0s1 c1t28d0s5
c1t0d0p0 c1t0d0p4 c1t0d0s3 c1t28d0 c1t28d0p3 c1t28d0s2 c1t28d0s6
c1t0d0p1 c1t0d0s0 c1t0d0s4 c1t28d0p0 c1t28d0p4 c1t28d0s3
c1t0d0p2 c1t0d0s1 c1t0d0s5 c1t28d0p1 c1t28d0s0 c1t28d0s4
root@pluto:~# cfgadm -al sata0/28
Ap_Id Type Receptacle Occupant Condition
sata0/28::dsk/c1t28d0 disk connected configured ok
sata0/28: No matching library found
but it seems to work because the disk device names under /dev/rdsk were automatically created (without explicitley running devfsadm).
I think you would run devfsadm if you remove the device files under /dev/rdsk for some reason (to cleanup) and then want to regenerate the device files.
This is for example if you want to renumber the device files I think, but it was not required for me to run devfsadm.
In any case it seems to work fine
Code: Select all
root@pluto:~# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <VBOX-HARDDISK-1.0-16.00GB>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c1t28d0 <VBOX-HARDDISK-1.0-7.00GB>
/pci@0,0/pci8086,2829@d/disk@1c,0
Code: Select all
root@pluto:~# zpool create -f apool c1t28d0
root@pluto:~# zpool status apool
pool: apool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
apool ONLINE 0 0 0
c1t28d0 ONLINE 0 0 0
errors: No known data errors
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
>> I use SCSI, FC, SAS type on Solaris SPARC.
>> I am using a virtualization program to simply test Solaris 10.
>> When I tested OS Mirroring in VirtualBox, I got a problem when I removed the first disk and added it to new disk(same SATA port).
>> This happened in VirtualBox and I needed to reboot the virtual machine for recognizing new disk. Of course, it worked fine on physical SPARC machines and VMware Workstations without system reboot.
>> So I posted the question.
>> Thanks for your explanation.
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
On a guest running the following version of Solaris 10 with a UFS root filesystem :
Code: Select all
# cat /etc/release
Oracle Solaris 10 8/11 s10x_u10wos_17b X86
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Assembled 23 August 2011
# uname -a
SunOS neptune 5.10 Generic_147441-01 i86pc i386 i86pc
Code: Select all
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no
-
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 1 no
-
/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /var ufs 1 no
-
Code: Select all
# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c0t0d0 disk connected configured ok
sata0/1::dsk/c0t1d0 cd/dvd connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Initially on port sata0/2 there is nothing, and then when I add in VirtualBox a disk drive:
Code: Select all
# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c0t0d0 disk connected configured ok
sata0/1::dsk/c0t1d0 cd/dvd connected configured ok
sata0/2 sata-port disconnected unconfigured failed
sata0/3 sata-port empty unconfigured ok
Code: Select all
# cfgadm -x sata_port_activate sata0/2
Activate the port: /devices/pci@0,0/pci8086,2829@d:2
This operation will enable activity on the SATA port
Continue (yes/no)? yes
Code: Select all
# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c0t0d0 disk connected configured ok
sata0/1::dsk/c0t1d0 cd/dvd connected configured ok
sata0/2 disk connected unconfigured unknown
sata0/3 sata-port empty unconfigured ok
Code: Select all
# ls /dev/rdsk
c0t0d0p0 c0t0d0s1 c0t0d0s15 c0t0d0s7 c0t1d0p3 c0t1d0s12 c0t1d0s4
c0t0d0p1 c0t0d0s10 c0t0d0s2 c0t0d0s8 c0t1d0p4 c0t1d0s13 c0t1d0s5
c0t0d0p2 c0t0d0s11 c0t0d0s3 c0t0d0s9 c0t1d0s0 c0t1d0s14 c0t1d0s6
c0t0d0p3 c0t0d0s12 c0t0d0s4 c0t1d0p0 c0t1d0s1 c0t1d0s15 c0t1d0s7
c0t0d0p4 c0t0d0s13 c0t0d0s5 c0t1d0p1 c0t1d0s10 c0t1d0s2 c0t1d0s8
c0t0d0s0 c0t0d0s14 c0t0d0s6 c0t1d0p2 c0t1d0s11 c0t1d0s3 c0t1d0s9
Code: Select all
# cfgadm -c configure sata0/2
Code: Select all
# ls /dev/rdsk
c0t0d0p0 c0t0d0s12 c0t0d0s7 c0t1d0s1 c0t1d0s4 c0t2d0p3 c0t2d0s15
c0t0d0p1 c0t0d0s13 c0t0d0s8 c0t1d0s10 c0t1d0s5 c0t2d0p4 c0t2d0s2
c0t0d0p2 c0t0d0s14 c0t0d0s9 c0t1d0s11 c0t1d0s6 c0t2d0s0 c0t2d0s3
c0t0d0p3 c0t0d0s15 c0t1d0p0 c0t1d0s12 c0t1d0s7 c0t2d0s1 c0t2d0s4
c0t0d0p4 c0t0d0s2 c0t1d0p1 c0t1d0s13 c0t1d0s8 c0t2d0s10 c0t2d0s5
c0t0d0s0 c0t0d0s3 c0t1d0p2 c0t1d0s14 c0t1d0s9 c0t2d0s11 c0t2d0s6
c0t0d0s1 c0t0d0s4 c0t1d0p3 c0t1d0s15 c0t2d0p0 c0t2d0s12 c0t2d0s7
c0t0d0s10 c0t0d0s5 c0t1d0p4 c0t1d0s2 c0t2d0p1 c0t2d0s13 c0t2d0s8
c0t0d0s11 c0t0d0s6 c0t1d0s0 c0t1d0s3 c0t2d0p2 c0t2d0s14 c0t2d0s9
Code: Select all
# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c0t2d0 <DEFAULT cyl 2086 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,2829@d/disk@2,0
Specify disk (enter its number): ^C
# zpool create mypool c0t2d0
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
How did you do this exactly ? I think the cfgadm_sata manpage gives a clue here :I removed the first disk and added a new disk to the same port.
Also the cfgadm -al output that you posted has the "unusable" flag ...The emergency "sata_port_deactivate" operation is not supported on
ports with attached disks containing critical partitions such as root
(/), /usr, swap, or /var. The deactivate operation should not be
attempted on such ports. Incorrect usage can result in a system hang
and require a reboot.
For example on a 11.4 guest I tried the following to replace a disk :
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 sata-port empty unconfigured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# cfgadm -x sata_port_activate sata0/1
Activate the port: /devices/pci@0,0/pci8086,2829@d:1
This operation will enable activity on the SATA port
Continue (yes/no)? yes
root@pluto:~# cfgadm -x sata_port_activate sata0/2
Activate the port: /devices/pci@0,0/pci8086,2829@d:2
This operation will enable activity on the SATA port
Continue (yes/no)? yes
root@pluto:~# cfgadm -c configure sata0/1
root@pluto:~# cfgadm -c configure sata0/2
Code: Select all
root@pluto:~# zpool create mymirror mirror c1t1d0 c1t2d0
root@pluto:~# zpool status mymirror
pool: mymirror
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
mymirror ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
c1t2d0 ONLINE 0 0 0
errors: No known data errors
Code: Select all
root@pluto:~# zpool detach mymirror c1t2d0
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2::dsk/c1t2d0 disk connected configured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~#
root@pluto:~# cfgadm -c unconfigure sata0/2
Unconfigure the device at: /devices/pci@0,0/pci8086,2829@d:2
This operation will suspend activity on the SATA device
Continue (yes/no)? yes
root@pluto:~# cfgadm -al sata0/2
Ap_Id Type Receptacle Occupant Condition
sata0/2 disk connected unconfigured ok
I've just tested that I can replace the disk by a different disk on the same port without a reboot.
(guest Solaris 11.4)
However the test pool I used above is a simple "mymirror" test zfs pool , not a pool for operating system mirroring,
with the root / and /var etc. on the disk, the cfgadm_sata manpage indicates that there are some limitations.
Provided proper unconfigure of the disk , I did not have to reboot to replace a disk in a mirror,
and attach it again afterwards (with a new disk).
Also the manpage cfgadm_sata warns:
If the SATA connectors are the hot-pluggable type and the SATA con-
troller supports hotplugging, unplugging a device without unconfiguring
it may result in system hang or data loss.
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
Here is my work for OS mirroring:
■ Solaris 10 x86 Info:
Code: Select all
# more /etc/release
Oracle Solaris 10 1/13 s10x_u11wos_24a X86
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
Assembled 17 January 2013
# uname -a
SunOS solaris101 5.10 Generic_147148-26 i86pc i386 i86pc
# df -h /
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 18G 3.9G 14G 23% /
Code: Select all
OS Disk : SATA 20GB (Port 0)
CD/DVD : SATA (Port 29)
# cfgadm -al | grep 'sata0/0\>'
sata0/0::dsk/c0t0d0 disk connected configured ok
# echo | format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <ATA -VBOX HARDDISK -1.0 cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,2829@d/disk@0,0
Specify disk (enter its number): Specify disk (enter its number):
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 2340 17.93GB (2340/0/0) 37592100
1 swap wu 2341 - 2602 2.01GB (262/0/0) 4209030
2 backup wm 0 - 2606 19.97GB (2607/0/0) 41881455
3 unassigned wm 2603 - 2606 31.38MB (4/0/0) 64260
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
Code: Select all
# cfgadm -al | grep 'sata0/[01]\>'
sata0/0::dsk/c0t0d0 disk connected configured ok
sata0/1 sata-port disconnected unconfigured failed
# cfgadm -x sata_port_activate sata0/1
Activate the port: /devices/pci@0,0/pci8086,2829@d:1
This operation will enable activity on the SATA port
Continue (yes/no)? yes
# cfgadm -c configure sata0/1
# cfgadm -al | grep 'sata0/[01]\>'
sata0/0::dsk/c0t0d0 disk connected configured ok
sata0/1::dsk/c0t1d0 disk connected configured ok
# echo | format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <ATA -VBOX HARDDISK -1.0 cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c0t1d0 <ATA -VBOX HARDDISK -1.0 cyl 2608 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,2829@d/disk@1,0
Specify disk (enter its number): Specify disk (enter its number):
Code: Select all
# fdisk -B /dev/rdsk/c0t1d0p0
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
fmthard: New volume table of contents now in place.
# prtvtoc /dev/rdsk/c0t0d0s2 | grep -v '^*'
0 2 00 16065 37592100 37608164 /
1 3 01 37608165 4209030 41817194
2 5 00 0 41881455 41881454
3 0 00 41817195 64260 41881454
8 1 01 0 16065 16064
# prtvtoc /dev/rdsk/c0t1d0s2 | grep -v '^*'
0 2 00 16065 37592100 37608164
1 3 01 37608165 4209030 41817194
2 5 00 0 41881455 41881454
3 0 00 41817195 64260 41881454
8 1 01 0 16065 16064
Code: Select all
# metadb -f -a c0t0d0s3
# metadb -a c0t1d0s3
# metadb
flags first blk block count
a u 16 8192 /dev/dsk/c0t0d0s3
a u 16 8192 /dev/dsk/c0t1d0s3
Code: Select all
# metainit -f d11 1 1 c0t0d0s0
d11: Concat/Stripe is setup
# metainit -f d21 1 1 c0t0d0s1
d21: Concat/Stripe is setup
# metainit d10 -m d11
d10: Mirror is setup
# metainit d20 -m d21
d20: Mirror is setup
# metaroot d10
# echo 'set md:mirrored_root_flag=1' >> /etc/system
# vi /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d20 - - swap - no - # changed /dev/dsk/c0t0d0s1 to /dev/md/dsk/d20
/dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -
# sync
# init 6
# df -h /
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d10 18G 3.9G 14G 23% /
# swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d20 85,20 8 4209016 4209016
# dumpadm -d swap
Dump content: kernel pages
Dump device: /dev/md/dsk/d20 (swap)
Savecore directory: /var/crash
Savecore enabled: yes
Save compressed: on
Code: Select all
# metainit d12 1 1 c0t1d0s0
d12: Concat/Stripe is setup
# metainit d22 1 1 c0t1d0s1
d22: Concat/Stripe is setup
# metattach d10 d12
d10: submirror d12 is attached
# metattach d20 d22
d20: submirror d22 is attached
# metastat d10
d10: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d12
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 37592100 blocks (17 GB)
d11: Submirror of d10
State: Okay
Size: 37592100 blocks (17 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes
d12: Submirror of d10
State: Okay
Size: 37592100 blocks (17 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s0 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VBe4b17a10-75090f7e
c0t1d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VB27121653-c2012b38
# metastat d20
d20: Mirror
Submirror 0: d21
State: Okay
Submirror 1: d22
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 4209030 blocks (2.0 GB)
d21: Submirror of d20
State: Okay
Size: 4209030 blocks (2.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes
d22: Submirror of d20
State: Okay
Size: 4209030 blocks (2.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s1 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VBe4b17a10-75090f7e
c0t1d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VB27121653-c2012b38
Code: Select all
# eeprom bootpath
bootpath=/pci@0,0/pci8086,2829@d/disk@0,0:a
# eeprom bootpath=/pseudo/md@0:0,10,blk
Code: Select all
# cd /boot/grub
# installgrub stage1 stage2 /dev/rdsk/c0t1d0s0
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 274 sectors starting at 50 (abs 16115)
Code: Select all
# echo | format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <drive type unknown>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c0t1d0 <ATA -VBOX HARDDISK -1.0 cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,2829@d/disk@1,0
Specify disk (enter its number): Specify disk (enter its number):
# cfgadm -al | grep 'sata0/[01]\>'
sata0/0 sata-port empty unconfigured ok
sata0/1::dsk/c0t1d0 disk connected configured ok
# metadb
flags first blk block count
Wm p l 16 8192 /dev/dsk/c0t0d0s3
a p luo 16 8192 /dev/dsk/c0t1d0s3
# metastat d10
d10: Mirror
Submirror 0: d11
State: Needs maintenance
Submirror 1: d12
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 37592100 blocks (17 GB)
d11: Submirror of d10
State: Needs maintenance
Invoke: metareplace d10 c0t0d0s0 <new device>
Size: 37592100 blocks (17 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Maintenance Yes
d12: Submirror of d10
State: Okay
Size: 37592100 blocks (17 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s0 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VBe4b17a10-75090f7e
c0t1d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VB27121653-c2012b38
# metastat d20
d20: Mirror
Submirror 0: d21
State: Needs maintenance
Submirror 1: d22
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 4209030 blocks (2.0 GB)
d21: Submirror of d20
State: Needs maintenance
Invoke: metareplace d20 c0t0d0s1 <new device>
Size: 4209030 blocks (2.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Maintenance Yes
d22: Submirror of d20
State: Okay
Size: 4209030 blocks (2.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s1 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VBe4b17a10-75090f7e
c0t1d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VB27121653-c2012b38
Code: Select all
# metadb -f -d c0t0d0s3
# metadb
flags first blk block count
a p luo 16 8192 /dev/dsk/c0t1d0s3
# metadetach -f d10 d11
d10: submirror d11 is detached
# metadetach -f d20 d21
d20: submirror d21 is detached
# metaclear d11 d21
d11: Concat/Stripe is cleared
d21: Concat/Stripe is cleared
# devfsadm -Cv
Code: Select all
# cfgadm -al | grep 'sata0/[01]\>'
sata0/0::dsk/c0t0d0 disk connected configured unusable <<<<<---- 'My question is about this point.'
sata0/1::dsk/c0t1d0 disk connected configured ok
I need help how to recognize new disk without system reboot at this point.
Thank you.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
This confirms my belief that it is necessary to be careful with comparison between SATA hotplug and FC/SCSI hotplug.When I tested OS Mirroring in VirtualBox, I got a problem when I removed the first disk and added it to new disk(same SATA port). This happened in VirtualBox and I needed to reboot the virtual machine for recognizing new disk. Of course, it worked fine on physical SPARC machines and VMware Workstations without system reboot.
For what it's worth, I tried on a guest with Solaris 11.4 to replace a disk, and I was able to add a new disk (same SATA port) without rebooting the guest.
The Solaris 11.4 was installed on a mirrored disk configuration via the AI manifest:
Code: Select all
<target>
<disk in_vdev="mirror_vdev" in_zpool="rpool" whole_disk="true">
<disk_name name="c1t0d0" name_type="ctd"/>
</disk>
<disk in_vdev="mirror_vdev" in_zpool="rpool" whole_disk="true">
<disk_name name="c1t1d0" name_type="ctd"/>
</disk>
<logical>
<zpool name="rpool" is_root="true">
<vdev name="mirror_vdev" redundancy="mirror"/>
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~# zpool status
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
errors: No known data errors
Code: Select all
root@pluto:~# zpool status
pool: rpool
state: DEGRADED
status: One or more devices has been removed by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
c1t0d0 ONLINE 0 0 0
c1t1d0 REMOVED 0 0 0
errors: No known data errors
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1 sata-port empty unconfigured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Then I manually removed the REMOVED disk:
Code: Select all
root@pluto:~# zpool detach rpool c1t1d0
root@pluto:~# zpool status
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c1t0d0 ONLINE 0 0 0
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# zpool attach rpool c1t0d0 c1t1d0
Make sure to wait until resilver is done before rebooting.
Code: Select all
root@pluto:~# zpool status rpool
pool: rpool
state: ONLINE
scan: resilvered 2.57G in 1m33s with 0 errors on Mon Dec 17 11:00:39 2018
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
errors: No known data errors
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
>>> Thanks for your hard work and time.
>>> I had rpool and SVM mirroring tests. I also tested the recognition after removing the second disk on VirtualBox. I handled the second disk failure well.
>>> This is a problem when removing the first disk on VirtualBox.
>>> I am so sorry. I should have mentioned it to you in advance.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
So to summarize, you can add a new disk (SATA hotplug) and you can also remove the second disk without a problem, where "second" is it the disk that is not the active bootdevice ?
When you try to remove the 'first disk' is it also the boot device ?
Code: Select all
root@pluto:~# prtconf -v|sed -n '/bootpath/,/value/p'
name='bootpath' type=string items=1
value='/pci@0,0/pci8086,2829@d/disk@0,0:b'
Code: Select all
root@pluto:~# echo | format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <VBOX-HARDDISK-1.0-16.00GB>
/pci@0,0/pci8086,2829@d/disk@0,0
1. c1t1d0 <VBOX-HARDDISK-1.0-16.00GB>
/pci@0,0/pci8086,2829@d/disk@1,0
Specify disk (enter its number): Specify disk (enter its number):
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
I did not have to boot from an "alternate disk" to start with (which would be reasonable to try).
For a Solaris 11.4 guest :
Code: Select all
root@pluto:~# prtconf -v|sed -n '/bootpath/,/value/p'
name='bootpath' type=string items=1
value='/pci@0,0/pci8086,2829@d/disk@0,0:b'
root@pluto:~# zpool status
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
errors: No known data errors
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0 sata-port empty unconfigured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~# prtconf -v|sed -n '/bootpath/,/value/p'
name='bootpath' type=string items=1
value='/pci@0,0/pci8086,2829@d/disk@0,0:b'
At that point I have:
Code: Select all
root@pluto:~# zpool status rpool
pool: rpool
state: DEGRADED
status: One or more devices has been removed by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
c1t0d0 REMOVED 0 0 0
c1t1d0 ONLINE 0 0 0
I get:
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# zpool detach rpool c1t0d0
Code: Select all
root@pluto:~# zpool attach rpool c1t1d0 c1t0d0
Make sure to wait until resilver is done before rebooting.
root@pluto:~# zpool status
pool: rpool
state: DEGRADED
status: One or more devices are currently being resilvered. The pool will
continue to function in a degraded state.
action: Wait for the resilver to complete.
Run 'zpool status -v' to see device specific details.
scan: resilver in progress since Mon Dec 17 15:32:14 2018
2.80G scanned out of 3.58G at 719M/s, 1s to go
0 resilvered
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
c1t1d0 ONLINE 0 0 0
c1t0d0 DEGRADED 0 0 0 (resilvering)
Code: Select all
root@pluto:~# zpool status
pool: rpool
state: ONLINE
scan: resilvered 2.58G in 1m32s with 0 errors on Mon Dec 17 15:33:46 2018
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
c1t0d0 ONLINE 0 0 0
However in this test I can remove the first disk and I can add a new SATA hotplug disk at the same (first) port.
These results are on Solaris 11.4 host and guest also Solaris 11.4.
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0 sata-port empty unconfigured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~# prtconf -v|sed -n '/bootpath/,/value/p'
name='bootpath' type=string items=1
value='/pci@0,0/pci8086,2829@d/disk@1,0:b'
So that
Code: Select all
root@pluto:~# zpool status
pool: rpool
state: DEGRADED
status: One or more devices are unavailable in response to persistent errors.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Determine if the device needs to be replaced, and clear the errors
using 'zpool clear' or 'fmadm repaired', or replace the device
with 'zpool replace'.
Run 'zpool status -v' to see device specific details.
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
c1t0d0 UNAVAIL 0 0 0
c1t1d0 ONLINE 0 0 0
Code: Select all
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0 sata-port disconnected unconfigured failed
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0 sata-port disconnected unconfigured failed
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~# cfgadm -x sata_port_activate sata0/0
Activate the port: /devices/pci@0,0/pci8086,2829@d:0
This operation will enable activity on the SATA port
Continue (yes/no)? yes
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0 disk connected unconfigured unknown
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
root@pluto:~# cfgadm -c configure sata0/0
root@pluto:~# cfgadm -al sata0
Ap_Id Type Receptacle Occupant Condition
sata0/0::dsk/c1t0d0 disk connected configured ok
sata0/1::dsk/c1t1d0 disk connected configured ok
sata0/2 sata-port empty unconfigured ok
sata0/3 sata-port empty unconfigured ok
Code: Select all
root@pluto:~# zpool clear rpool c1t0d0
root@pluto:~# zpool online rpool c1t0d0
root@pluto:~# zpool status
pool: rpool
state: ONLINE
scan: resilvered 29.9M in 2s with 0 errors on Mon Dec 17 16:27:47 2018
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
errors: No known data errors
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
Code: Select all
prtconf -v|sed -n '/bootpath/,/value/p'
name='bootpath' type=string items=1
value='/pci@0,0/pci8086,2829@d/disk@1,0:b'
Then proceed without reboot to remove the first disk again and replace it with a new disk in the same port.
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: How to add a new disk(SATA/SCSI Type) in solaris 10 x86 On Oracle VirtualBox?
The messages from "stes" are rather lengthy and explanatory. You don't have to quote them whole! There's a "Post Reply" button under the last message, no need to use the "Quote" one. It makes following up on the thread like reading "War and Peace"...
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.