disk space shortage, how to migrate to LVM?

Hello

I'm working on AIX 6.1. I inherited something I do not know and now I need to bring it into the line.

# df -m
Filesystem MB blocks Free %Used Mounted on
/dev/hd4 | 256.00 | 87.09 | 66% /
/dev/hd2 | 4608.00 | 82.45 | 99% /usr
/dev/hd3 | 256.00 | 212.34 | 18% /tmp
/dev/hd1 | 256.00 | 1.95 | 100% /home

[cut]
/dev/lv02 | 65024.00 | 60709.92 | 7% /home/users
/dev/lv03 | 65024.00 | 65001.13 | 1% /temp

Now you know why I'm asking of some help.
I'm running out of space on /dev/hd* :expressionless:

I have plenty of free space on other drives so I can set up few more LVMs.
Is there any easy way to migrate my files from running-short filesystems to LVMs?

I think that I should prepare lvm, copy all files from such fs and then modify /etc/filesystems to point new disk space for a mountpoint.
Am I correct?

Is there some magic command for such copying?

Do I have to reboot to check whether it works?

Best regards
michael

Hello michael,

Did you checked free space available in in the vg?

"lsvg rootvg" and check for free PPs....
If free PPs are available you can extend those Filesystems online...

VGs are OK, but regular partitions are running short.
That is the issue.

Regards
m

Afaik you always have LVM under AIX. You can easy enlarge the FS/LV with it online. It will grab space from unused PP from your VG.

Example:

chfs -a size=+100M /home        # adds 100 MB of space to the FS/LV

Mounting mountpoints into other mountpoints is not a good style. You can get trouble with mount orders etc. especially in cluster environments when you have loads of those.

I didn't think you could create filesystems directly on disks in AIX. I thought they all had to be in VGs. I'd be extemely surprised if you have an AIX 6 install with no rootvg. Run these commands to check if you do indeed have a rootvg:

lsvg rootvg
lsvg -l rootvg

I'd be interested in seeing the output.

Partitions(LV) creates under the VG. Most of time free space remains in VG after creating LVs. That you can check by command...

Check the Free PPs in the output. If the PPs are available. You can increase your LV by command..

else you can add another PV (disk) into VG by..

and than can use migratepv command. Check man page for it.

michael,

u misunderstood lvm, all file system under lvm.
lsvg rootvg will give u a brief message of free space of rootvg which all your troubled fs in.

smit fs to change the size of file system. or #chfs -a size=+10m /home to add 10m to /home. etc.

lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 0003336597305871
VG STATE: active PP SIZE: 32 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1084 (34688 megabytes)
MAX LVs: 256 FREE PPs: 264 (8448 megabytes)
LVs: 10 USED PPs: 820 (26240 megabytes)
OPEN LVs: 9 QUORUM: 1
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per PV: 1016 MAX PVs: 32

Zaxxon,

you can have other volume managers on AIX too - I have plenty of systems running Veritas Volume Manager and Veritas filesystems - and other servers out of any volume manager using ASM ...

Michal,

first of all you should determine if all filesystems you want to extend are in rootvg
# lsvg -l rootvg # shows you your filesystem
# lsvg rootvg # shows you how much space is used/free/available at all
# chfs -a size=+xG # extends your filesystem by x GB
# chfs -a size=-xG # reduces your filesystem by x GB (given using jfs2)
# extendvg rootvg hdiskx # adds a further disk to your vg in case you do not have free space - but since your filesystems appear all to be very tiny, I would not assume that you should have issues extending it anyway

no need for any reboot while working with lvm - and no need to copy anything anywhere ...

you can make more space in /usr by either committing applied packages or just doing nothing - you usually only need more space there while installing new software and with the -X flag during install the filesystem will be automatically extended anyway

you might want to have a look into this redbook since you seem to be very new on AIX anyway ?

kahoona,

why is it bad style to have mountpoints under existing mountpoints IN ROOTVG - especially when you have your homedirs in automounts its probably the best idea you can have - and when you're creating your submounts the properway /letting ODM know about - not manipulating /etc/filesystems manually - that will never be a problem when you have setup your system thoughtfully?

Kind regards
zxmaus

Ah interessting, that's new to me. Never saw an AIX box or heared of one that had anything else but AIX LVM. Is that just historical grown on your boxes or is there some special need for Veritas Volume Manager etc.?

Also for this "bad style" we refrain usually from mounting into existing mount points since we already had trouble with FS'es that have been added later, causing troubles at boot or at takeover situations in HACMP clusters.
Setting up your systems thoughtfully is one way, but there can offen be different admins on all boxes in our case so we have some simple agreements what to do or not. Just to prevent problems. No mounting into other mountpoints if possible is one of them.

zaxxon,

it was one of the glorious strategic decisions our Enterprise Architects made, to introduce SFRAC in AIX - and the early versions were only running with Veritas filesystems and Veritas Volume Manager underlying - these days we have ASM as an alternative - both is everything but nice to administer but if I have the choice between both solutions, I would still stick with the Veritas-SFRAC solution rather than ASM - disks out of any volumegroup and usage only visible to the DBAs is not what any SA likes to have - especially on Production - it happened twice that one of the SAs not knowing the systems very well, assigned the apparently unused disks forced to a Volumegroup that needed to be extended - and the warning that these disks are already in use by something else had been ignored completely - the immediate death of the ASM RAC cluster ... it ended up with recreation of the devices and restore 2 TB data from tapes ...

Regarding the mounts - we don't do that on any other filesystems than the root ones - since its not very likely that rootvg is exported at all - even we wouldn't do it in any other volumegroup but since our developers need to have the same data no matter on which system they're logged in, it is another strategic decision to have this automounted ... no choice at all ...

Kind regards
zxmaus

I can hear the sarcasm :slight_smile: Sometimes it's very tedious to get in one of those grown environments. When I started about 8,5 years ago in this company here, they had some of those too of course, like most on the world I guess, and we still could not get rid of all of those all these years later hehe.

It's not bad. I was saying that I would be surprised if his rootvg filesystems were not in a rootvg volume group. I didn't think AIX would natively let someone create filesystems directly on disks. If he's dealing with Veritas, then I have no idea.