[linux-lvm] Question on duplicating equally-sized HDs with dd and changing VG name and PV UUIDs
malahal at us.ibm.com
malahal at us.ibm.com
Mon Sep 10 17:17:09 UTC 2007
I don't think so. /dev/sdb will have the same partition table as
/dev/sda from the sfdisk command. I bet you need to run pvcreate and
vgcreate before running the rest of the script.
Thanks, Malahal.
Holger Rauch [holger.rauch at heitec.de] wrote:
> Hi Lars (and all the other list members),
>
> first of all, thanks for this nice little script (and I see nothing wrong
> with that :-))) ), but it assumes that VG backupvg and the underlying VG
> has already been created, right? I see no pvcreate and vgcreate invocations
> in there. Is this on purpose, i.e. is that already done just by duplicating
> the partition table using sfdisk?
>
> Thanks in advance for clarifying things.
>
> Kind regards,
>
> Holger
>
> On Fri, 07 Sep 2007, Lars Ellenberg wrote:
>
> > [...]
> > what is wrong with
> > sfdisk -d /dev/sda | sfdisk /dev/sdb
> > lvs -o attr,name,size --noheadings rootvg |
> > while read a n s; do
> > [[ $a == -* ]] || continue;
> > lvcreate -L $s -n $n backupvg ;
> > # dd bs=1M if=/dev/rootvg/$n of=/dev/backupvg/$n
> > done
> > ?
> > [...]
More information about the linux-lvm
mailing list