Solved

GMIRROR - not loading the mirror

Posted on 2006-06-25
9
489 Views
Last Modified: 2013-11-22
here is what I have ...

A FreeBSD 5.4 stable build.

It is booted from a stand alone drive
there are 2 drives that are mirrored with gmirror

I cannot mount the mirror in any way (that i can think of)

here is the info...

From dmesg:

ad0: 38166MB <WDC WD400BB-00FJA0/13.03G13> [77545/16/63] at ata0-master PIO4
acd0: CDROM <SAMSUNG SC-140B/d005> at ata1-master PIO4
ad4: 76319MB <WDC WD800JB-00JJC0/05.01C05> [155061/16/63] at ata2-master PIO4
ad6: 76319MB <WDC WD800JB-00JJC0/05.01C05> [155061/16/63] at ata3-master PIO4
GEOM_MIRROR: Device data0 created (id=1427972083).
GEOM_MIRROR: Device data0: provider ad4 detected.
GEOM_MIRROR: Device data0: provider ad6 detected.
GEOM_MIRROR: Device data0: provider ad6 activated.
GEOM_MIRROR: Device data0: provider ad4 activated.
GEOM_MIRROR: Device data0: provider mirror/data0 launched.
Mounting root from ufs:/dev/ad0s1a


The /dev/fstab

root@scrapper:~# more /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1g             /home           ufs     rw              2       2
/dev/ad0s1d             /tmp            ufs     rw              2       2
/dev/ad0s1f             /usr            ufs     rw              2       2
/dev/ad0s1e             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
192.168.100.116:/home/ncvs /nfs         nfs     ro,noauto,tcp   0       0
proc                    /proc           procfs  rw              0       0


The Mountlist

root@machine:~# mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad0s1g on /home (ufs, NFS exported, local, soft-updates)
/dev/ad0s1d on /tmp (ufs, local, soft-updates)
/dev/ad0s1f on /usr (ufs, NFS exported, local, soft-updates)
/dev/ad0s1e on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)
devfs on /var/named/dev (devfs, local)

the /dev/mirror directory

crw-r-----  1 root  operator    4,  24 Jun 25 14:16 data0
crw-r-----  1 root  operator    4,  31 Jun 25 14:16 data0s1
crw-r-----  1 root  operator    4,  36 Jun 25 14:16 data0s1a
crw-r-----  1 root  operator    4,  37 Jun 25 14:16 data0s1c
(so ah what is the 'c' in the 1st position)


Any help would be greatly appriciated.









0
Comment
Question by:Nomad469
  • 4
  • 2
9 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 16996863
Alter fstab to use mirror devices.
Make sure to remove 2nd disk from mirror beforehand and add after reboot.
0
 
LVL 62

Expert Comment

by:gheist
ID: 16996869
Trust me -CD2 lets you undo damage when any is done.
0
 
LVL 1

Author Comment

by:Nomad469
ID: 17002748
the mirror is populated with data and it seems to have been in use at one point I believe

if iIbroke the mirror and addressed only one of the drives will that still work ?


0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 62

Accepted Solution

by:
gheist earned 250 total points
ID: 17002865
You can have gmirror consisting of just one drive.
Then you fix the device paths having gmirror device names instead of disk names.
After that you reboot using gmirror names.
Now you add extra disk.
0
 

Assisted Solution

by:digitaly
digitaly earned 250 total points
ID: 17030796
Hmmm...
 
First, there's no mention of the mirrored drives in the fstab.  Gmirror is finding the two drives just fine, but if you don't tell FreeBSD how to mount it, it'll do what any other drive that isn't mounted would do... basically, nothing.  What partition name did you want your mirrored drives to have?

So, GEO_MIRROR detects ad4 and ad6 as the mirrored drives.  /dev/mirror lists

crw-r-----  1 root  operator    4,  36 Jun 25 14:16 data0s1a
crw-r-----  1 root  operator    4,  37 Jun 25 14:16 data0s1c

(ignore the other two lines, these are the actual data partitions)

To add these to your fstab, try the following:

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1g             /home           ufs     rw              2       2
/dev/ad0s1d             /tmp            ufs     rw              2       2
/dev/ad0s1f             /usr            ufs     rw              2       2
/dev/ad0s1e             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
192.168.100.116:/home/ncvs /nfs         nfs     ro,noauto,tcp   0       0
proc                    /proc           procfs  rw              0       0
/dev/mirror/data0s1a             /mirror1               ufs     rw              2       2
/dev/mirror/data0s1c             /mirror2               ufs     rw              2       2

Now, make sure you have the two directories in your / partition:

mkdir /mirror1
mkdir /mirror2

Then try typing the following:

mount /mirror1
mount /mirror2

What's it say?

0
 

Expert Comment

by:digitaly
ID: 17030816
Oh, and there's an excellent article on setting up gmirror:

http://www.onlamp.com/pub/a/bsd/2005/11/10/FreeBSD_Basics.html

This is what convinced me to switch from vinum.

Hope this helps...
0
 
LVL 62

Expert Comment

by:gheist
ID: 17037723
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question