Terje Elde | 8 Nov 2004 13:05

Re: gmirror problems

On Mon, Nov 08, 2004 at 12:55:06PM +0100, Pawel Jakub Dawidek wrote:
> Ok, everything is clear now. You disconnected ad1, but ad0 was marked
> for synchronization. It that case gmirror cannot find any valid component,
> because the only one it can find is stale.
> So:
> 1. You should test it when mirror is in complete state (then you can remove
>    any component).
> 2. You can remove ad0 and put ad1 to make your test.

Hi,

This makes a interesting question pop up in my head.

If his ad1 had been reformatted, burned or lost, if there any way he could try
to partially recover from this?

gmirror can't find a valid component, so it never makes the volume available.

If I understand gmirror correctly, it keeps it's metadata at the end of the
partition, so he could mount the mirror directly as a normal filesystem, then
try to recover the files onto a fresh mirror?

Also, do I understand it correctly that he could (in theory anyway):

1. gmirror remove - to clear meta-data on ad0
2. insert a new ad1
3. gmirror label myvol ad0 ad1 - to create a new volume, have it syncronize to ad1
4. access the data as it was when the syncronization of ad0 stopped?

Trying to make sure I understand things right,
(Continue reading)

Pawel Jakub Dawidek | 8 Nov 2004 13:46
Picon
Favicon

Re: gmirror problems

On Mon, Nov 08, 2004 at 01:05:13PM +0100, Terje Elde wrote:
+> On Mon, Nov 08, 2004 at 12:55:06PM +0100, Pawel Jakub Dawidek wrote:
+> > Ok, everything is clear now. You disconnected ad1, but ad0 was marked
+> > for synchronization. It that case gmirror cannot find any valid component,
+> > because the only one it can find is stale.
+> > So:
+> > 1. You should test it when mirror is in complete state (then you can remove
+> >    any component).
+> > 2. You can remove ad0 and put ad1 to make your test.
+> 
+> Hi,
+> 
+> This makes a interesting question pop up in my head.
+> 
+> If his ad1 had been reformatted, burned or lost, if there any way he could try
+> to partially recover from this?

Yes, he can just:

	# gmirror create <name> ad0

Only new metadata will be written, data are not touched.

Then just add a new disk and synchronization will start automatically:

	# gmirror insert <name> ad1

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
(Continue reading)

Michael Riexinger | 8 Nov 2004 15:40

Re: gmirror problems

On Monday 08 November 2004 13:46, Pawel Jakub Dawidek wrote:
> On Mon, Nov 08, 2004 at 01:05:13PM +0100, Terje Elde wrote:
> +> On Mon, Nov 08, 2004 at 12:55:06PM +0100, Pawel Jakub Dawidek
> wrote: +> > Ok, everything is clear now. You disconnected ad1, but
> ad0 was marked +> > for synchronization. It that case gmirror cannot
> find any valid component, +> > because the only one it can find is
> stale.
> +> > So:
> +> > 1. You should test it when mirror is in complete state (then you
> can remove +> >    any component).
> +> > 2. You can remove ad0 and put ad1 to make your test.
> +>
> +> Hi,
> +>
> +> This makes a interesting question pop up in my head.
> +>
> +> If his ad1 had been reformatted, burned or lost, if there any way
> he could try +> to partially recover from this?
>
> Yes, he can just:
>
>  # gmirror create <name> ad0
>
> Only new metadata will be written, data are not touched.
>
> Then just add a new disk and synchronization will start
> automatically:
>
>  # gmirror insert <name> ad1
I did several tests now and all went fine, gmirror is what i was looking 
(Continue reading)

Pawel Jakub Dawidek | 8 Nov 2004 17:45
Picon
Favicon

Re: gmirror problems

On Mon, Nov 08, 2004 at 03:40:05PM +0100, Michael Riexinger wrote:
+> Now a last question: For setting up gmirror on my 2 hd's (the first 
+> contained a fresh freebsd installation), I had to boot from cd, using 
+> the fixit cd, chrooting a bit for loading gmirror etc. Is there an 
+> easier way for doing this? First i tried using the single user mode but 
+> there was an operation not permitted when i tried to do a 'gmirror 
+> label'. Can I for example say: Create a mirror on ad1 with the data on 
+> ad0, wait till it's built, reboot the machine from the gmirror and then 
+> insert ad0? 

Unfortunately, gmirror and other GEOM classes are not supported by our
installer.

The safest way to do what you want is to:

	# gmirror label <name> ad1
	create slices and partitions on /dev/mirror/≤name>
	create file system
	copy data from ad0 to <name>
	change /etc/fstab to boot from /dev/mirror/≤name>s1a or something
	reboot
	# gmirror insert <name> ad0

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
Robin Breathe | 12 Nov 2004 20:04

Re: gmirror problems

Pawel Jakub Dawidek wrote:
> Unfortunately, gmirror and other GEOM classes are not supported by our
> installer.
> 
> The safest way to do what you want is to:
> 
> 	# gmirror label <name> ad1
> 	create slices and partitions on /dev/mirror/≤name>
> 	create file system
> 	copy data from ad0 to <name>
> 	change /etc/fstab to boot from /dev/mirror/≤name>s1a or something
> 	reboot
> 	# gmirror insert <name> ad0

Are any nasty side-effects likely from slicing and newfs-ing ad1 prior 
to labelling the mirror? For example, could the gmirror metadata get 
overwritten at some later stage by writing to the end of the last slice?

Robin

Pawel Jakub Dawidek | 12 Nov 2004 23:21
Picon
Favicon

Re: gmirror problems

On Fri, Nov 12, 2004 at 07:04:21PM +0000, Robin Breathe wrote:
+> Pawel Jakub Dawidek wrote:
+> >Unfortunately, gmirror and other GEOM classes are not supported by our
+> >installer.
+> >
+> >The safest way to do what you want is to:
+> >
+> >	# gmirror label <name> ad1
+> >	create slices and partitions on /dev/mirror/≤name>
+> >	create file system
+> >	copy data from ad0 to <name>
+> >	change /etc/fstab to boot from /dev/mirror/≤name>s1a or something
+> >	reboot
+> >	# gmirror insert <name> ad0
+> 
+> Are any nasty side-effects likely from slicing and newfs-ing ad1 prior 
+> to labelling the mirror? For example, could the gmirror metadata get 
+> overwritten at some later stage by writing to the end of the last slice?

In theory it is possible, yes, but I doubt you can see it in practise.
You can also see some complains that slices are too big, because gmirror
cuts the last sectors from the component provider.

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
Mark Frasa | 8 Nov 2004 21:20

Re: gmirror problems

On 2004.11.08 17:45:40 +0000, Pawel Jakub Dawidek wrote:
> On Mon, Nov 08, 2004 at 03:40:05PM +0100, Michael Riexinger wrote:
> +> Now a last question: For setting up gmirror on my 2 hd's (the first 
> +> contained a fresh freebsd installation), I had to boot from cd, using 
> +> the fixit cd, chrooting a bit for loading gmirror etc. Is there an 
> +> easier way for doing this? First i tried using the single user mode but 
> +> there was an operation not permitted when i tried to do a 'gmirror 
> +> label'. Can I for example say: Create a mirror on ad1 with the data on 
> +> ad0, wait till it's built, reboot the machine from the gmirror and then 
> +> insert ad0? 
> 
> Unfortunately, gmirror and other GEOM classes are not supported by our
> installer.
> 
> The safest way to do what you want is to:
> 
> 	# gmirror label <name> ad1
> 	create slices and partitions on /dev/mirror/≤name>
> 	create file system
> 	copy data from ad0 to <name>
> 	change /etc/fstab to boot from /dev/mirror/≤name>s1a or something
> 	reboot
> 	# gmirror insert <name> ad0
> 
> -- 
> Pawel Jakub Dawidek                       http://www.FreeBSD.org
> pjd <at> FreeBSD.org                           http://garage.freebsd.pl
> FreeBSD committer                         Am I Evil? Yes, I Am!

Hello,
(Continue reading)

Pawel Jakub Dawidek | 8 Nov 2004 21:24
Picon
Favicon

Re: gmirror problems

On Mon, Nov 08, 2004 at 09:20:42PM +0100, Mark Frasa wrote:
+> Now i am trying to setup geom_mirror, when i do the above things:
+> 
+> "gmirror label data ad1"
+> 
+> /dev/mirror is not available.
+> 
+> Why is this? Am i missing something or what?

Yes, you probably forgot about:

	# gmirror load

:)

--

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd <at> FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!

Gmane