Operating System - HP-UX
1825801 Members
2878 Online
109687 Solutions
New Discussion

Re: degragmentation on disk or ram

 
SOLVED
Go to solution
Shivkumar
Super Advisor

degragmentation on disk or ram

dear sirs,

is defragmentation happens on hpux disks or ram ?

thanks,
shiv
12 REPLIES 12
Devender Khatana
Honored Contributor
Solution

Re: degragmentation on disk or ram

Hi,

Yes you can defragment files on a Vxfs file system. To achive this you should use

#fsadm -F vxfs -D /home (For directory fragmentation report)

#fsadm -F vxfs -d -D -s /home (Reorganization)

man fsadm_vxfs for details.

I do not think it is possible for RAM.

HTH,
Devender
Impossible itself mentions "I m possible"
Arunvijai_4
Honored Contributor

Re: degragmentation on disk or ram

Hi Shiv,

Yes, It happens on HP-UX if you installed OnlineJFS. Check man page of "fsadm" for more information.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Yogeeraj_1
Honored Contributor

Re: degragmentation on disk or ram

hi,

defragmenation on RAM is not really possible.

Defragmentation on disks can happen. Most of the time you will have to manage your disk space at your application level efficiently (e.g. LMT in oracle).

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Arunvijai_4
Honored Contributor

Re: degragmentation on disk or ram

Hi Shiv,

Deframentation of RAM is not rellay needed in HP-UX since it is based on Unix. Where as windows third party tools are available to do so.

"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: degragmentation on disk or ram

Geoff Wild
Honored Contributor

Re: degragmentation on disk or ram

I run a script from cron once a week:

#defrag filesystems
0 22 * * 4 /usr/local/bin/fsadm.defrag >/dev/null 2>&1


# cat /usr/local/bin/fsadm.defrag

#!/bin/sh
# defrag all mounted file systems
LOG=/tmp/fsadm.defrag.log
if [ -f $LOG ]
then
mv $LOG $LOG.old
fi
cat /dev/null > $LOG

for i in `mount -l | grep -v stand |awk '{print $1}'`
do
echo "defraging " $i >> $LOG
fsadm -F vxfs -d -D -e -E $i >> $LOG
done


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Shivkumar
Super Advisor

Re: degragmentation on disk or ram

Is there a way to decide whether a file system needs defragmentation ?

regards,
shiv
John Payne_2
Honored Contributor

Re: degragmentation on disk or ram

Shiv,

I run a script once a month that checks for it, and generates the report, but then does not defrag. (We only have OnlineJFS for our DB machines...)

#!/bin/ksh
# Filesystem fragmentation checker
# written by jjp 22 May 2003
# To defrag a fragmented filesystem, do a 'fsadm -D -d -E -e /filesystem'
# This will run a report on the fragmentation before and after the run
rm /home/ucs/jjp/fragmentreport
touch /home/ucs/jjp/fragmentreport
for i in `bdf -l |grep -v Filesystem |awk '{print $6}'`
do
if [ $i != "/stand" ]; then
uname -n
print $i
fsadm -F vxfs -D -E $i
fi
done


The report lets you know what kind of fragmentation you have. (You have to extrapolate from the report.) I run the script each month, then have one of my student employees pore over the reports to see what's starting to become fragmented. I have a little paper I can dig up for you that explains what to look for if you can't figure it out ffrom the man page. (man fsadm)

Hope it helps

John
Spoon!!!!
Zigor Buruaga
Esteemed Contributor

Re: degragmentation on disk or ram

Hi,

Maybe this link can help, see the reply from Mr. Ferguson:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=102143&admit=-682735245+1138472183916+28353475

Regards,
Zigor
Mahesh Kumar Malik
Honored Contributor

Re: degragmentation on disk or ram

Hi Shiv

Following link may be of help

http://docs.hp.com/en/5187-1375/ch05s06.html

Regards

Mahesh
Steven E. Protter
Exalted Contributor

Re: degragmentation on disk or ram

Shalom Shiv,

Online JFS fsadm defragmenting provides a report that can give you an idea as to whether defragmentation was really necessary, be it after the fact.

I would suggest you see if the utility has a preview mode as many utilities do.

It's important that once its running it be left to complete its task.

Here are the guts to the script I ran in the US:

while read -r aa bb cc dd ee
do
FILESYSTEM=$bb
echo "fs is $bb $cc"
if [ "$cc" = "vxfs" ]
then
/usr/sbin/fsadm -F vxfs -D -d -E -e -s $FILESYSTEM
fi

done < /etc/fstab

# As you see it reads /etc/fstab and only touches those filesystems with vxfs on them.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: degragmentation on disk or ram

While one can certainly defragment a vxfs filesystem, my experience has been --- except in rare circumstances --- that it is difficult to achieve measurable, much less significant, results. Bear in mind that vxfs filesystems are extent-based and try to allocate large chunks and UNIX filesystems are geared towards creating many, many files in a short period of time.

If it ain't broke, I can fix that.