1753455 Members
5779 Online
108794 Solutions
New Discussion юеВ

defrag in HPUX

 
Raj_Ranjan
Frequent Advisor

defrag in HPUX

Hi,

Is there any tool/ utility for defragmentating a filesystem in HPUX. If there let me know the packages required and syntax.

Thanks,

Rajeev
5 REPLIES 5
Tim Nelson
Honored Contributor

Re: defrag in HPUX

With online JFS you can reorg filesystem structures with

fsadm -e /mount/point
fsadm -d /mount/point

With basics: Copy all data to new filesystem

With app/database: Run the utilities that come with the app/db or export and reimport.

These answers all depend on the type of content in your filesystem.



Matti_Kurkela
Honored Contributor

Re: defrag in HPUX

For vxfs:
fsadm -F vxfs -e
fsadm -F vxfs -d

Option -e reorganizes extents (=defragmentation), option -d reorganizes directory structures. Both can be done without unmounting the filesystem.

Requires OnlineJFS (which is a must for any serious use of HP-UX anyway).

Usually vxfs resists fragmentation quite well on its own, but if you have very active filesystems (for example, applications creating and deleting several thousands of files per day, every day), defragmentation may be useful.

If you don't have OnlineJFS, the simplest way to defragment a filesystem:
1.) Take a full backup of the filesystem.
2.) Verify that the backup is good.
3.) Re-initialize the filesystem with newfs or mkfs.
4.) Restore from backup.

MK
MK
Jeeshan
Honored Contributor

Re: defrag in HPUX

Hi Rajeev

You'll find this info in man fsadm_vxfs
fsadm -D -> report on directory fragmentation
fsamd -d -> directory defrag
fsadm -E -> report on extend fragmentation
fsadm -e -> extend defrag

You'll need onlineJFS.

Or

If you can have an outage take the easy route

backup /home to another file system

remove the logical volume

create new logical volume of appropiate size

copy backup to new /home

new volume will be totally defragmented and the data contigous.

even JFS has been know to fail on an lvreduce so make sure you have a backup whatever route you take.
a warrior never quits
Bill Hassell
Honored Contributor

Re: defrag in HPUX

Unless you have a very specific pattern of writing and deleting files, you'll never need defrag. This ain't Windoze. VxFS filesystems are quite good at managing space allocation. But the reports (-E -D) mentioned above will tell you that.


Bill Hassell, sysadmin
Raj_Ranjan
Frequent Advisor

Re: defrag in HPUX

Thank you all.