Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

move a lv / fs to another vg

411 views
Skip to first unread message

Bert Moos

unread,
Apr 2, 2004, 4:59:00 AM4/2/04
to
dear aix gurus
within an existing vg (uservg1) i have a lv (/dev/lv01) which contains only
one filesystem (/data/app/zone1). i'd like to move this lv (/dev/lv01) with
it's filesystem (/data/app/zone1) to a new vg (uservg2). this new vg already
exists and is empty. how can i move the lv with the filesystems and its data
to the new vg.

thanx alot
bert


Andreas Schulze

unread,
Apr 2, 2004, 5:54:50 AM4/2/04
to
"Bert Moos" <bert...@hotmail.com> schrieb im Newsbeitrag
news:c4jdko$6i5$1...@atlas.ip-plus.net...
Hallo bert,

man migratepv
# migratepv -l <logical_volume> <sourcedisk_uservg1> <targetdisk_uservg2>

HTH,
Andreas


Dale Talcott

unread,
Apr 2, 2004, 9:16:51 AM4/2/04
to
"Bert Moos" <bert...@hotmail.com> writes:

>within an existing vg (uservg1) i have a lv (/dev/lv01) which contains only
>one filesystem (/data/app/zone1). i'd like to move this lv (/dev/lv01) with

>its filesystem (/data/app/zone1) to a new vg (uservg2). this new vg already


>exists and is empty. how can i move the lv with the filesystems and its data
>to the new vg.

You can unmount the file system, use cplv to copy its logical volume (lv01)
to a new LV inside uservg2, edit /etc/filesystems to refer to the new
LV, and remount the file system.

Double check with the man pages, but I think the steps would be:

umount /data/app/zone1
cplv -v uservg2 -y newlv01 lv01
vi /etc/filesystems # change /dev/lv01 to /dev/newlv01

There is no jfslog for the new copy of the file system. So, you need
to create a jfslog LV within uservg2. The poweruser way is to run mklv
and logform. But, I'm lazy, so I usually just use smit to create a
dummy file system in the new VG and let smit create the jfslog LV for
me (smitty crfs). Then, use lsvg -l uservg2 to see what name was given
to the jfslog (probably something like loglv01).

Now, change the file system to use that new log.

chfs -a log=/dev/loglv01 # whichever jfslog is in uservg2
mount /data/app/zone1

Once you are sure the new copy is okay, remove the old LV.

rmlv lv01

If you used smit to create a dummy file system, you can also remove
the dummy FS now (smitty rmfs).


Also, a tiny wording change. You say "i have a lv (/dev/lv01) which
contains only one filesystem (/data/app/zone1)". An LV can be used
either to hold a file system or not. You cannot hold multiple FSs within
a single LV. So, the "only one" part in the quote should be just "a".

--
Dale Talcott, IT Research Computing Services, Purdue University
a...@quest.cc.purdue.edu http://quest.cc.purdue.edu/~aeh/

Greg

unread,
Apr 2, 2004, 9:04:58 PM4/2/04
to
Andreas Schulze wrote:

>Hallo bert,
>
>man migratepv
># migratepv -l <logical_volume> <sourcedisk_uservg1> <targetdisk_uservg2>
>
>HTH,
>Andreas
>
>

You might try that for yourself. migratepv only moves PP's around
inside the same volume group...

Greg.

Andreas Schulze

unread,
Apr 4, 2004, 1:52:01 PM4/4/04
to

"Greg" <n...@spam.com> schrieb im Newsbeitrag
news:eZobc.8829$jVF....@news04.bloor.is.net.cable.rogers.com...

>
> >
> You might try that for yourself. migratepv only moves PP's around
> inside the same volume group...
>
> Greg.

Hallo Greg,

you are right - and I overestimated what LVM can do :-(. Bert, sorry for
leading you onto a wrong track I was focused on moving the partitions
between disks with the most simple solution. Rethinking about what you
actually want to do I shall offer a different approach for least effort:
Create an adequate filesystem in the uservg2 (with another name zone2) and
link it to /data/app/. By creating the filesystems this way you don't need
to worry about jfslog or the like. The commands to create a filesystem will
create the underlying lv too and this should be ok as long as you a) don't
care about the lv's name and b) where the lv is placed on the disk. If you
want to assign a certain name and/or place on the disk to the lv you need to
create the lv before the fs.
Secondly copy the files from the zone1 fs to the zone2 fs (type command in
/data/app/zone1 directory):
# tar -cf - * | cd /data/app/zone2 ; tar -xvpf -)
Thirdly check whether all files where copied to the zone2 dir, then remove
source dir (or rename it) to free the zone1 name. Rename zone2 dir into
zone1 dir with chfs command. Unmount and mount renamed fs again. Now you
should be done.

HTH,
Andreas

Andy

unread,
Apr 5, 2004, 7:59:13 AM4/5/04
to
a...@quest.cc.purdue.edu (Dale Talcott) wrote in message news:<aeh.108...@quest.cc.purdue.edu>...

> "Bert Moos" <bert...@hotmail.com> writes:
>
> >within an existing vg (uservg1) i have a lv (/dev/lv01) which contains only
> >one filesystem (/data/app/zone1). i'd like to move this lv (/dev/lv01) with
> >its filesystem (/data/app/zone1) to a new vg (uservg2). this new vg already
> >exists and is empty. how can i move the lv with the filesystems and its data
> >to the new vg.
>
> You can unmount the file system, use cplv to copy its logical volume (lv01)
> to a new LV inside uservg2, edit /etc/filesystems to refer to the new
> LV, and remount the file system.
>
> Double check with the man pages, but I think the steps would be:
>
> umount /data/app/zone1
> cplv -v uservg2 -y newlv01 lv01
> vi /etc/filesystems # change /dev/lv01 to /dev/newlv01


after cplv I would suggest run following command (instead modifying
/etc/filesystems):

chfs -a dev=/dev/newlv01 -a log=/dev/"jfslogonnewvg" /data/app/zone1

(VGDAs and ODM will be then updated)


reg.

0 new messages