Solved

GMIRROR - not loading the mirror

Posted on 2006-06-25
9
477 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 61

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 61

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 61

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 61

Expert Comment

by:gheist
ID: 17037723
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now