Operating System - HP-UX
1833159 Members
3080 Online
110051 Solutions
New Discussion

Re: reducing a filesystem to allocate to another file system

 
SOLVED
Go to solution
James Ellis_1
Super Advisor

reducing a filesystem to allocate to another file system

I need to (on prod box) reduce the /dbawrk filesystem in order to have more space and allocate this space to /oracle for the Oracle 9i upgrade. I am getting error msg like errno 16, and believe this is because we have OnlineJFS v3.1 and doing a fstyp -v /dev/vg04 /dev/dsk/dbawrk shows filesystem is version 3. Since I don't have version 4 (which indicates its a OnlineJFS v3.3), and this is a production box, I thought it may be better to just blow away the /dbawrk (currently at 13.4G), and recreating the /dbawrk with 10G. I will then extend /oracle with the 3.4G space. By the way /dbawrk and /oracle are from the same vg.

I have a couple questions, we can easily restore from a weekly backup, but is it tricky to recreate the mountpoint with a smaller size? Anything I should look out for?

Thanks.
"In the middle of difficulty lies opportunity" -Einstein
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor
Solution

Re: reducing a filesystem to allocate to another file system

Hi,

You are correct, blow away the filesystem and recreate it with a smaller size.

# lvremove
# lvcreate
# newfs
restore data from backup.

Hope this helps,
Robert-Jan
Kent Ostby
Honored Contributor

Re: reducing a filesystem to allocate to another file system

You could also just:

unmount
lvreduce
newfs

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Sridhar Bhaskarla
Honored Contributor

Re: reducing a filesystem to allocate to another file system

Hi James,

I would take the approach based on how much /dbawrk filesystem is used. If it is only used a little (say around a gig or so), then I will temporarily create a filesystem of that size, move the data, recreate the /dbark with less size and move the data back. If you don't have free space in some other volume group enough to take the backup of /dbawrk, then I will go with your approach.

I try to depend less on tapes and backup.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
James Ellis_1
Super Advisor

Re: reducing a filesystem to allocate to another file system

All ideas are good.

Sridhar, The used file system is a tad over 2G. I don't have 2G laying around to create a temp filesystem. Even the /tmp is 1.1G available.

I had thought I could just backup the whole /dbawrk on tape, and then blow away the mountpoint and recreate the mountpoint and restore from that tape. But I had problems restoring from tape before, in that the directories were all wrong after the restore. I presume this is because I did not explictly say where to restore to?

Thanks.
"In the middle of difficulty lies opportunity" -Einstein
Jeroen Peereboom
Honored Contributor

Re: reducing a filesystem to allocate to another file system

James,

using fbackup, tar or cpio you should not have problems restoring the files. The destination is the same. But since you have had problems before, make 2 backups and test them before removing the files.
I do not know about Online JFS, but I thought OJFS is meant for situations like this. Shouldn't it work, reducing a filesystem and lvol?

JP
Sridhar Bhaskarla
Honored Contributor

Re: reducing a filesystem to allocate to another file system

James,

2 GB is not big deal to put it on tape. But you still have options doing an 'scp -rp' or 'rcp -rp' or like mounting an NFS filesystem to a remote system where disk space is available etc., I am suprized to see you don't have a filesystem at /var/adm/crash with this being a production server.

In either the case, it is a good idea to prepare atleast two tapes if the data in this filesystem is too important. As I said, backup and restore from tape is my last option.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sundar_7
Honored Contributor

Re: reducing a filesystem to allocate to another file system

Hi James,

Since only 2 GB is used out of 13.4 GB, you could try to defragment the file system and try reducing it.

1) Take the backup
2) run fsadm -F vxfs -dD -eE /dbawrk
3) fsadm -F vxfs -b 10000m /dbawrk
4) lvreduce -L 10000m /dev/vg01/lvoldbawrk

See if this helps

Sundar
Learn What to do ,How to do and more importantly When to do ?