Re: move a lv / fs to another vg

From: Dale Talcott (aeh_at_quest.cc.purdue.edu)
Date: 04/02/04


Date: 2 Apr 04 09:16:51 EST


"Bert Moos" <bert.moos@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
aeh@quest.cc.purdue.edu         http://quest.cc.purdue.edu/~aeh/


Relevant Pages

  • Re: mkfs or crfs
    ... How can I resolve the jfslog problem then? ... IBM recommends 2MB of jfslog for each 2GB of filesystem, ... And what is the practical maximum jfs file system on AIX 4.3. ...
    (AIX-L)
  • Re: Sizing JFSLog
    ... If your filesystems are fairly static, then a single JFSlog will suffice. ... If you have high amounts of I/O to filesystems, then more may be in order. ... The system error log will tell you if there are JFSlog shortcomings. ... We were told 4 mb for each 2 gig of file system space. ...
    (AIX-L)
  • Re: chlv man page question
    ... > If you change the name of the logical volume that contains a file system, ... But that's not what the chfs example in the man page is doing ... ... changing the jfslog volume for the jfs volume whose name has been changed. ... You would only have to do that if you changed the name of the jfslog volume, ...
    (comp.unix.aix)
  • migrating a jfslog
    ... I want to migrate a jfslog from one disk to another (both in the same ... It looks like I can do this with the file system mounted and ... Jim ...
    (comp.unix.aix)
  • Re: [UNIONFS] 00/42 Unionfs and related patches review
    ... data changes will happen on a lower inode all within one second and not be ... lowerfilesystems are able to be local filesystems. ... saves on inodes and pages by having BOTH the upper and lower dentry point to ... dentry of the upper file system now points to an inode ...
    (Linux-Kernel)