Linux LVM users
 help / color / mirror / Atom feed
From: Michel Dagenais <michel.dagenais@polymtl.ca>
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] [PATCH] writeable snapshots -> Sample useful app
Date: Mon Nov 19 17:22:02 2001	[thread overview]
Message-ID: <m2y9l28hl3.fsf@m3.polymtl.ca> (raw)
In-Reply-To: Anselm Kruis's message of "Mon, 19 Nov 2001 20:07:05 +0100 (CET)"

Writable snapshots are very versatile and may be used for several
interesting applications. IMHO they should be included in LVM!

One such application is to clone a machine, for instance when adding
a new machine to a server pool. You may want an almost identical
machine except for a few config files. Of course you can export the
server disk, make a local copy on the new machine, and then change a
few config files. Copying a couple of Gig, however, takes time.
Here is another way:

# Create a logical volume

pvcreate /dev/hda1
vgcreate vg1 /dev/hda1
lvcreate -L 4G -n vol1 /dev/vg1

# This volume will be declared disk 0 of a RAID 1 setup, with disk1
# non-existant being declared faulty. The server root would be
# installed on that disk.

mkraid /dev/md0
mke2fs -b 4096 /dev/md0

# A writable snapshot is created such that the server is decoupled from
# the snapshot which will be used for clones

lvcreate -s -n vol1-snap1 -L 200M /dev/vg1
lvchange -p rw /dev/vg1/vol1-snap1

# Device /dev/vg1/vol1-snap1 is then exported using "network block device"
#
# When one needs a new computer installed, a boot disk with initial 
# ram disk initializes /dev/hda1 as failed disk1 of a RAID 1 setup. 
# The disk0 is the snapshot accessed by "network block device".

mkraid /dev/md0

# The local disk is brought back into the array

raidhotadd /dev/md0 /dev/hda1

# The snapshot is copied to the local disk while the cloned computer is
# immediately usable. Once the RAID synchronisation is finished, the
# snapshot used as network block device may be declared faulty and
# released.

I have actually tried it for a non root partition and it works fine!

  reply	other threads:[~2001-11-19 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-19 13:05 [linux-lvm] [PATCH] writeable snapshots Anselm Kruis
2001-11-19 17:22 ` Michel Dagenais [this message]
2002-01-01 15:22 ` Anselm Kruis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y9l28hl3.fsf@m3.polymtl.ca \
    --to=michel.dagenais@polymtl.ca \
    --cc=linux-lvm@sistina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox