nfc是什么意思-vistalizator exe

系统盘
2023年3月30日发(作者:goldwave教程)

Solaris10单镜像盘

启动系统

1.概述

在Solaris系统重启后,发现其中一块镜像盘物理故障,或一

块硬盘上的metadb或数据有丢失,导致系统启动时自动进入维护

模式,本文档介绍在上述情况下启动系统的操作。

操作环境如下:

主机系统版本硬盘列表备注

SunUltra45Solaris10Sparc

c1t0d0系统盘

c1t1d0系统盘(故障)

2.操作准备

1、准备一张Solaris10的光盘用于进入单用户模式;

2.1.确认硬盘故障

查看系统启动告警信息

okboot

SunUltra45Workstation,NoKeyboard

Copyright2005SunMicrosystems,htsreserved.

OpenBoot4.21.2,4096MBmemoryinstalled,Serial#68148048.

Ethernetaddress0:14:4f:f:db:50,HostID:840fdb50.

Rebootingwithcommand:boot

Bootdevice:/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0,0:aFileandargs:

SunOSRelease5.10VersionGeneric_147147-2664-bit

Copyright(c)1983,2013,Oracleand/htsreserved.

WARNING:md:d102:(Unavailable)needsmaintenance

Hostname:test-01

Insufficientmetadevicedatabasereplicaslocated.

Usemetadbtodeletedatabaseswhicharebroken.

IgnoreanyRead-onlyfilesystemerrormessages.

Rebootthesystemwhenfinishedtoreloadthemetadevicedatabase.

Afterreboot,repairanybrokendatabasereplicaswhichweredeleted.

Mar2317:56:[9]:svc:/system/metainit:default:Method

"/lib/svc/method/svc-metainit"failedwithexitstatus96.

Mar2317:56:[9]:system/metainit:defaultmisconfigured:transitionedto

maintenance(see'svcs-xv'fordetails)

Mar2317:56:[9]:svc:/system/filesystem/usr:default:Method

"/lib/svc/method/fs-usr"failedwithexitstatus95.

Mar2317:56:[9]:system/filesystem/usr:defaultfailedfatally:

transitionedtomaintenance(see'svcs-xv'fordetails)

RequestingSystemMaintenanceMode

(See/lib/svc/share/READMEformoreinformation.)

Consoleloginservice(s)cannotrun

Rootpasswordforsystemmaintenance(control-dtobypass)://输入root密码

single-userprivilegeassignedto/dev/console.

EnteringSystemMaintenanceMode//系统自动进入维护模式

Mar2317:59:19su:'suroot'succeededforrooton/dev/console

OracleCorporationSunOS5.10GenericPatchJanuary2005

#在维护模式查看镜像状态,发现有一半子镜像需要维护,这

一半子镜像都分布在同一块硬盘,这块硬盘上的metadb也处

于unknow状态,可以确定c1t1d0硬盘故障,拔出故障硬盘。

#metastat

d130:Mirror

Submirror0:d131

State:Okay

Submirror1:d132

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:30722044blocks(14GB)

d131:Submirrorofd130

State:Okay

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s30NoOkayYes

d132:Submirrorofd130

State:Needsmaintenance

Invoke:metareplaced130c1t1d0s3

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s30NoMaintenanceYes

d110:Mirror

Submirror0:d111

State:Okay

Submirror1:d112

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:20482820blocks(9.8GB)

d111:Submirrorofd110

State:Okay

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s10NoOkayYes

d112:Submirrorofd110

State:Needsmaintenance

Invoke:metareplaced110c1t1d0s1

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s10NoMaintenanceYes

d100:Mirror

Submirror0:d101

State:Okay

Submirror1:d102

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:71683312blocks(34GB)

d101:Submirrorofd100

State:Okay

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s00NoOkayYes

d102:Submirrorofd100

State:Needsmaintenance

Invoke:metareplaced100c1t1d0s0

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s00NoMaintenanceYes

DeviceRelocationInformation:

DeviceRelocDeviceID

c1t1d0Yesid1,sd@n5000c50002f5d577

c1t0d0Yesid1,sd@n5000c50002f54e2b

##metadb

flagsfirstblkblockcount

amplu168192/dev/dsk/c1t0d0s7

apl82088192/dev/dsk/c1t0d0s7

apl164008192/dev/dsk/c1t0d0s7

MWpl16unknown/dev/dsk/c1t1d0s7

MWpl8208unknown/dev/dsk/c1t1d0s7

MWpl16400unknown/dev/dsk/c1t1d0s7

#3.解决方法1(修改system文件)

3.1.进入ok模式

在维护模式输入init0进入ok模式

#init0

#:wait.

:81systemservicesarenowbeingstopped.

:Thesystemisdown.

syncingfilesystems...done

Programterminated

ok

ok

3.2.从光盘引导进入单用户模式

把盘放入光驱,bootcdrom–s从光盘引导进入单用户模式

okbootcdrom-s

SunUltra45Workstation,NoKeyboard

Copyright2005SunMicrosystems,htsreserved.

OpenBoot4.21.2,4096MBmemoryinstalled,Serial#68148048.

Ethernetaddress0:14:4f:f:db:50,HostID:840fdb50.

Rebootingwithcommand:bootcdrom-s

Bootdevice:/pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/cdrom@0,0:fFileandargs:-s

SunOSRelease5.10VersionGeneric_147440-0164-bit

Copyright(c)1983,2011,Oracleand/htsreserved.

WARNING:i2c_0failedtoaddinterrupt.

WARNING:i2c_0operatinginPOLLMODEonly

WARNING:i2c_1failedtoaddinterrupt.

WARNING:i2c_1operatinginPOLLMODEonly

WARNING:i2c_0failedtoaddinterrupt

WARNING:Failedtoopendevice(/pci@1f,700000:devctl),rv(19)

WARNING:ppm_init_cb:ppmdomaindomain_pciegfxwillbeoffline.

Bootingtomilestone"milestone/single-user:default".

Configuringdevices.

UsingRPCBootparamsfornetworkconfigurationinformation.

Attemptingtoconfigureinterfacece3...

Skippedinterfacece3

Attemptingtoconfigureinterfacece2...

Skippedinterfacece2

Attemptingtoconfigureinterfacece1...

Skippedinterfacece1

Attemptingtoconfigureinterfacece0...

Configuredinterfacece0

Attemptingtoconfigureinterfacebge1...

Skippedinterfacebge1

Attemptingtoconfigureinterfacebge0...

Skippedinterfacebge0

RequestingSystemMaintenanceMode

SINGLEUSERMODE

#3.3.修改/etc/system文件

在format中查看硬盘,找到系统根目录所在分区,并把该分区

挂载给/a。

#format

Searchingfordisks...done

AVAILABLEDISKSELECTIONS:

0.c1t0d0

/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/sd@0,0

Specifydisk(enteritsnumber):0

selectingc1t0d0

[diskformatted]

format>p

partition>p

Currentpartitiontable(original):

Totaldiskcylindersavailable:65533+2(reservedcylinders)

PartTagFlagCylindersSizeBlocks

0rootwm4685-2108034.18GB(16396/0/0)71683312

1swapwu0-46849.77GB(4685/0/0)20482820

2backupwm0-65532136.62GB(65533/0/0)286510276

3homewm21.65GB(7027/0/0)30722044

4unassignedwm00(0/0/0)0

5unassignedwm00(0/0/0)0

6unassignedwm00(0/0/0)0

7unassignedwm28108-2811312.81MB(6/0/0)26232

partition>

###mount/dev/dsk/c1t0d0s0/a//把c1t0d0s0分区mount到/a目录

有时会提示需要fsck先检测磁盘的文件系统,如果文件系统损坏则无法mount

##TERM=vt100;exportTERM;//修改当前环境变量,用户vi编辑

#cd/a/etc//进入/a/etc/目录,不要直接vi/etc/system

#//备份system文件

#visystem//编辑/a/etc/system文件

*BeginMDDrootinfo(donotedit)

rootdev:/pseudo/md@0:0,100,blk

*EndMDDrootinfo(donotedit)

setmd:mirrored_root_flag=1//最后加入这一行,用户在metadb仅一半有效时

候仍能启动系统

目录/a

编辑好/a/etc/system文件后,取消mount的/a目录,不mount

可能会出现挂载问题;

#cd///回到根目录,

#umount/a//umount目录/a

3.5.重启系统并查看系统状态

重启系统,并查看系统状态。

#init6

syncingfilesystems...done

Programterminated

SunUltra45Workstation,NoKeyboard

Copyright2005SunMicrosystems,htsreserved.

OpenBoot4.21.2,4096MBmemoryinstalled,Serial#68148048.

Ethernetaddress0:14:4f:f:db:50,HostID:840fdb50.

Rebootingwithcommand:boot

Bootdevice:/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0,0Fileandargs:

SunOSRelease5.10VersionGeneric_147147-2664-bit

Copyright(c)1983,2013,Oracleand/htsreserved.

Hostname:test-01

test-01consolelogin:root

Password:

Lastlogin:MonMar2411:54:36onconsole

Mar2412:19:21test-01login:ROOTLOGIN/dev/console

OracleCorporationSunOS5.10GenericPatchJanuary2005

###bash

bash-3.2#df-h

FilesystemsizeusedavailcapacityMountedon

/dev/md/dsk/d10034G4.7G29G15%/

/devices0K0K0K0%/devices

ctfs0K0K0K0%/system/contract

proc0K0K0K0%/proc

mnttab0K0K0K0%/etc/mnttab

swap13G1.7M13G1%/etc/svc/volatile

objfs0K0K0K0%/system/object

sharefs0K0K0K0%/etc/dfs/sharetab

/platform/sun4u-us3/lib/libc_psr/libc_psr_.1

34G4.7G29G15%

/platform/sun4u-us3/lib/libc_.1

/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_.1

34G4.7G29G15%

/platform/sun4u-us3/lib/sparcv9/libc_.1

fd0K0K0K0%/dev/fd

swap13G40K13G1%/tmp

swap13G40K13G1%/var/run

/dev/md/dsk/d13014G15M14G1%/export/home

/vol/dev/dsk/c0t0d0/sol_10_811_sparc

2.1G2.1G0K100%/cdrom/sol_10_811_sparc

bash-3.2

#bash-3.2

#bash-3.2#metadb

flagsfirstblkblockcount

ampluo168192/dev/dsk/c1t0d0s7

apluo82088192/dev/dsk/c1t0d0s7

apluo164008192/dev/dsk/c1t0d0s7

MWpl16unknown/dev/dsk/c1t1d0s7

MWpl8208unknown/dev/dsk/c1t1d0s7

MWpl16400unknown/dev/dsk/c1t1d0s7

bash-3.2#metastat

d130:Mirror

Submirror0:d131

State:Okay

Submirror1:d132

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:30722044blocks(14GB)

d131:Submirrorofd130

State:Okay

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s30NoOkayYes

d132:Submirrorofd130

State:Needsmaintenance

Invoke:metareplaced130c1t1d0s3

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s30NoMaintenanceYes

d110:Mirror

Submirror0:d111

State:Okay

Submirror1:d112

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:20482820blocks(9.8GB)

d111:Submirrorofd110

State:Okay

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s10NoOkayYes

d112:Submirrorofd110

State:Needsmaintenance

Invoke:metareplaced110c1t1d0s1

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s10NoMaintenanceYes

d100:Mirror

Submirror0:d101

State:Okay

Submirror1:d102

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:71683312blocks(34GB)

d101:Submirrorofd100

State:Okay

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s00NoOkayYes

d102:Submirrorofd100

State:Needsmaintenance

Invoke:metareplaced100c1t1d0s0

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s00NoMaintenanceYes

DeviceRelocationInformation:

DeviceRelocDeviceID

c1t1d0Yesid1,sd@n5000c50002f5d577

c1t0d0Yesid1,sd@n5000c50002f54e2b

bash-3.2

#bash-3.2

#3.6.在线更换硬盘,重新同步数据

4.解决方法2(删除unknow的metadb)

4.1.进入维护模式

系统缺少metadb会自动进入维护模式,

bash-3.2#init6

bash-3.2#:wait.

:107systemservicesarenowbeingstopped.

Mar2412:22::Terminated

Mar2412:22:47test-01syslogd:goingdownonsignal15

:Thesystemisdown.

syncingfilesystems...done

rebooting...

SunUltra45Workstation,NoKeyboard

Copyright2005SunMicrosystems,htsreserved.

OpenBoot4.21.2,4096MBmemoryinstalled,Serial#68148048.

Ethernetaddress0:14:4f:f:db:50,HostID:840fdb50.

Rebootingwithcommand:boot

Bootdevice:/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0,0:aFileandargs:

SunOSRelease5.10VersionGeneric_147147-2664-bit

Copyright(c)1983,2013,Oracleand/htsreserved.

Hostname:test-01

Insufficientmetadevicedatabasereplicaslocated.

Usemetadbtodeletedatabaseswhicharebroken.

IgnoreanyRead-onlyfilesystemerrormessages.

Rebootthesystemwhenfinishedtoreloadthemetadevicedatabase.

Afterreboot,repairanybrokendatabasereplicaswhichweredeleted.

Mar2412:24:[9]:svc:/system/metainit:default:Method

"/lib/svc/method/svc-metainit"failedwithexitstatus96.

Mar2412:24:[9]:system/metainit:defaultmisconfigured:transitionedto

maintenance(see'svcs-xv'fordetails)

Mar2412:24:[9]:svc:/system/filesystem/usr:default:Method

"/lib/svc/method/fs-usr"failedwithexitstatus95.

Mar2412:24:[9]:system/filesystem/usr:defaultfailedfatally:transitionedto

maintenance(see'svcs-xv'fordetails)

RequestingSystemMaintenanceMode

(See/lib/svc/share/READMEformoreinformation.)

Consoleloginservice(s)cannotrun

Rootpasswordforsystemmaintenance(control-dtobypass):

single-userprivilegeassignedto/dev/console.

EnteringSystemMaintenanceMode

Mar2412:25:00su:'suroot'succeededforrooton/dev/console

OracleCorporationSunOS5.10GenericPatchJanuary2005

#4.2.查看系统状态和配置

维护模式不能编辑文件,但可以查看镜像状态和系统文件,我们

可以查看镜像状态和system文件内容.

#metastat

d130:Mirror

Submirror0:d131

State:Okay

Submirror1:d132

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:30722044blocks(14GB)

d131:Submirrorofd130

State:Okay

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s30NoOkayYes

d132:Submirrorofd130

State:Needsmaintenance

Invoke:metareplaced130c1t1d0s3

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s30NoMaintenanceYes

d110:Mirror

Submirror0:d111

State:Okay

Submirror1:d112

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:20482820blocks(9.8GB)

d111:Submirrorofd110

State:Okay

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s10NoOkayYes

d112:Submirrorofd110

State:Needsmaintenance

Invoke:metareplaced110c1t1d0s1

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s10NoMaintenanceYes

d100:Mirror

Submirror0:d101

State:Okay

Submirror1:d102

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:71683312blocks(34GB)

d101:Submirrorofd100

State:Okay

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s00NoOkayYes

d102:Submirrorofd100

State:Needsmaintenance

Invoke:metareplaced100c1t1d0s0

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s00NoMaintenanceYes

DeviceRelocationInformation:

DeviceRelocDeviceID

c1t1d0Yesid1,sd@n5000c50002f5d577

c1t0d0Yesid1,sd@n5000c50002f54e2b

#4.3.删除unknow的metadb文件

删除无效的metadb文件

#metadb

flagsfirstblkblockcount

amplu168192/dev/dsk/c1t0d0s7

apl82088192/dev/dsk/c1t0d0s7

apl164008192/dev/dsk/c1t0d0s7

MWpl16unknown/dev/dsk/c1t1d0s7

MWpl8208unknown/dev/dsk/c1t1d0s7

MWpl16400unknown/dev/dsk/c1t1d0s7

###metadb-d/dev/dsk/c1t1d0s7

##metadb

flagsfirstblkblockcount

amplu168192/dev/dsk/c1t0d0s7

apl82088192/dev/dsk/c1t0d0s7

apl164008192/dev/dsk/c1t0d0s7

#4.4.重启系统并查看系统状态

删除3份无效的metadb后,系统启动时只检测到3份全部是有

效的metadb文件,所以可以正常启动系统;

##init6

#:wait.

:81systemservicesarenowbeingstopped.

:Thesystemisdown.

syncingfilesystems...done

rebooting...

SunUltra45Workstation,NoKeyboard

Copyright2005SunMicrosystems,htsreserved.

OpenBoot4.21.2,4096MBmemoryinstalled,Serial#68148048.

Ethernetaddress0:14:4f:f:db:50,HostID:840fdb50.

Rebootingwithcommand:boot

Bootdevice:/pci@1e,600000/pci@0/pci@9/pci@0/scsi@1/disk@0,0:aFileandargs:

SunOSRelease5.10VersionGeneric_147147-2664-bit

Copyright(c)1983,2013,Oracleand/htsreserved.

Hostname:test-01

test-01consolelogin:Mar2412:28:47test-01sendmail[531]:Myunqualifiedhostname(test-01)

unknown;sleepingforretry

test-01consolelogin:root

Password:

Mar2412:29:04test-01login:ROOTLOGIN/dev/console

Lastlogin:MonMar2412:19:21onconsole

OracleCorporationSunOS5.10GenericPatchJanuary2005

###bash

bash-3.2#metadb

flagsfirstblkblockcount

ampluo168192/dev/dsk/c1t0d0s7

apluo82088192/dev/dsk/c1t0d0s7

apluo164008192/dev/dsk/c1t0d0s7

bash-3.2#metastat

d130:Mirror

Submirror0:d131

State:Okay

Submirror1:d132

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:30722044blocks(14GB)

d131:Submirrorofd130

State:Okay

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s30NoOkayYes

d132:Submirrorofd130

State:Needsmaintenance

Invoke:metareplaced130c1t1d0s3

Size:30722044blocks(14GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s30NoMaintenanceYes

d110:Mirror

Submirror0:d111

State:Okay

Submirror1:d112

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:20482820blocks(9.8GB)

d111:Submirrorofd110

State:Okay

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s10NoOkayYes

d112:Submirrorofd110

State:Needsmaintenance

Invoke:metareplaced110c1t1d0s1

Size:20482820blocks(9.8GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s10NoMaintenanceYes

d100:Mirror

Submirror0:d101

State:Okay

Submirror1:d102

State:Needsmaintenance

Pass:1

Readoption:roundrobin(default)

Writeoption:parallel(default)

Size:71683312blocks(34GB)

d101:Submirrorofd100

State:Okay

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t0d0s00NoOkayYes

d102:Submirrorofd100

State:Needsmaintenance

Invoke:metareplaced100c1t1d0s0

Size:71683312blocks(34GB)

Stripe0:

DeviceStartBlockDbaseStateRelocHotSpare

c1t1d0s00NoMaintenanceYes

DeviceRelocationInformation:

DeviceRelocDeviceID

c1t1d0Yesid1,sd@n5000c50002f5d577

c1t0d0Yesid1,sd@n5000c50002f54e2b

bash-3.2

#bash-3.2#metastat-p

d130-md131d1321

d13111c1t0d0s3

d13211c1t1d0s3

d110-md111d1121

d11111c1t0d0s1

d11211c1t1d0s1

d100-md101d1021

d10111c1t0d0s0

d10211c1t1d0s0

bash-3.2

#5.总结

5.1.启动检测metadb文件

做了raid1镜像的Solars系统在启动的时候,会检测metadb;

默认情况下,有效的metadb数量大于总数的50%时,系统才会正常

启动,否则系统会自动进入维护模式;如果在/etc/system文件中加

入(setmd:mirrored_root_flag=1)时,只有50%有效的metadb文件,仍可以正

常启动。所以在一块硬盘出现故障时有两种解决方法:

1、修改system文件,加入(setmd:mirrored_root_flag=1)

2、删除无效的metadb副本,使有效的metadb文件超过总数

的50%。

更多推荐

系统盘