System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Move Filesystem the VGx to VGy

SOLVED
Go to solution
Eli Daniel
Super Advisor

Move Filesystem the VGx to VGy

good morning, I need your help

there is a filesystem

/ usr / sap / audit
LV: / dev/vgECCprodr5/lvsapaudit

must move to another VG
New VG: / dev / VGaudit / lvsapaudit

as I do? what are the commands to be executed?
12 REPLIES
Patrick Wallek
Honored Contributor

Re: Move Filesystem the VGx to VGy

There's no easy way to move a LV between VGs other than to copy the data from one to the other.
Eli Daniel
Super Advisor

Re: Move Filesystem the VGx to VGy

no need to move the LV, only the FileSystem

/usr/sap/audit
James R. Ferguson
Acclaimed Contributor

Re: Move Filesystem the VGx to VGy

Hi:

You need to create your new filesystem within your new logical volume within your new volume group.

Then, mount the new (empty) filesystem and do:

# cd /srcdir && pax -r -w -pe . /dstdir

...where '/srcdir' is your old filesystem ('lvsapaudit') and '/dstdir' is your new one ('newlvsapaudit'). You could do this when the filesystems are not in use.

When you are done and satisfied, rename your new filesystem to be the old name and edit your 'etc/fstab'.

Regards!

...JRF...
Eli Daniel
Super Advisor

Re: Move Filesystem the VGx to VGy

In this case is to move the filesystem. create new VG. It creates new LV and moves filesystem / usr / sap / audit
Johnson Punniyalingam
Honored Contributor

Re: Move Filesystem the VGx to VGy

>>>In this case is to move the filesystem. create new VG. It creates new LV and moves filesystem / usr / sap / audit<<

Yes, As mentioned by >>JRF

pvcreate /dev/rdsk/cxtxdx
mkdir /dev/VGaudit
mknod /dev/VGaudit/group c 64 0xMM0000
where MM is a unique identifier (ex 01 for vg01)
vgcreate -s 32 -n /dev/VGaudit (man vgcreate)
lvcreate -L /dev/VGaudit/lvsapaudit
newfs -F vxfs -o largefiles /newfs -F vxfs -o largefiles /dev/VGaudit/rlvsapaudit
add entry in the /etc/fstab for new created file system
mount new file system

than,you use method suggested by >JRF

or

Example :-
# export PATH=$PATH:/usr/sbin
# cd /var/opt/omni; fbackup -f - -i . | (cd /var/opt/omni2; frecover -f - -r)

important . pls perform all steps while taking downtime from "Sap Application"
Problems are common to all, but attitude makes the difference
Patrick Wallek
Honored Contributor

Re: Move Filesystem the VGx to VGy

The issue is that the filesystem is contained within the LV.

There is no way to move the filesystem without moving the LV. And there is no way to move an LV between VGs.

You must copy the data to the new filesystem within the new LV.
Eli Daniel
Super Advisor

Re: Move Filesystem the VGx to VGy

creating a temporary filesystem copy the old files in the file system filesystem temporarily.
I think the new vg, lv and filesystem
I copy temporary files to the new filesystem??

it works?

LV need not move the file system only moving to a new VG
Johnson Punniyalingam
Honored Contributor
Solution

Re: Move Filesystem the VGx to VGy

>>I copy temporary files to the new filesystem??<<<

Yes It would work, we can do it , hence its referring to SAP application FS, you may need help of your app's team to give hand on pointing the new file system location in app's settings. that beyond "Sys Admin" role - it's just a suggestions from my side.

>>it works?<<

Yes It works

>>>LV need not move the file system only moving to a new VG<<

yes . only trick, copy of the data from old lv to new VG.(You use HPUnix command like .tar,cpio,fbackup,pax) or Any Backup Software like (HP Data protector )backup and restore

As suggested on above posts we can't move "lv" from one (VG) another (VG-New)

man pvmove for more information
Problems are common to all, but attitude makes the difference
Raj D.
Honored Contributor

Re: Move Filesystem the VGx to VGy

Daniel,

>there is a filesystem
/ usr / sap / audit
LV: / dev/vgECCprodr5/lvsapaudit

must move to another VG
New VG: / dev / VGaudit / lvsapaudit



Ans:
A filesystem cannot be moved to another VG.
You have to create a new filesystem on the other VG , and copy the data.

Because the space can not be moved between VGs as they consists of different disks.

So the best way to do it,
- Check space requirement on the other VG.
- Create equal amount of filesystem with same filesystem naming like VGaudit/lvsapaudit
- newfs the lv, mount it, add in /etc/fstab if it is not under cluster.
- mount it.
- Copy the data using unix command , if you have rsync you can do it very well and it will faster and stable.
Ex: # rsync -avz /old_FS /new_fs/

- Once copy done , veryfy the size with source and you can unmount the source FS.

Cheers,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Eli Daniel
Super Advisor

Re: Move Filesystem the VGx to VGy

ok, to complete the theme

backup data old fileSystem /usr/sap/audit (tar)
umount filesystem /usr/sap/audit

create new VG, LV and Filesystem:
LV: /dev/VGaudit/lvsapaudit
FileSystem: /usr/sap/audit
copy data to new FileSystem /usr/sap/audit

this correct?





Patrick Wallek
Honored Contributor

Re: Move Filesystem the VGx to VGy

Yes, that looks good.
Eli Daniel
Super Advisor

Re: Move Filesystem the VGx to VGy

Thanks