Operating System - HP-UX
1829700 Members
2002 Online
109992 Solutions
New Discussion

migrate /var to a smaller filesystem

 
SOLVED
Go to solution
kholikt
Super Advisor

migrate /var to a smaller filesystem

As the /var was created so big and I do not have onlineJFS. I was thinking of migrating the /var filesystem to a smaller size. I have another LV as named is as lvolvar and mount under /vartmp.

What is the best way to copy everything from /var filesystem over to /vartmp filesystem and ensure that permission and modification date should be the same.
abc
7 REPLIES 7
Franky_1
Respected Contributor

Re: migrate /var to a smaller filesystem

Hi Kholikt,

you can use the following command :

cd /var
tar cfv - .|(cd /vartmp; tar xfv -)
Under user "root" the date and permissions are kept the same

HTH

Franky
Don't worry be happy
Michael Tully
Honored Contributor
Solution

Re: migrate /var to a smaller filesystem

Whatever way you choose to do it, you'll have to reboot your server in any case. Have new lv mounted.

cd /var
find . | cpio -pdumv /newdir

Reboot the system after changing the /etc/fstab file.
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: migrate /var to a smaller filesystem

Whatever way you choose to do it, you'll have to reboot your server in any case. Have new lv mounted.

cd /var
find . | cpio -pdumv /newdir

Reboot the system after changing the /etc/fstab file to reflect new lv to mount as /var
Anyone for a Mutiny ?
florence mathon lermusi
Trusted Contributor

Re: migrate /var to a smaller filesystem

i will add that it's better to do it in a single user mode or in a maintenance level mode...
Michael Tully
Honored Contributor

Re: migrate /var to a smaller filesystem

Just as a caveat why would you want to reduce the size of /var anyway?

How big is it now?

Remember that /var is used for a number of things, like storing superceded patches, and of course by default your crash dump area. Please consider these points before doing anything.
Anyone for a Mutiny ?
florence mathon lermusi
Trusted Contributor

Re: migrate /var to a smaller filesystem

don't forge also that /var must have contiguous extents...
MarkSyder
Honored Contributor

Re: migrate /var to a smaller filesystem

Another word of caution:

Unless your system only has one disc, it is recommended to leave vg00 solely for operating system stuff.

I would not even contemplate reducing /var unless you need to free disc space for another operating system filesystem.

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