DæmonNews: News and views for the BSD community

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  ATA/ATAPI revision 5
    Slave:       no device present
ATA channel 1:
    Master:      no device present
    Slave:       no device present
ATA channel 2:
    Master:      no device present
    Slave:       no device present
ATA channel 3:
    Master:  ad6  Serial ATA v1.0
    Slave:       no device present
ATA channel 4:
    Master:      no device present
    Slave:       no device present
ATA channel 5:
    Master:      no device present
    Slave:       no device present

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.

Google
Web daemonnews.org

More Articles
  • Working with gmirror and a Sun Fire X2100 (part 1)
  • Open Source Initiatives and You...
  • Installing BSD on IBM Netvista S40 - Part 4: NetBSD Installation
  • Book Review: Open Source Pen Testers Toolkit
  • Daemon's Advocate
  • BSDCan 2006 Friday Photos
  • Installing BSD on IBM Netvista S40 - Part 3: DragonFly Installation
  • BSDCan 2006 Photos
  • AFS: network filesystem beyond NFS weaknesses
  • Mastering FreeBSD and OpenBSD Security
  • Installing BSD on IBM Netvista S40 - Part 2: FreeBSD Installation
  • Interview with Diego Petteno, Gentoo/*BSD developer
  • Installing BSD on IBM Netvista S40 - Part 1: FreeBSD Installation
  • Interview with Jan Schaumann
  • Interview with Theo de Raadt

  • Advertisements

    BSD News
  • NetBSD 3.1 Release Candidate 1 available for download
  • August Newsletter
  • AsiaBSDCon 2007 Call for Papers
  • Submit A News Item
  • FreeBSD Multimedia Resources List launched
  • OpenBSD meets OpenOffice.org
  • bruteblock - new tool for blocking bruteforce attacks with ipfw
  • LinuxWorld 2006: PC-BSD
  • Server created through donations



  • Author maintains all copyrights on this article.
    Images and layout Copyright © 1998-2006 Dæmon News. All Rights Reserved.