gmirror disk mirroring

Ask a Question related to FreeBSD, Design and Development.

  1. #1

    Default gmirror disk mirroring

    Hi All,

    I'm having a problem trying to set up disk mirroring of two 80G Western Digital
    IDE drives. I'm using the instructions at
    [url]http://people.freebsd.org/~rse/mirror/[/url]
    I've included these instructions at the end of this e-mail.
    When I reboot the system for the first time as instructed, it starts to boot but
    then just starts printing the following messages to the screen:

    init: can't exec getty `usr/libexec/getty` for port ttyv1:
    No such file or directory
    init: can't exec getty `usr/libexec/getty` for port ttyv2:
    No such file or directory
    init: can't exec getty `usr/libexec/getty` for port ttyv3:
    No such file or directory
    init: can't exec getty `usr/libexec/getty` for port ttyv4:
    No such file or directory
    ..
    ..
    ..


    Can anyone tell me where I'm going wrong/what is happening?
    Thanks so much,
    Stephen

    The instructions:
    # make sure the second disk is treated as a really fresh one
    # (not really necessary, but makes procedure more deterministically ;-)
    dd if=/dev/zero of=/dev/ad1 bs=512 count=79

    # place a GEOM mirror label onto second disk
    # (actually on the last block of the disk)
    gmirror label -v -n -b round-robin gm0 /dev/ad1

    # activate GEOM mirror kernel layer
    # (makes the /dev/mirror/gm0 device available)
    gmirror load

    # place a PC MBR onto the second disk
    # (with a single FreeBSD slice /dev/mirror/gm0s1 covering the whole disk)
    fdisk -v -B -I /dev/mirror/gm0

    # place a BSD disklabel onto /dev/mirror/gm0s1
    # (ATTENTION: in FreeBSD 5-STABLE before 14-Jan-2005 the
    # /dev/mirror/gm0s1 device has to be specified as just "mirror/gm0s1" or
    # the bsdlabel(8) will use the incorrect GEOM name "gm0s1" instead!)
    # (NOTICE: figure out what partitions you want with "bsdlabel /dev/ad0" before)
    # (NOTICE: start "a" partition at offset 16, "c" partition at offset 0)
    bsdlabel -w -B /dev/mirror/gm0s1 # initialize
    bsdlabel -e /dev/mirror/gm0s1 # create custom partitions

    # manually copy filesystem data from first to to second disk
    # (same procedure for partitions "g", etc)
    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/usr
    dump -L -0 -f- /usr | (cd /mnt/usr; restore -r -v -f-)

    # adjust new system configuration for GEOM mirror based setup
    cp -p /mnt/etc/fstab /mnt/etc/fstab.orig
    sed -e 's/dev\/ad0/dev\/mirror\/gm0/g' </mnt/etc/fstab.orig >/mnt/etc/fstab
    echo 'swapoff="YES"' >>/mnt/etc/rc.conf # for 5.3-RELEASE only
    echo 'geom_mirror_load="YES"' >>/mnt/boot/loader.conf

    # instruct boot stage 2 loader on first disk to boot
    # with the boot stage 3 loader from the second disk
    # (mainly because BIOS might not allow easy booting from second ATA disk
    # or at least requires manual intervention on the console)
    echo "1:ad(1,a)/boot/loader" >/boot.config

    # reboot system
    # (for running system with GEOM mirror on second disk)
    shutdown -r now

    # make sure the first disk is treated as a really fresh one
    # (also not really necessary, but makes procedure more deterministically ;-)
    dd if=/dev/zero of=/dev/ad0 bs=512 count=79

    # switch GEOM mirror to auto-synchronization and add first disk
    # (first disk is now immediately synchronized with the second disk content)
    gmirror configure -a gm0
    gmirror insert gm0 /dev/ad0

    # wait for the GEOM mirror synchronization to complete
    sh -c 'while [ ".`gmirror list | grep SYNCHRONIZING`" != . ]; do sleep 1; done'

    # reboot into the final two-disk GEOM mirror setup
    # (now actually boots with the MBR and boot stages on first disk
    # as it was synchronized from second disk)
    shutdown -r now



    Stephen Kelly Guest

  2. Similar Questions and Discussions

    1. Mirroring
      I have a Win2K3 server up to date with SPs. I want to mirror a current system disk. I have dynamic disks but i don't have the option in the menu in...
    2. Mirroring an image
      I have a php script that needs to flip (mirror) an image horozontally. I've read through all the GD documentation and every usenet article that I...
    3. RAID 1 mirroring
      Hello, I have a Sun system running Solaris 9. It has two 36 Gb scsi disks in it; c0t0d0 and c0t1d0. I have installed the O/S to c0t0d0. I'd...
    4. Removable disk, mapped network disk and drive letter problem
      I don't know why this is such a big problem in Windows, but I hope somebody has a solution for it. You know those USB card readers used for...
    5. Installing Oracle Software on Local Disk Vs Shared Disk
      Hi I am investigating on several options for a multi node VCS cluster to house oracle databases. Where would it be most advantageous to...
  3. #2

    Default Re: gmirror disk mirroring

    Am Sonntag, 27. Februar 2005 03:54 schrieb Stephen Kelly:
    > Hi All,
    >
    > I'm having a problem trying to set up disk mirroring of two 80G Western
    > Digital IDE drives. I'm using the instructions at
    > [url]http://people.freebsd.org/~rse/mirror/[/url]
    > I've included these instructions at the end of this e-mail.
    > When I reboot the system for the first time as instructed, it starts to
    > boot but then just starts printing the following messages to the screen:
    >
    > init: can't exec getty `usr/libexec/getty` for port ttyv1:
    > No such file or directory
    > init: can't exec getty `usr/libexec/getty` for port ttyv2:
    > No such file or directory
    > init: can't exec getty `usr/libexec/getty` for port ttyv3:
    > No such file or directory
    > init: can't exec getty `usr/libexec/getty` for port ttyv4:
    > No such file or directory
    > .
    > .
    > .
    Something at the dump/restore stage went wrong or your /etc/fstab is wrong.
    Delete /boot.congig an boot from the initial disk, btw. is your second drive
    really on primary slave? That's why I hate how-tos, people just type it word
    by word without knowing what they do.
    If your disk ist secondary master, it's not ad1 but ad2, in GENERIC ata is
    compiled with ATA_STATIC_ID.

    Forget the howto and read the man pages, it's the shorter way if the howto
    doesn't work for you.

    Best regards,

    -Harry
    >
    >
    > Can anyone tell me where I'm going wrong/what is happening?
    > Thanks so much,
    > Stephen
    >
    > The instructions:
    > # make sure the second disk is treated as a really fresh one
    > # (not really necessary, but makes procedure more deterministically ;-)
    > dd if=/dev/zero of=/dev/ad1 bs=512 count=79
    >
    > # place a GEOM mirror label onto second disk
    > # (actually on the last block of the disk)
    > gmirror label -v -n -b round-robin gm0 /dev/ad1
    >
    > # activate GEOM mirror kernel layer
    > # (makes the /dev/mirror/gm0 device available)
    > gmirror load
    >
    > # place a PC MBR onto the second disk
    > # (with a single FreeBSD slice /dev/mirror/gm0s1 covering the whole disk)
    > fdisk -v -B -I /dev/mirror/gm0
    >
    > # place a BSD disklabel onto /dev/mirror/gm0s1
    > # (ATTENTION: in FreeBSD 5-STABLE before 14-Jan-2005 the
    > # /dev/mirror/gm0s1 device has to be specified as just "mirror/gm0s1" or
    > # the bsdlabel(8) will use the incorrect GEOM name "gm0s1" instead!)
    > # (NOTICE: figure out what partitions you want with "bsdlabel /dev/ad0"
    > before) # (NOTICE: start "a" partition at offset 16, "c" partition at
    > offset 0) bsdlabel -w -B /dev/mirror/gm0s1 # initialize
    > bsdlabel -e /dev/mirror/gm0s1 # create custom partitions
    >
    > # manually copy filesystem data from first to to second disk
    > # (same procedure for partitions "g", etc)
    > 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/usr
    > dump -L -0 -f- /usr | (cd /mnt/usr; restore -r -v -f-)
    >
    > # adjust new system configuration for GEOM mirror based setup
    > cp -p /mnt/etc/fstab /mnt/etc/fstab.orig
    > sed -e 's/dev\/ad0/dev\/mirror\/gm0/g' </mnt/etc/fstab.orig >/mnt/etc/fstab
    > echo 'swapoff="YES"' >>/mnt/etc/rc.conf # for 5.3-RELEASE only
    > echo 'geom_mirror_load="YES"' >>/mnt/boot/loader.conf
    >
    > # instruct boot stage 2 loader on first disk to boot
    > # with the boot stage 3 loader from the second disk
    > # (mainly because BIOS might not allow easy booting from second ATA disk
    > # or at least requires manual intervention on the console)
    > echo "1:ad(1,a)/boot/loader" >/boot.config
    >
    > # reboot system
    > # (for running system with GEOM mirror on second disk)
    > shutdown -r now
    >
    > # make sure the first disk is treated as a really fresh one
    > # (also not really necessary, but makes procedure more deterministically
    > ;-) dd if=/dev/zero of=/dev/ad0 bs=512 count=79
    >
    > # switch GEOM mirror to auto-synchronization and add first disk
    > # (first disk is now immediately synchronized with the second disk content)
    > gmirror configure -a gm0
    > gmirror insert gm0 /dev/ad0
    >
    > # wait for the GEOM mirror synchronization to complete
    > sh -c 'while [ ".`gmirror list | grep SYNCHRONIZING`" != . ]; do sleep 1;
    > done'
    >
    > # reboot into the final two-disk GEOM mirror setup
    > # (now actually boots with the MBR and boot stages on first disk
    > # as it was synchronized from second disk)
    > shutdown -r now
    >
    >
    >
    > _______________________________________________
    > [email]freebsd-questions@freebsd.org[/email] mailing list
    > [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
    > To unsubscribe, send any mail to
    > "freebsd-questions-unsubscribe@freebsd.org"
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQBCIfTcBylq0S4AzzwRAugKAJ9+ktWCbx9Nbo7+h8TjjV daBUiHuQCeLRhj
    Rj+nRAviHLS8AOzB0wY8X9c=
    =B2Hy
    -----END PGP SIGNATURE-----

    Emanuel Strobl Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139