1836614 Members
1763 Online
110102 Solutions
New Discussion

Re: filesystem moves

 
SOLVED
Go to solution
Adam Winebaugh
Regular Advisor

filesystem moves

I have a filesystem /var/adm/sw, that is on vg02 and I need to move it to vg01. What would be the best practice for this? I am running onlinejfs. Should I mirror the lvol then lvremove the original or..................................???? Please advise.
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: filesystem moves

Hi Adam:

Mirroring occurs at the logical volume level and since a logical volume belongs to a volume group, you can't move a filesystem between volume groups with MirrorDisk/UX.

That said, I'd use 'fbackup'/'frecover':

# cd srcdir && fbackup -i . -f - | ( cd dstdir && frecover -Xsrf - )

An advantage to using 'fbackup' and 'frecover' is that it handles largefiles and can keep sparse files sparse.

Regards!

...JRF...
Tim Nelson
Honored Contributor

Re: filesystem moves

You could get trickly with some forced commands but the risk is greater.

The most direct and safest approach.

create new lvol in vg01
copy all data from /var/adm/sw to new lvol
unmount /var/adm/sw
mount new lvol in its place.

Adam Winebaugh
Regular Advisor

Re: filesystem moves

I am not overly familiar with fbackup'/'frecover':

Would there be any effect to the filesystem? Downtime? Would my users notice anything.

Mel Burslan
Honored Contributor

Re: filesystem moves

my choice of commands here are vxdump/vxrestore pair.

usage is:

cd /destination_filesystem
vxdump 0f - /source_filesystem | vxrestore xf -

hope this helps.
________________________________
UNIX because I majored in cryptology...
James R. Ferguson
Acclaimed Contributor
Solution

Re: filesystem moves

Hi (again) Adam:

> I am not overly familiar with fbackup'/'frecover': Would there be any effect to the filesystem? Downtime? Would my users notice anything.

Based uoon the fact that you said the filesystem is '/var/adm/sw' it will be static as long as you are not actively patching (running 'swinstall' or 'swremove').

Hence, it will be perfectly acceptable to copy this without any downtime other than unmounting the the source and destination filesystems when done with your copy to change the '/etc/fstab' to reflect mountpoints.

Yet another advantage to 'fbackup' is that it will automatically retry the copy of files that change during the time they are begin copied. This isn't going to be the case, but it is worth noting.

Regards!

...JRF...
Tim Nelson
Honored Contributor

Re: filesystem moves

And other simple options

cp -rp
find | cpio


MarkSyder
Honored Contributor

Re: filesystem moves

I have successfully done the very same thing thus:

Create a new filesystem on vg01. Call it (for example) /var/adm/sw.new

cd /var/adm/sw
find . â xdev â depth â print|cpio â pmd /new_filesystem
cd /etc
cp -p fstab fstab.safe
vi fstab

Swap the new filesystem with /var/adm/sw

You will need to reboot for the change to take effect. Make sure files are being updated in the new /var/adm/sw before you delete the old one.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Steven Schweda
Honored Contributor

Re: filesystem moves

> cp -rp

For a possible reason not to use "cp -r", see

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1203742

(But I've given up hoping that people will
stop suggesting it.)
Adam Winebaugh
Regular Advisor

Re: filesystem moves

Thanks everyone, I did it marcs way and it worked great. Thanks again.