Operating System - HP-UX
1849177 Members
7323 Online
104041 Solutions
New Discussion

Disk Fragmentation without JFS

 
SOLVED
Go to solution
Tom_131
Advisor

Disk Fragmentation without JFS

I am attempting to defrag an hpux system. I do not have HP online JFS, so any attempt to use fsadm will fail for me. I even scaned the swlist -l products |grep -i JFS

This system has been online for nearly 4 years. It has 11.0 on it. It is really in need of a defrag.

If it would not take too much time, how would someone defrage a volume without using fsadm?
25 REPLIES 25
James R. Ferguson
Acclaimed Contributor

Re: Disk Fragmentation without JFS

Hi:

Assuming that you really need to defragment it, in the absence of Online JFS, you would need to backup the filesystem; 'newfs' it to create a new, empty filesystem; and reload it from backup.

I'm not at all sure that this would provide you any benefit at all -- at least one that you could measure.

Regards!

...JRF...
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Hi

You can with HFS but not vxfs.

http://aa11.cjb.net/hpux_admin/1997/0122.html

HTH

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Hi

I was going to suggest what James replied with but didn't think it would be worth it. Unless you have the downtime available


Is your system performance decreasing due to disk bottleneck ?

HTH

Steve
take your time and think things through
S.K. Chan
Honored Contributor
Solution

Re: Disk Fragmentation without JFS

It depends BUT rarely needed. This is because JFS by its nature is designed to minimize the need for defragmentation. I have done a couple and it really doesn't significantly improve io performance. Maybe in my case the FS was not that fragmented to begin with. First of all run this ..
# fsadm ???F vxfs ???E /
This gives a quick report on your "extent fragmentation". Replace "-E" with "-D"
to get report on "directory fragmnetation". Post the result here and we'll see if you need one. You do not need OnlineJFS to use fsadm to report fragmentation.
Tom_131
Advisor

Re: Disk Fragmentation without JFS

Thank all of you for the fast response.

The bottleneck is a feasible problem, but I am certian it is not the network access.

I imagined I would probobly need to pull the disks down.

If I have to, could you all tell me a safe procedure to do so an recreate the volume?

Thanks,

Tom
Tom_131
Advisor

Re: Disk Fragmentation without JFS

When I run the fsadm -F vsfs -E /tmp as a test I get:
vxfs fsadm: cannot open /tmp/lost+found/.fsadm - errno 2

any ideas?

thanks,

Tom
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Hi Thomas

Which logical volume are you thinking about ?
one in vg00 or elsewhere ? Is it just a data area or does it hold a database ? Depending on the area will depend on the method used to wipe the area and restore the data

HTH

Steve
take your time and think things through
S.K. Chan
Honored Contributor

Re: Disk Fragmentation without JFS

It's "vxfs" not "vsfs" and "/tmp" MUST be a mount point.
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Hi

errno 2 is missing file or directory . S K does fsadm reference lost + found area ?

Steve
take your time and think things through
S.K. Chan
Honored Contributor

Re: Disk Fragmentation without JFS

Yes it does Steven, it'll create a .fsadm file in the FS's lost+found everytime it's run. Thomas the lost+found dir should be 755 (root:root) typically. Is that what you got ?
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Thomas

You mention newtork access. Is there a delay when you are logging onto the server ?

This can be caused by hostname resolution. Are you resolving locally or to dns ?

Check your /etc/nsswitch.conf file

It is quickest to resolve to your hosts file initially

hosts : files [NOTFOUND=continue] dns

HTH

Steve
take your time and think things through
Tom_131
Advisor

Re: Disk Fragmentation without JFS

/tmp houses much of the temporary data along with certain areas of the opt file system that some old home-built programs used as a swap area.

/tmp is located on lvol4 vg00
/opt is located on lvol6 vg00


Does this help?

Thanks,
Tom
Tom_131
Advisor

Re: Disk Fragmentation without JFS

S.K. The .fsadm file is not created nor is a Lost+found either, but the permissions for the /tmp are 777 bin:bin.

Is this a permissions issue?

Thanks,

Tom
Jeff Schussele
Honored Contributor

Re: Disk Fragmentation without JFS

Hi Thomas,

Are you the root user when running the fsadm command?

If so then you MUST have the lost+found dir on the mount point. If it's not there create it
mkdir /tmp/lost+found
should look like
drwxr-xr-x 2 root sys 96 Oct 11 15:45 lost+found

Set ownership & perms if necessary

Then just run
touch /tmp/lost+found/.fsadm

And it should look like
-rw------- 1 root sys 0 Oct 11 15:45 .fsadm

Then your fsadm command should run.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Tom_131
Advisor

Re: Disk Fragmentation without JFS

When I touch the directory /tmp/lost_found, I get an errno 20.

What's this error?

Thanks
S.K. Chan
Honored Contributor

Re: Disk Fragmentation without JFS

It looks like lost+found does not exist in your mounted FS ? Do this then to recreate it ..
# cd /tmp
# mklost+found
Then re-run the fsadm again. Don't use the regular mkdir command.
Jeff Schussele
Honored Contributor

Re: Disk Fragmentation without JFS

Hi Thomas,

Use mkdir to create the directory if it's not there

mkdir /tmp/lost+found

Then you can try the fsadm command. If it still fails then use touch to create the .fsadm file

touch /tmp/lost+found/.fsadm

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Hi Thomas

for errno errors run this script and pass the number through it


#!/bin/sh

if [ $# -ne 1 ]
then
echo "Usage: $0 number" >&2
exit 1
fi
awk '/define/ { if ($3 == '"$1"' || $4 == '"$1"') print }' /usr/include/sys/errno.h

HTH

Steve
take your time and think things through
Tom_131
Advisor

Re: Disk Fragmentation without JFS

Ok- I got it to run, but how would you defrag the drive by taking the drive offline?

Thanks,
Tom
Jeff Schussele
Honored Contributor

Re: Disk Fragmentation without JFS

Thanks S.K - learned something new today.
Wish I could go home now ;~)

Was totally unaware of that command.

Sorry Thomas - S.K. is entirely correct.

The lost+found is normally created by mkfs or newfs commands. Someone must have removed it at some point.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
S.K. Chan
Honored Contributor

Re: Disk Fragmentation without JFS

You can't do it without OnlineJFS. Sorry ! the only way ... (like James had suggested) .. is to recreate your FS.
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

Hi

Without jfs

for /tmp

backup the area

fbackup -v -f /dev/rmt/0m -i /tmp

shutdown -y 0

umount /tmp

newfs -F vxfs /dev/vg00/lvol?
mount /dev/vg00/lvol?

frecover -xvof /dev/rmt/0m /tmp

suggestions for /opt S K

ignite ?

I'm learning here

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: Disk Fragmentation without JFS

oops

mount /dev/vg00/lvol6 /tmp

You probably know that

Steve
take your time and think things through
James R. Ferguson
Acclaimed Contributor

Re: Disk Fragmentation without JFS

Hi (again) Thomas:

You're wasting your time, in my option. '/tmp' should be disposable upon a reboot, so why defragment anything it it(?).

'/opt' should'nt be that volatile except for logs from things like Measureware.

If you want to unmount filesytems like '/opt', '/var' and '/tmp' you will find that the easiest way is to boot into single user mode rather than trying to kill processes holding files in them open.

Since you don't have Online JFS you can't defragment anything "online".

Regards!

...JRF...