Jason Zhao wrote:
> jan damborsky ??:
>
>> Hi Jason,
>>
>>
>> Jason Zhao wrote:
>>
>>
>>> Hi, Jan and Willima,
>>>
>>> I tested libtd on 2 T2000 machine. Through the test_td driver,
>>> it seems like libtd could not find current boot disk.
>>> I tested it on x86, and test_td will print a "*" ahead of the
>>> boot disk, but on SPARC platform, there is no "*" output.
>>>
>>> Is it a bug for SPARC?
>>>
>>>
>>>
>> libtd uses devfs_bootdev_get_list() API for obtaining list of boot devices:
>>
>> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdevinfo/devfsinfo.c#838
>>
>> Looking at the Sparc implementation, following eeprom(1M) variables are
>> queried:
>>
>> boot-device
>> bootdev
>> boot-from
>>
>>
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# eeprom boot-device
> boot-device=disk net
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# eeprom bootdev
> bootdev: data not available.
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# eeprom boot-from
> boot-from: data not available.
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# eeprom diag-switch?
> diag-switch?=true
>
> The diag-switch? is "true", then it is compliant with the implementation,
> and it is correct not to show boot disk.
>
> But how to unset the "diag-switch?" ?
> I made the command following, it is not working, either.
>
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# eeprom diag-switch?=false
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# eeprom diag-switch?
> diag-switch?=false
>
I think this is the correct way to do it.
What devalias command in OBP shows for 'disk' in your case ?
e.g.
{16} ok devalias disk
disk /pci at 7c0/pci at 0/pci at 8/scsi at 2/disk at 0,0
is it referred by the one of c1t0d0 or c1t1d0 reported by test_td ?
Jan
> [root at sol-t2000-7:/var/pkg/catalog/ipkg]# test_td -d -v
> Disk discovery
> Total number of disks: 3
> -------------------------------------------------------------------------------
> num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size [MB]|
> -------------------------------------------------------------------------------
> 1 | c1t0d0| FUJITSU| scsi| FIXED| No| V| 512| 143374738| 70007|
> 2 | c1t1d0| FUJITSU| scsi| FIXED| No| G| 512| 143374738| 70007|
> 3 | swap| unknown|unknown| UNKN| No| G| 512| 4186112| 2044|
> -------------------------------------------------------------------------------
>
> Thanks
> Jason
>
>> Also, looking at devfs_bootdev_get_list(), it returns
>> with failure if diagnostic-mode? or diag-switch?
>> variables are set. I am not sure, why this implementation
>> was chosen, maybe other people might clarify this point.
>>
>> That said, I have verified that boot disk is reported
>> correctly on my T1000 test machine:
>>
>> # /tmp/test_td -dv
>> Disk discovery
>> Total number of disks: 2
>> -------------------------------------------------------------------------------
>> num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size
>> [MB]|
>> -------------------------------------------------------------------------------
>> 1 |* c2t0d0| FUJITSU| scsi| FIXED| No| V| 512| 143374738|
>> 70007|
>> 2 | c2t1d0| FUJITSU| scsi| FIXED| No| V| 512| 143374738|
>> 70007|
>> -------------------------------------------------------------------------------
>>
>> I have tried to turn on diag-switch? and in that case, boot disk was not
>> identified - this behavior is compliant with the current implementation
>> of devfs_bootdev_get_list():
>>
>> # eeprom diag-switch?=true
>> # /tmp/test_td -dv
>> Disk discovery
>> Total number of disks: 2
>> -------------------------------------------------------------------------------
>> num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size
>> [MB]|
>> -------------------------------------------------------------------------------
>> 1 | c2t0d0| FUJITSU| scsi| FIXED| No| V| 512| 143374738|
>> 70007|
>> 2 | c2t1d0| FUJITSU| scsi| FIXED| No| V| 512| 143374738|
>> 70007|
>> -------------------------------------------------------------------------------
>>
>>
>> In your case, what is state of diag-switch? and diagnostic-mode? variables ?
>> Also, is your boot device (boot-device or bootdev or boot-from variable)
>> set to the one of the disks reported by libtd ?
>>
>> Thank you,
>> Jan
>>
>>
>>
>>> x86 output
>>> ===================================
>>> # test_td -d
>>> Disk discovery
>>> Total number of disks: 2
>>> ---------------------------------
>>> num | name| ctype|size [MB]|
>>> ---------------------------------
>>> 1 |* c4d0| ata| 152625| <--- there is an asterisk(*) before c4d0
>>> 2 | swap|unknown| 512|
>>> ---------------------------------
>>>
>>> ===================================
>>>
>>> sparc output
>>> ===================================
>>> # test_td -d -v
>>> Disk discovery
>>> Total number of disks: 3
>>> -------------------------------------------------------------------------------
>>> num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size [MB]|
>>> -------------------------------------------------------------------------------
>>> 1 | c0t0d0| FUJITSU| scsi| FIXED| No| V| 512| 143374738| 70007|
>>> 2 | c0t1d0| FUJITSU| scsi| FIXED| No| G| 512| 143374738| 70007|
>>> 3 | dump| unknown|unknown| UNKN| No| G| 512| 3145728| 1536|
>>> -------------------------------------------------------------------------------
>>> ===================================
>>>
>>>
>>> Thanks
>>> Jason
>>>
>>>
>>>
>>
>>
>
>