1753524 Members
5071 Online
108795 Solutions
New Discussion юеВ

Re: expand /opt/openv

 
SOLVED
Go to solution
brian_31
Super Advisor

expand /opt/openv

We are looking to see if around 1.5 G is available for netbackup upgrade but wanted to know the options on how to do the upgrade (by creating symbolic links)how do we do this sym links and use this in case space is not available. please help. RHEL 5 env.

Thanks

Brian.
7 REPLIES 7
Matti_Kurkela
Honored Contributor
Solution

Re: expand /opt/openv

First, have you considered the possibility of expanding your filesystem? (It's easy if you're using LVM, not so easy if using "legacy" PC partitions. In my opinion, you should always use LVM in server systems unless there are very compelling reasons to do otherwise.)

But if you need to use symbolic links, here's how. Let's assume that /lots-of-space/ is a filesystem that contains enough space to contain your current /opt/openv + the amount required by the upgrade:

mv -i /opt/openv /lots-of-space/
ln -s /lots-of-space/openv /opt/

In short, "ln" works sort of like "cp", but instead of actual copying it only makes the destination a link pointing back to the source.

Verification:
ls -ld /opt/openv

should list it like this:
... /opt/openv -> /lots-of-space/openv

Some security-sensitive applications might not like being moved around like this, so test it after relocating it.

MK
MK
brian_31
Super Advisor

Re: expand /opt/openv

Matti

one question, since /opt/openv is a mounted filesystem, before doing the mv -i should i not unmount /opt/openv??

here is output from the 1st step

mv -i /opt/openv /new
mv: cannot remove directory `/opt/openv': Device or resource busy

/new has space.

Thanks

Brian
Bob_Vance
Esteemed Contributor

Re: expand /opt/openv

Well, of course, if it's a mount point then the situation is different.
Matti was assuming that "openv" was just a directory under the /opt filesystem.

In that case, you'd pick a few directories UNDER openv and do the similar mv, ln


## mkdir /lots-of-space/openv
(just to keep everything cozy)

## mv -i /opt/openv/dir1 /lots-of-space/openv
## ln -s /lots-of-space/openv/dir1 /opt/openv/dir1
## mv -i /opt/openv/dir2 /lots-of-space/openv
## ln -s /lots-of-space/openv/dir2 /opt/openv/dir2


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Bob_Vance
Esteemed Contributor

Re: expand /opt/openv

Or increase the openv filesystem itself.

give us a

## df


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Alzhy
Honored Contributor

Re: expand /opt/openv

can you do a df -k /opt/openv? Also check if the VG it resides on has ample space left (vgdisplay vgname). If you have space - then you can simply lvextend and resize2fs ONLINE.


If /opt/openv is NOT on its own Filesystem/Partition, you will need to find downtime to "move" it off (actually best practice to have it on its own FS and partition).

Here is my recommendation:

Create New LVOL/FS if you've space
mount new fs to say /x
shutdown Netbackup
cd /opt/openv
find ./ -depth -print|cpio -pdvmu /x
cd /opt
mv openv openv.old
mkdir openv
mount /dev/vgname/openv /opt/openv
resume NBU
create /etc/fstab entry for /opt/openv


A.
Hakuna Matata.
brian_31
Super Advisor

Re: expand /opt/openv

Bob

Thanks for your response. I have lot of directories under /opt/openv so i guess this approach may not work

Thanks

Brian.
Bob_Vance
Esteemed Contributor

Re: expand /opt/openv

Well, you would look for a few large dirs :


## du -sk /opt/openv/*




bv
"The lyf so short, the craft so long to lerne." - Chaucer