From: Florian Philipp <lists@binarywings.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] How to change from one harddrive to software raid
Date: Wed, 30 Mar 2011 07:28:40 +0200 [thread overview]
Message-ID: <4D92BF88.6000807@binarywings.net> (raw)
In-Reply-To: <AANLkTikSX_a-SdebxacmEdEv=JVH6w3Cv8Grtpf4w_Nn@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
Am 30.03.2011 05:02, schrieb Einux:
> Hi,
>
> I bought a new 1T harddrive which is exactly the same as my previous
> harddrive. So I'm planning to make a Raid-1 layout(for security
> reasons). But here's the problem: I've already setup LVM2 on the
> existing harddrive and I don't want to destroy the existing LVM volume
> groups. I tried to google it, but I'm not sure which is the right keyword.
> Could you guys help me out?
>
> Thanks in advance:)
>
> --
> Best Regards,
> Einux
>
1. Create a degenerated RAID1 with your new disk
mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb
2. Partition the raid device
3. Add one of the partitions to your LVM volume group.
pvcreate /dev/sdb2
vgextend volume_group /dev/sdb2
4. Move everything from the old physical volumes to the new pv.
pvmove /dev/sda3 /dev/sdb2
5. Remove the old and now empty physical volume
vgreduce volume_group /dev/sda3
6. Move everything else which is not on LVM to your new raid. Guess you
need to go to single user mode to do this safely.
7. Grow your raid to also contain the old disk.
mdadm /dev/md0 -a /dev/sda
No, I have not tested this and you should double-check everything. No
guarantees, etc.
One warning, though: pvmove is known to create problems from time to
time. Leaking memory, bogging systems with infinite system load and so
on. If it gives you trouble, you can abort it with `pvmove --abort` and
try it again later by calling `pvmove volume_group` (without physical
device specified) to resume it. It SHOULD survive system crashes.
Trying another kernel version sometimes helps when pvmove gives you trouble.
Hope this helps,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next parent reply other threads:[~2011-03-30 6:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTikSX_a-SdebxacmEdEv=JVH6w3Cv8Grtpf4w_Nn@mail.gmail.com>
2011-03-30 5:28 ` Florian Philipp [this message]
2011-03-30 5:50 ` [gentoo-user] How to change from one harddrive to software raid Florian Philipp
2011-03-30 7:31 ` Joost Roeleveld
2011-03-31 1:21 ` Einux
2011-04-04 0:18 ` Mark Shields
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=4D92BF88.6000807@binarywings.net \
--to=lists@binarywings.net \
--cc=gentoo-user@lists.gentoo.org \
/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