1834605 Members
4343 Online
110069 Solutions
New Discussion

Shinking lv's

 
Phillip Popp
Regular Advisor

Shinking lv's

Hi, New to HP unix and the LVM stuff. I am running HP 11.11 I need to shrink /usr and /var. They each are there own lv in the same vg. I need to shrink them and add the space back to the vg and then make it available to the / lv, which is also in that vg. I first tried to grow my vg by adding another pv, but I got an error that said my vg was set and could not take advantage of the added pv space. Any way to change this, as that would be the easiest way to if I could? My filesystems are vxfs. when I try to do a fsadm command it tells me I am not licensed to use it. (so this is not an option). I think I need to unmount /var and /usr first, but because I am new I am not sure if this will crash the ssytem. Also I am not sure how to use fbackup properly, can I just tar up the /var and usr directories and move them? Also, i see stuff about going into single user mode, How do I do that, if i need to?

Thanks, in advance for all your help.

Phil
13 REPLIES 13
Torsten.
Acclaimed Contributor

Re: Shinking lv's

Hi Phil!

Why do you want to increase / ???

To decrease the size of /usr and /var is not your problem.

You should place your data in other VG or at least in other LVOLS, but not in the / directly!

btw, you can't increase / "on the fly", because it must be contiguous.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Peter Godron
Honored Contributor

Re: Shinking lv's

Phil,
as a new unix person, you should NOT be messing around at this level. When the system was built, unless the defaults were changed, the partitions are sufficient for normal use. The / partition should be offlimit for any user files.
I would suggest reading more about UNIX, or getting on a course. Then use SAM initially, backed up by reviewing what SAM did in the background. If you can't use fbackup, how are you going to recover any serious fault?
There is a lot of damage that can be done with a little knowledge.
IT_2007
Honored Contributor

Re: Shinking lv's

Hi Phil,

You can't increase / , /stand and primary swap on the fly. The PEs need to be contiguous.

To decrease other filesystems, make sure that you have online JFS installed with a vaild license then you can do following steps.

1. fsadm -b 1000M /var
2. lvreduce -L 1000M /var

Otherwise bring up system in single user mode and run lvreduce -L 1000M /var and then extendfs -F vxfs /dev/vg00/lvol5 assuming /var is lvol5.
Phillip Popp
Regular Advisor

Re: Shinking lv's

Hi,
I realize I should not put the data in / however, I want to make this machine a back up to another one. That machine is such a mess, Who ever set it up put a lot of user data under / I do not want to go moving things around, as there is a lot of links and it is very easy to break something. It is a very critical machine, and I can not afford to be down. However from what you are saying, it seems I could not add another disk drive and use that space for / anyway.
Torsten.
Acclaimed Contributor

Re: Shinking lv's

Srini, please explain why this should work without data loss:

"Otherwise bring up system in single user mode and run lvreduce -L 1000M /var and then extendfs -F vxfs /dev/vg00/lvol5 assuming /var is lvol5."

1. lvreduce
2. extenfs
3. ???

Without online jfs a backup and restore is needed.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: Shinking lv's

Phil,

you could only take a ignite backup and adjust the values while restoring.

But there is no need to do this.

Let's assume your data is in

/mydata

directly in root.

Why not create another VG with a large LVOL, mount it first to /mynewdata, move your data and then mount it to /mydata again.

This will solve your problem without re-install the OS, because all of your data will still be in /mydata.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Phillip Popp
Regular Advisor

Re: Shinking lv's

Hi,
Not exactly sure what you are suggesting. I understand about making new mydata within a new vg, however, I don't understand about the remount step? Can I have two vg's mounted to the same point? Or are you suggesting I make a link from the origional mydata directory to the new mydata directory?

Thanks,

Phil
Torsten.
Acclaimed Contributor

Re: Shinking lv's

OK, I try it again.

Still assuming the data is in /mydata.

Backup all data in /mydata using tar, fbackup or whatever. Make sure your backup is working and fine. Delete /mydata. Create /mydata as your mount point and mount your /dev/my_new_vg/my_new_first_lvol_in_my_new_vg to it. Now restore the backup.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
IT_2007
Honored Contributor

Re: Shinking lv's

Torsten,

my steps work only if /var is not used more than 500MB.
IT_2007
Honored Contributor

Re: Shinking lv's

Torsten,

my steps work only if /var is not used more than 500MB. Phil wanted to free up some space on /var.
Torsten.
Acclaimed Contributor

Re: Shinking lv's

Srini, I don't understand this:

"my steps work only if /var is not used more than 500MB."

How do you prevent the data is lost in the truncated part of the lvol if there is no onlinejfs and you use lvreduce?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Marvin Strong
Honored Contributor

Re: Shinking lv's

First if you have a more senior admin at your site I would ask them for help.

As others have stated you cannot easily increase the / filesystem on a machine.

if on your source machine all the data under / is contained in a certain directory or could be copied into a certain directory on your target machine. Simply make a new filesystem on the target machine. and mount the filesystem to the directory you want.

example:
machine a
/data part of / contains all extra data needed to be on machine b
machine b
make /data its own filesystem

Phillip Popp
Regular Advisor

Re: Shinking lv's

Thanks for all the suggestions. I will either wipe everything and start over on my second machine or create new file systems under a new vg

Phil