Linux LVM users
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <breeves@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Replace lvm-disk without being able to connect two disks at the same time
Date: Tue, 08 Jul 2008 12:59:49 +0100	[thread overview]
Message-ID: <487356B5.1070904@redhat.com> (raw)
In-Reply-To: <1215391635.29815.28.camel@localhost.localdomain>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eckhard Kosin wrote:
> Hi all,
> 
> on my laptop I have to replace the disk.  The filesystem is on lvm2.
> The old disk has 40GB, the new one 250GB.  Of course on the new disk vg
> and lv sizes will differ from the old one.  With the laptop there is no
> possibility to plug in the old and the new disk at the same time.

If you really want both disks attached just pick up a cheap USB-ATA
enclosure - you can pick them up for just a few dollars now.

> So my plan is as follows:
> 
>       * Backup all data.
>       * Remove old disk and plugin new disk.
>       * Create vgs  and lvs on the new disk as desired.
>       * Restore all data.

Personally I would just backup my data (i.e. /home) from the system and
then re-install to the new disk & restore the data.

> However I suspect that in the last step the new lvm-metadata will be
> overwritten by the metadata of the old disk.  Which files I have to
> exclude from the restore to do not touch the new metadata?

LVM2 metadata isn't stored in a file (well, only for backup/archival
purposes). It's stored directly in an area that's normally at the start
of the PV (between the label and the beginning of the physical extents).

> Or is there a better strategy to replace a lvm-disk without the
> possibility to connect the new disk and the old disk at the same time to
> the box?

Unless you really want to swap the disks out while maintaining the same
VG (vgextend with the new disk, pvmove, vgreduce to remove the old disk)
there's nothing wrong with this approach. Whichever way you do it you'll
need to be careful to create a working boot configuration on the new
drive. I.e. separate /boot partition, grub/lilo install/configuration etc.

Regards,
Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkhzVrUACgkQ6YSQoMYUY95pDACgjz843HaAthmz4iDEpdN4cGD2
UZkAn38brcPbiI8voNSpBttMKjOrZ3du
=yIh0
-----END PGP SIGNATURE-----

      reply	other threads:[~2008-07-08 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07  0:47 [linux-lvm] Replace lvm-disk without being able to connect two disks at the same time Eckhard Kosin
2008-07-08 11:59 ` Bryn M. Reeves [this message]

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=487356B5.1070904@redhat.com \
    --to=breeves@redhat.com \
    --cc=linux-lvm@redhat.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