Re: move logical volume and file system to different vg

From: Leyden, Joseph (LeydenJ_at_MTA.NET)
Date: 04/30/03


Date:         Wed, 30 Apr 2003 14:16:39 -0700
To: aix-l@Princeton.EDU

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.



Relevant Pages

  • Re: mkfs or crfs
    ... Here is the link that says we should have 2 MB jfslog for each 1 GB jfs ... when I did logform to format the jfslog which is ... the filesystem that I am going to create, is used for Oracle hot backup and ... And what is the practical maximum jfs file system on AIX 4.3. ...
    (AIX-L)
  • ext3 Partition 6GB less than underlying logical volume even after resizing using resize2fs
    ... Just thinking if I should switch to JFS from ext3 since it can be ... Pass 2: Checking directory structure ... Resizing the filesystem on /dev/vg1/www to 106168320 blocks. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: JFS2 file corruption
    ... > - switch back to JFS. ... read-only with 20% or better space remaining because the filesystem is ... fragmented enough the inode table can't grow. ... Due to fragmentation, customer cannot create file on J2 ...
    (comp.unix.aix)
  • Re: too many files
    ... it does take a long time under jfs filesystems. ... Your backup command must dereference the file. ... Double that time the first time I run the command. ... backup by inode would be way faster than backup by name. ...
    (AIX-L)
  • Re: Major XFS problems...
    ... It depends on your workload but calling JFS the worst and ... >slowest filesystem ever made is unfair. ... Reiserfs so far was the ...
    (Linux-Kernel)