![]() |
|
| Daemon News Ezine | BSD News | BSD Mall | BSD Support Forum | BSD Advocacy | BSD Updates |
Working with gmirror on a Sun Fire X2100 (part 2)by Grzegorz Czaplinski < Grzegorz.Czaplinski@systemics.pl>Editorial note: This is the followup to Greg's previous piece, and continues where part one left off. It is recommended that you read and understand the content presented in part one before attempting any of the procedures documented here. Now without further ado... II. Breaking the mirror. # gmirror remove gm0 ad6 # gmirror list Geom name: gm0 State: COMPLETE Components: 1 Balance: round-robin Slice: 4096 Flags: NONE GenID: 0 SyncID: 1 ID: 3740434803 Providers: 1. Name: mirror/gm0 Mediasize: 250059349504 (233G) Sectorsize: 512 Mode: r6w6e7 Consumers: 1. Name: ad4 Mediasize: 250059350016 (233G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: DIRTY GenID: 0 SyncID: 1 ID: 76271603 The state is COMPLETE as there is only one component left - consumer ad4. III. Disk replacement Assume drive ad4 is broken and it's not visible to the system.
# atacontrol list
ATA channel 0:
Master: acd0 If the drives are hotswap, remove the broken ad4 drive and try to reinitialize it. # atacontrol reinit ata2 Master: no device present Slave: no device present No luck. # atacontrol attach ata4 atacontrol: ioctl(IOCATAATTACH): File exists # atacontrol detach ata4 # atacontrol attach ata4 Master: no device present Slave: no device present # atacontrol reinit ata2 Master: no device present Slave: no device present To make a new drive visible to the system I had to reboot the server. # gmirror insert -p 1 gm0 ad4 Not all disks connected. Try 'forget' command first. To forget about components which are not connected use command: # gmirror forget gm0 Add a component to the mirror. # gmirror insert -p 1 gm0 ad4 Check if the mirror is synchronizing. # gmirror list Geom name: gm0 State: DEGRADED Components: 2 Balance: round-robin Slice: 4096 Flags: NONE GenID: 0 SyncID: 6 ID: 1189193877 Providers: 1. Name: mirror/gm0 Mediasize: 250059349504 (233G) Sectorsize: 512 Mode: r7w6e7 Consumers: 1. Name: ad6 Mediasize: 250059350016 (233G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: NONE GenID: 0 SyncID: 6 ID: 1830980100 2. Name: ad4 Mediasize: 250059350016 (233G) Sectorsize: 512 Mode: r1w1e1 State: SYNCHRONIZING Priority: 1 Flags: DIRTY, SYNCHRONIZING GenID: 0 SyncID: 6 Synchronized: 0% ID: 1487713881 As you can see, the drive replacement went OK and the synchronization process started. When it's finished, the state of gm0 should change from DEGRADED to COMPLETED. After reading this article, I hope you will have a good insight on gmirror(8). I tried to write it in an easy to read and understand manner. Although I know Pawel Jakub Dawidek very well I must admit gmirror(8) is a very nice and easy tool for RAID-1. I really encourage you to use it for mirroring. Grzegorz Czaplinski (http://www.czaplinski.net) - Technical Team Leader at Systemics Poland Sp. z o.o. - Sun's partner in service and education. FreeBSD and Solaris admin., recently a Mac user. In my free time I am an alpine mountaineer. |