Re: move logical volume and file system to different vg

From: Leyden, Joseph (LeydenJ@MTA.NET)
Date: Wed Apr 30 2003 - 17:16:39 EDT


Moving a JFS FIle to a New Volume Group

1. backup data you intend to migrate
2. unmount fs where lv resides
3. copy the source logical volume to the desired volume group with the cplv
command.
    For example, where myvg is the NEW volume group and mylv is the name of
the user's
    logical volume, enter:

    cplv -v myvg mylv

4. All JFS require a log device. If JFS log does not already exists on the
new volume group,

   mklv -t jfslog myvg 1

   This will return a new jfslog such as loglv00. This will need to be
reformatted with the
   logform command to function as a JFS log.

   logform /dev/loglv00

5. Change the filesystem to reference a log device that exists in the new vg
and the new
    logical volume with the chfs command.

    For example where myfilesystem is the name of the user's filesystem,
enter:

    chfs -a dev=/dev/lv00 -a log=/dev/loglv00 /myfilesystem

6. RUn fsck to ensure filesystem integrity,

    fsck -p /dev/lv00

7. Mount the file system. For example, where myfilesystem is the name of the
user's
    file system, enter:

    mount /myfilesystem

   At this point the migration is complete and any applications or users can
now access the
   data in this filesystem. To change the logical volume name, proceed to
step 8. Note: If
   you receive errors from the preceding step do not continue, contact AIX
support center.

8. Remove the source logical volume with the rmlv command:

    rmlv mylv

9. Rename and reset any needed attributes on the new logical volume with the
    chlv or chmod commands.

    For example, where mylv is the name of the user's logical volume, enter:

   chlv -n mylv lv00
-------------------------------------------------------------

Joe Leyden

-----Original Message-----
From: Green, Simon [mailto:Simon.Green@EU.ALTRIA.COM]
Sent: Wednesday, April 30, 2003 9:36 AM
To: aix-l@Princeton.EDU
Subject: Re: move logical volume and file system to different vg

Sorry: I obviously wasn't clear. They were intended as three completely
independent alternatives, not three related steps.

Simon Green
Altria ITSC Europe s.a.r.l.

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will not be appreciated.

> -----Original Message-----
> From: Page, Jennifer [mailto:Jennifer.Page@RBCDAIN.COM]
> Sent: 30 April 2003 14:55
> To: aix-l@Princeton.EDU
> Subject: Re: move logical volume and file system to different vg
>
>
> Not sure you need to do step #3.
>
> We were able to copy all of our data from one VG to another using the
> following:
>
> mklv -y N_[OLD_LV] [NEW_VG] [#PP]
> chlv -t copy N_[OLD_VG]
> cplv -e N_[OLD_LV] -f [OLD_LV]
> chlv -n O_[OLD_LV] [OLD_LV]
> chlv -n [OLD_LV] N_[OLD_LV]
> *chown root.system /dev/*[OLD_LV]
> chfs -a dev=/dev/[OLD_LV] [MOUNT POINT]
> chfs -a log=/dev/[NEW_VG_LOG] [MOUNT POINT]
>
> *(may not need this step, we had some raw lvs that did)
>
>
> -----Original Message-----
> From: Green, Simon [mailto:Simon.Green@EU.ALTRIA.COM]
> Sent: Wednesday, April 30, 2003 3:55 AM
> To: aix-l@Princeton.EDU
> Subject: Re: move logical volume and file system to different vg
>
>
> There's no very easy way to do this. (Not a simple, one-command way,
> anyway.)
>
> Essentially, you have to copy all of the data from the current
> filesystem to a new one. There are several ways of doing this. Which
> you choose will depend on your environment.
>
> 1. Back up; delete and re-create the filesystem in the new location;
> restore.
>
> 2. Use cplv, then chfs to point to the new LV.
>
> 3. Create a new filesystem; copy from the old to the new (e.g. cpio);
> rename the filesystems.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:47 EDT