Re: gmirror problem on 5.3-R i386

From: Jerry McAllister (jerrymc_at_clunix.cl.msu.edu)
Date: 01/13/05

  • Next message: Nelis Lamprecht: "Re: anyone using Putty and ssh-agent?"
    To: doug@polands.org (Doug Poland)
    Date: Thu, 13 Jan 2005 10:10:30 -0500 (EST)
    
    

    >
    > Hello,
    >
    > I'm having a problem with gmirror. It would seem that I cannot add my
    > first disk to the mirror after booting off the second drive. My current
    > status is a degraded mirror and I cannot see any of the partitions on
    > disk one.
    >
    > For a guide, I'm using the excellent instructions at:
    > http://people.freebsd.org/~rse/mirror/
    >
    > My system has identical WD 80GB SATA drives (ad4 and ad6). I've
    > followed the steps in the document that are labeled:
    >
    > "GEOM mirror Approach 2: Single Slice, Preferred, More Flexible"
    >
    > # dd if=/dev/zero of=/dev/ad6 bs=512 count=79
    > # fdisk -v -B -I /dev/ad6
    >
    > # gmirror label -v -n -b round-robin gm0s1 /dev/ad6s1
    > # gmirror load
    >
    > # bsdlabel -w -B /dev/mirror/gm0s1
    > # bsdlabel -e /dev/mirror/gm0s1
    >
    > # newfs -U /dev/mirror/gm0s1a
    > # mount /dev/mirror/gm0s1a /mnt
    > # dump -L -0 -f- / | (cd /mnt; restore -r -v -f-)
    > # newfs -U /dev/mirror/gm0s1d
    > # mount /dev/mirror/gm0s1d /mnt/var
    > # dump -L -0 -f- /var | (cd /mnt/var; restore -r -v -f-)
    > # newfs -U /dev/mirror/gm0s1e
    > # mount /dev/mirror/gm0s1e /mnt/tmp
    > # dump -L -0 -f- /tmp | (cd /mnt/tmp; restore -r -v -f-)
    > # mount /dev/mirror/gm0s1f /mnt/usr
    > # dump -L -0 -f- /usr | (cd /mnt/usr; restore -r -v -f-)
    > # cp -p /mnt/etc/fstab /mnt/etc/fstab.orig
    >
    > # sed -e 's/dev\/ad4s1/dev\/mirror\/gm0s1/g' </mnt/etc/fstab.orig
    > # echo 'swapoff="YES"' >>/mnt/etc/rc.conf
    > # echo 'geom_mirror_load="YES"' >>/mnt/boot/loader.conf
    > # echo "1:ad(6,a)/boot/loader" >/boot.config
    >
    > # shutdown -r now
    >
    > # dd if=/dev/zero of=/dev/ad4 bs=512 count=79

    Well, I am not so familiar with gmirror, but the dd in each case
    completely overwrites the slice and partition tables and any other
    boot stuff at the beginning of the disk with zeros. That is often
    done to make sure it is clear and treated as a clean disk. I see that
    after the first dd (to /dev/ad6) you have an fdisk which then writes
    a slice table.
    But, after the second dd (to /dev/ad4) you do not have any fdisk
    so it might not know what to do with that. You may need an equivalent
    fdisk here too.

    ////jerry

    >
    > # gmirror configure -a gm0s1
    > # gmirror insert gm0s1 /dev/ad4s1
    >
    > At this point I see...
    >
    > "Unknown provider ad4s1"
    >
    > A gmirror list reveals:
    >
    > Geom name: mirror
    > State: DEGRADED
    > Components: 2
    > Balance: load
    > Slice: 2048
    > Flags: NONE
    > SyncID: 2
    > ID: 4216140117
    > Providers:
    > 1. Name: mirror/mirror
    > Mediasize: 80026361344 (75G)
    > Sectorsize: 512
    > Mode: r0w0e0
    > Consumers:
    > 1. Name: ad4
    > Mediasize: 80026361856 (75G)
    > Sectorsize: 512
    > Mode: r0w0e0
    > State: ACTIVE
    > Priority: 0
    > Flags: NONE
    > SyncID: 2
    > ID: 3073402045
    >
    > Geom name: mirror.sync
    >
    > Geom name: gm0s1
    > State: COMPLETE
    > Components: 1
    > Balance: round-robin
    > Slice: 4096
    > Flags: NONE
    > SyncID: 1
    > ID: 3205827760
    > Providers:
    > 1. Name: mirror/gm0s1
    > Mediasize: 80026329088 (75G)
    > Sectorsize: 512
    > Mode: r5w5e1
    > Consumers:
    > 1. Name: ad6
    > Mediasize: 80026361856 (75G)
    > Sectorsize: 512
    > Mode: r5w5e2
    > State: ACTIVE
    > Priority: 0
    > Flags: DIRTY
    > SyncID: 1
    > ID: 1606771156
    >
    > Geom name: gm0s1.sync
    >
    > Here's a snippet of /var/log/messages after the first reboot:
    >
    > Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1 created (id=3205827760).
    > Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 detected.
    > Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 activated.
    > Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider mirror/gm0s1 launched.
    > Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device mirror created (id=4216140117).
    > Jan 12 17:47:21 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 detected.
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Force device mirror start due to timeout.
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Cannot update metadata on disk ad4 (error=1).
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 activated.
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider mirror/mirror launched.
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Cannot update metadata on disk ad4 (error=1).
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 disconnected.
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror: provider mirror/mirror destroyed.
    > Jan 12 17:47:25 webhost02 kernel: GEOM_MIRROR: Device mirror destroyed.
    > Jan 12 17:57:32 webhost02 syslogd: kernel boot file is /boot/kernel/kernel
    >
    > Subsequent reboots reveal:
    >
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror created (id=4216140117).
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 detected.
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1 created (id=3205827760).
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 detected.
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider ad6 activated.
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device gm0s1: provider mirror/gm0s1 launched.
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Force device mirror start due to timeout.
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror: provider ad4 activated.
    > Jan 12 17:57:32 webhost02 kernel: GEOM_MIRROR: Device mirror: provider mirror/mirror launched.
    > Jan 12 17:57:32 webhost02 kernel: Mounting root from ufs:/dev/mirror/gm0s1a
    >
    >
    > Here's my bsdlabels, if that helps:
    >
    > webhost02# bsdlabel /dev/mirror/gm0s1
    > # /dev/mirror/gm0s1:
    > 8 partitions:
    > # size offset fstype [fsize bsize bps/cpg]
    > a: 524288 0 4.2BSD 2048 16384 32776
    > b: 4142160 524288 swap
    > c: 156301424 0 unused 0 0 # "raw" part, don't edit
    > d: 16777216 4666448 4.2BSD 2048 16384 28552
    > e: 2097152 21443664 4.2BSD 2048 16384 28552
    > f: 132755506 23540816 4.2BSD 2048 16384 28552
    >
    > webhost02# bsdlabel /dev/ad6
    > # /dev/ad6:
    > 8 partitions:
    > # size offset fstype [fsize bsize bps/cpg]
    > a: 524288 0 4.2BSD 2048 16384 32776
    > b: 4142160 524288 swap
    > c: 156301424 0 unused 0 0 # "raw" part, don't edit
    > d: 16777216 4666448 4.2BSD 2048 16384 28552
    > e: 2097152 21443664 4.2BSD 2048 16384 28552
    > f: 132755506 23540816 4.2BSD 2048 16384 28552
    > bsdlabel: partition c doesn't cover the whole unit!
    > bsdlabel: An incorrect partition c may cause problems for standard system utilities
    >
    > webhost02# bsdlabel /dev/ad4
    > bsdlabel: /dev/ad4: no valid label found
    >
    > Thanks for your help!
    >
    > --
    > Regards,
    > Doug
    > _______________________________________________
    > freebsd-questions@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
    >

    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: Nelis Lamprecht: "Re: anyone using Putty and ssh-agent?"

    Relevant Pages

    • SUMMARY: Mirroring Questions Part 1 & 2
      ... If you use two diffrent size hard drives to mirror you can reclaim the un-used space on the larger of the two drives, this seems to not be recommended because you will take a performance hit. ... If I mirror with drives of different sizes, root disk being the smallest and the mirror being the largest, will I suffer performance problems? ... Both disks have identical partions setup when looking thru the format command expect slice 2. ... If you have only a few partitions that could be considered actual boot ...
      (SunManagers)
    • Re: gmirror disk fail questions...
      ... mirror/gm0 DEGRADED ad4 ... I am guessing that a failing disk is responsible for the data ... the mirror is marked clean ad there's no warnings about ... I believe the kernel hides individual labels for a gmirror volume. ...
      (freebsd-questions)
    • Re: gmirror disks vs partitions
      ... Apart from potentially avoiding a whole disk from being copied ... You divide a couple of identical drives proportionally ... in two partitions each, place a couple of the first ... partitions into gmirror and a couple of the second ...
      (freebsd-stable)
    • Re: Crashed gmirror, single disk marked SYNC and wont boot...
      ... As soon as the box got up, I removed ad0 from the gmirror, so ad6 was ... Today I got a new disk that would replace ad0.. ... ad6 was the only disk in the mirror. ... your partition table seems to be gone. ...
      (freebsd-stable)
    • Re: Setting up RAID-1 on 2 unequal disks
      ... I think I will try to go with John's approach (ie via gmirror), as I've used it previously for a raiding on equally-sized disks. ... I plan to mirror /shared onto the 80GB. ... The only hard part is going to be labeling the 120GB disk correctly. ... You will most likely want to do it manually using bsdlabel. ...
      (freebsd-questions)