All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Adding a mirror after-the-fact
@ 2001-08-14 21:11 Jason Tackaberry
  2001-08-15  8:56 ` Heinz J . Mauelshagen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jason Tackaberry @ 2001-08-14 21:11 UTC (permalink / raw)
  To: linux-lvm

I know this isn't strictly an LVM question, but ...

Suppose I have a volume group with 1 physical volume, say a 9GB disk.
Now, after some time, I decide I want to mirror this VG with another 9GB
disk.  What options do I have?  AFAICS, the only way to do this would be
to start from scratch?  This is a pretty simple and presumably common
thing to want to do, so I hope I'm wrong.  :)

Cheers,
Jason.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-14 21:11 [linux-lvm] Adding a mirror after-the-fact Jason Tackaberry
@ 2001-08-15  8:56 ` Heinz J . Mauelshagen
  2001-08-15 13:13   ` Jason Tackaberry
  2001-08-15 21:30   ` Luca Berra
  2001-08-19 19:20 ` Wolfgang Weisselberg
  2001-08-20  2:49 ` Ted Deppner
  2 siblings, 2 replies; 8+ messages in thread
From: Heinz J . Mauelshagen @ 2001-08-15  8:56 UTC (permalink / raw)
  To: linux-lvm

On Tue, Aug 14, 2001 at 05:11:59PM -0400, Jason Tackaberry wrote:
> I know this isn't strictly an LVM question, but ...
> 
> Suppose I have a volume group with 1 physical volume, say a 9GB disk.
> Now, after some time, I decide I want to mirror this VG with another 9GB
> disk.  What options do I have?  AFAICS, the only way to do this would be
> to start from scratch?  This is a pretty simple and presumably common
> thing to want to do, so I hope I'm wrong.  :)

Yes, you are (with 2.4 kernels) ;-)

You could either mirror the whole disk using MD *without* persistent superblocks

*or*

use MD and mirror all logical volumes.

The later needs an additional VG on the second disk with logical volumes of the
same size of those in the first VG you already have.

Say you have a volume group named "vg". Then you could create a volume group
"vg_mirror" on the other disk, create logical volumes named after the ones
you already have in "vg" and set up an /etc/raidtab file with mirrors for
all the logical volumes.


Pro of first approach is, that you don't need to worry about new logical volumes
which will be mirrored automatically because you mirror the whole underlying
device.

With the second approach, you need to create a mirror logical volume, extend
your raidtab and activate mirrors for every new logical volume.

> 
> Cheers,
> Jason.
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

-- 

Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
Mauelshagen@Sistina.com                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-15  8:56 ` Heinz J . Mauelshagen
@ 2001-08-15 13:13   ` Jason Tackaberry
  2001-08-15 13:33     ` Werner John
  2001-08-15 21:30   ` Luca Berra
  1 sibling, 1 reply; 8+ messages in thread
From: Jason Tackaberry @ 2001-08-15 13:13 UTC (permalink / raw)
  To: linux-lvm

> You could either mirror the whole disk using MD *without* persistent
> superblocks

This sounds like the best and most transparent solution.  But
Documentation/md.txt says:

raid level = -1 linear mode
              0 striped mode
  	      other modes are only supported with persistant super blocks

So it sounds like this won't work?  I'll give it a try and see what
happens anyway.

Thanks,
Jason.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-15 13:13   ` Jason Tackaberry
@ 2001-08-15 13:33     ` Werner John
  0 siblings, 0 replies; 8+ messages in thread
From: Werner John @ 2001-08-15 13:33 UTC (permalink / raw)
  To: linux-lvm

Jason Tackaberry writes:
> > You could either mirror the whole disk using MD *without* persistent
> > superblocks
> 
> This sounds like the best and most transparent solution.  But
> Documentation/md.txt says:
> 
> raid level = -1 linear mode
>               0 striped mode
>   	      other modes are only supported with persistant super blocks
> 
> So it sounds like this won't work?  I'll give it a try and see what
> happens anyway.

It should work, you only need the persistent superblock, if you want to
boot from software RAID.
Here the quote from the HOWTO

>>  3.7.  The Persistent Superblock
>>
>>  Back in ``The Good Old Days'' (TM), the raidtools would read your
>>  /etc/raidtab file, and then initialize the array.  However, this would
>>  require that the filesystem on which /etc/raidtab resided was mounted.
>>  This is unfortunate if you want to boot on a RAID.
>>
>>  Also, the old approach led to complications when mounting filesystems
>>  RAID devices. They could not be put in the /etc/fstab file as usual,
>>  but would have to be mounted from the init-scripts.
>>
>>  The persistent superblocks solve these problems. When an array is
>>  initialized with the persistent-superblock option in the /etc/raidtab
>>  file, a special superblock is written in the beginning of all disks
>>  participating in the array. This allows the kernel to read the
>>  configuration of RAID devices directly from the disks involved,
>>  instead of reading from some configuration file that may not be
>>  available at all times.
>>
>>  You should however still maintain a consistent /etc/raidtab file,
>>  since you may need this file for later reconstruction of the array.
>>
>>  The persistent superblock is mandatory if you want auto-detection of
>>  your RAID devices upon system boot. This is described in the
>>  Autodetection section.

Cheers,
	Werner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-15  8:56 ` Heinz J . Mauelshagen
  2001-08-15 13:13   ` Jason Tackaberry
@ 2001-08-15 21:30   ` Luca Berra
  2001-08-17  9:21     ` Heinz J . Mauelshagen
  1 sibling, 1 reply; 8+ messages in thread
From: Luca Berra @ 2001-08-15 21:30 UTC (permalink / raw)
  To: linux-lvm

On Wed, Aug 15, 2001 at 10:56:23AM +0200, Heinz J . Mauelshagen wrote:
> On Tue, Aug 14, 2001 at 05:11:59PM -0400, Jason Tackaberry wrote:
> > I know this isn't strictly an LVM question, but ...
> > 
> > Suppose I have a volume group with 1 physical volume, say a 9GB disk.
> > Now, after some time, I decide I want to mirror this VG with another 9GB
> > disk.  What options do I have?  AFAICS, the only way to do this would be
> > to start from scratch?  This is a pretty simple and presumably common
> > thing to want to do, so I hope I'm wrong.  :)
> 
> Yes, you are (with 2.4 kernels) ;-)
> 
> You could either mirror the whole disk using MD *without* persistent superblocks
> 
raid superblock is at end of disk, so you could also
create an lv with only the last PE of the PV and NEVER USE it

L.

-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-15 21:30   ` Luca Berra
@ 2001-08-17  9:21     ` Heinz J . Mauelshagen
  0 siblings, 0 replies; 8+ messages in thread
From: Heinz J . Mauelshagen @ 2001-08-17  9:21 UTC (permalink / raw)
  To: linux-lvm

On Wed, Aug 15, 2001 at 11:30:04PM +0200, Luca Berra wrote:
> On Wed, Aug 15, 2001 at 10:56:23AM +0200, Heinz J . Mauelshagen wrote:
> > On Tue, Aug 14, 2001 at 05:11:59PM -0400, Jason Tackaberry wrote:
> > > I know this isn't strictly an LVM question, but ...
> > > 
> > > Suppose I have a volume group with 1 physical volume, say a 9GB disk.
> > > Now, after some time, I decide I want to mirror this VG with another 9GB
> > > disk.  What options do I have?  AFAICS, the only way to do this would be
> > > to start from scratch?  This is a pretty simple and presumably common
> > > thing to want to do, so I hope I'm wrong.  :)
> > 
> > Yes, you are (with 2.4 kernels) ;-)
> > 
> > You could either mirror the whole disk using MD *without* persistent superblocks
> > 
> raid superblock is at end of disk, so you could also
> create an lv with only the last PE of the PV and NEVER USE it

Luca,

that's hard to achive in most production situations.
If you allocate that last PE to and LV you potentially won't recognize it
and tamper over the MD superblock later.


> 
> L.
> 
> -- 
> Luca Berra -- bluca@comedia.it
>         Communication Media & Services S.r.l.
>  /"\
>  \ /     ASCII RIBBON CAMPAIGN
>   X        AGAINST HTML MAIL
>  / \
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

-- 

Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
Mauelshagen@Sistina.com                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-14 21:11 [linux-lvm] Adding a mirror after-the-fact Jason Tackaberry
  2001-08-15  8:56 ` Heinz J . Mauelshagen
@ 2001-08-19 19:20 ` Wolfgang Weisselberg
  2001-08-20  2:49 ` Ted Deppner
  2 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Weisselberg @ 2001-08-19 19:20 UTC (permalink / raw)
  To: linux-lvm

Hi, Jason!

Jason Tackaberry (tack@linux.com) wrote 16 lines:

> Suppose I have a volume group with 1 physical volume, say a 9GB disk.
> Now, after some time, I decide I want to mirror this VG with another 9GB
> disk.  What options do I have?  AFAICS, the only way to do this would be

How about: 
- Get RAID HW controller
- put in a test disk with some unimportant data on it
- run RAID in degraded mode
- add second disk
- have RAID rebuild itself (like after an actual disk
  failure)

If that works. simply do it 'real', otherwise you might need
to copy the data onto the 'degraded mode' disk.

You could do the same with a Software raid, but then I'd
run it in RAID1 with 1 disk, add that mdX to my LVM, pvmove
everything off the other PV onto the mdX PV, remove the PV,
add the second Disk, auto-rebuild.

(I read about that trick in some time ago in an Linux Soft-RAID
HOWTO, about "moving from 2-Disk RAID1 to 3-Disk RAID5 with
only 3 Disks".)

-Wolfgang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-lvm] Adding a mirror after-the-fact
  2001-08-14 21:11 [linux-lvm] Adding a mirror after-the-fact Jason Tackaberry
  2001-08-15  8:56 ` Heinz J . Mauelshagen
  2001-08-19 19:20 ` Wolfgang Weisselberg
@ 2001-08-20  2:49 ` Ted Deppner
  2 siblings, 0 replies; 8+ messages in thread
From: Ted Deppner @ 2001-08-20  2:49 UTC (permalink / raw)
  To: linux-lvm

On Tue, Aug 14, 2001 at 05:11:59PM -0400, Jason Tackaberry wrote:
> I know this isn't strictly an LVM question, but ...
> 
> Suppose I have a volume group with 1 physical volume, say a 9GB disk.
> Now, after some time, I decide I want to mirror this VG with another 9GB
> disk.  What options do I have?  AFAICS, the only way to do this would be
> to start from scratch?  This is a pretty simple and presumably common
> thing to want to do, so I hope I'm wrong.  :)

I've done this using RAID only on ext2fs partitions, no LVM...  it's not
too tough.  I recommend *using* persistent superblocks (they come in handy
sometimes), though it's a little fun to add them to a live file system.

Fact 1:  with or without persistent superblocks, adding raid to a device
doesn't change the initial offset (ie the underlying filesystem begins at
the 0th block regardless of raid or non raid).

Fact 2:  persistent superblock adds a superblock at the end of the device,
of variying size (not sure why).

You can "ext2resize /dev/blah numblocks" where numblocks is the size of
the device minus 5 to 50mb (enough for the superblock, yes it's overkill).  
Once you mkraid on the device, just "ext2resize /dev/blah" to get back
whatever space you over-reserved.  

If you *KNOW* the filesystem isn't using blocks near the end of the
device, you can skip the initial resize, do the mkraid, and "e2fsck
/dev/blah" (read off the actual block size, then abort the e2fsck) and
"ext2resize /dev/blah newnumblocks" 


If you're not using ext2, then do some tests with your filesystems resize
utility to make sure it's bulletproof and go at it.  reiserfs_resize was
buggy in this regard a few months ago when I was testing it...  I've
not tested recently, so maybe it's been fixed.  (it grows just fine, but
introduces errors when shrinking).

And finally, since this is a LVM list, I've no idea what changing device
layers under LVM will do... I know the raid won't do anything but clip
some blocks off the end of the device, but I don't know LVM's handling or
block resize options.

-- 
Ted Deppner
http://www.psyber.com/~ted/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-08-20  2:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-14 21:11 [linux-lvm] Adding a mirror after-the-fact Jason Tackaberry
2001-08-15  8:56 ` Heinz J . Mauelshagen
2001-08-15 13:13   ` Jason Tackaberry
2001-08-15 13:33     ` Werner John
2001-08-15 21:30   ` Luca Berra
2001-08-17  9:21     ` Heinz J . Mauelshagen
2001-08-19 19:20 ` Wolfgang Weisselberg
2001-08-20  2:49 ` Ted Deppner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.