Operating System - HP-UX
1753767 Members
5521 Online
108799 Solutions
New Discussion юеВ

to put together filesystems to one filesystem

 

to put together filesystems to one filesystem

I want to put together some filesystems to one filesystem. The filesystems are in different volume groupes. I use LVM. Can you advice me some elegant solution? Thanks.
xx
7 REPLIES 7
Elmar P. Kolkman
Honored Contributor

Re: to put together filesystems to one filesystem

It totally depends...

Do you need to expand the filesystem or can you just move the data?
Are the disks used for the lvol you want to destroy solely used for that lvol so you could move them to the lvol you want to expand?
Are you using mirroring?

For instance, you could temporarily use mirror disks to expand your lvol and filesystem, move the data, destroy the other lvol, move the disks to the right volumegroup, add mirroring again.
Every problem has at least one solution. Only some solutions are harder to find.
G. Vrijhoeven
Honored Contributor

Re: to put together filesystems to one filesystem

Hi,

Are you able to stop the software running in those file systems? if so:

Create one large lvol and copy all the data to this new lvol. e.g.

# cd fromdir ; tar cvf - . |( cd todir; tar xf - )
# umount fromdir
# mv todir fromdir

Gideon
Sunil Sharma_1
Honored Contributor

Re: to put together filesystems to one filesystem

Hi,

There is no LVM command using that you can add file system.

You have to do it manually like,
1. Create a big FS
2. MV the content of other FS to this .

Regards
Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Mister_Z
Frequent Advisor

Re: to put together filesystems to one filesystem

1. Calculate the space the fs to merge occupy. i.e,:
#du -ks
provides the size in Kb for the fs mounted on

2. Create an lvol whose size it's, at least, the sum of the spaces of 1.
#lvcreate -L -n lvmerge /dev/vgXX

3. Create the target fs and its mount point:
#newfs -F vxfs /dev/vgXX/rlvmerge
#mkdir /mntlm
#mount /dev/vgXX/lvmerge /mntlm

4. Copy the contents of the source fs to the target one, ie:
#find -print | cpio -dumpxlv /mntlm
...
#find -print | cpio -dumpxlv /mntlm

Hope this helps.
I work for HP

Re: to put together filesystems to one filesystem

Thank for your answer, but it is not answer for my question. I have 5 filesystems, 5 logical volumes at 3 volume groups. And I want put together these filesystems to one filesystem. for example
these logical volumes are mounted now:
/dev/vg02/lvol2 /cat
/dev/vg02/lvol3 /pork
/dev/vg03/lvol3 /dog
/dev/vg00/lvol11 /sheep
/dev/vg03/lvol7 /bird
I want to mount these logical volumes
to filesystm /cat_pork_dog_sheep_bird

I do not want to expand, i do not want to create new filesystem and move filesystems to new filesystem. Is it possible to put together logical volumes in differrent volume groups or create filesystems with more logical volumes or mount more logical volumes to one filesystems?
mount /dev/vg02/lvol2 /dev/vg02/lvol3 /cat_pork?
Tanks.
xx
Mister_Z
Frequent Advisor

Re: to put together filesystems to one filesystem

I think the solution you're suggesting is not feasible. The only solution possible is by creating a larger file system that encloses the source filse systems.

Regards
I work for HP
Robert-Jan Goossens
Honored Contributor

Re: to put together filesystems to one filesystem

Hi Dagmar,

Simple answer no.

You have to create one large filesystem or expand a filesystem and copy all your animal directories into the one filesystem.

Regards,
Robert-Jan