Operating System - HP-UX
1752292 Members
4401 Online
108786 Solutions
New Discussion юеВ

disk usage vs. inode usage (vxfs)

 
Martijn Bos
New Member

disk usage vs. inode usage (vxfs)

Hi all,

When playing a little on a HP-UX machine I encoutered a (to me) stange problem.

First I will tell the steps wich lead to my problem :
1) I run a script wich creates empty files untill I run out of i-nodes.
2) I notice that both the %used as well as the %iuse is 100%.
3) Remove all the just created empty files
4) Now I notice that %iuse is back to normal, but the %used is still 100%.
5) running "fsadm -d -e -s /home" 100 times helps a little (%used back to about 94%)

The fs is a vxfs filesystem.

My questions :
1) Is this normal behavior ?
2) How can I release the diskspace?
3) Is this a feature or a bug :-) ?

Best Regards,
Martijn Bos
Why use computers when you can go walking on the beach
10 REPLIES 10
Robert-Jan Goossens
Honored Contributor

Re: disk usage vs. inode usage (vxfs)

Hoi Martijn,

To Perform both Directory and Extent Reorganization

# /usr/sbin/fsadm -F vxfs -d -D -e -E /[jfs_mount_point]

Hope it helps,

Robert-Jan.

http://www4.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062683855
Martijn Bos
New Member

Re: disk usage vs. inode usage (vxfs)

Robert-Jan,

Thanx for your quick answer.

Unfortunately it was not the resolution to my problem :-(

I allready tried some fsadm options. The options you suggested did not improve the % used.

If you have some other ideas, I'll be glad to read them them :-)

Best Regards,

Martijn Bos
Why use computers when you can go walking on the beach
James Murtagh
Honored Contributor

Re: disk usage vs. inode usage (vxfs)

Hi Martijn,

Can you let me know:

1) What OS version
2) What version of vxfs filesystem you tried this on
3) What vxfs patches you have installed

Regards,

James.
James Murtagh
Honored Contributor

Re: disk usage vs. inode usage (vxfs)

Hi Martjin,

I shouldn't need that information, tried it on 11i using version 3 & 4 filesystems and replicated your results. I know why it is happening but like you am a little surprised the space is not freed.

A little background - vxfs filesystems are seperated into 2 filesets, a structural fileset for filesystem metadata and an unnamed fileset for user data. To allow for the dynamic creation of inodes the inodes are allocated space from a file in the structural fileset, so as more inodes are created the file is simply grown, as with any regular file. Each inode entry is typically 256 bytes in size. So if I create an 8MB filesystem to test:

# bdf -i /itrc
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol11 8192 1109 6648 14% 4 1768 0% /itrc

You see initially space for 1768 inodes is created. This is in part why you always see used space on a newly created filesystem. So I have 6648KB available space. If I fill my filesystem with zero length files:

# bdf -i /itrc
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol11 8192 8192 0 100% 25971 5 100% /itrc

You will see 25971 inodes have been created. Remembering each inode is 256 bytes in size:

(256 * 25971)/1024 = 6492

so that is where our space has gone. If we than remove the files we see:

# bdf -i /inod
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol10 8192 8078 114 99% 5 25967 0% /inod

there are now 25967 inodes still allocated to the structural file accounting for what we are seeing.

Sorry if you knew all this theory before, I will look into if it is possible to release this space.

Regards,

James.
Martijn Bos
New Member

Re: disk usage vs. inode usage (vxfs)

James,

Thank you very much for your time.

However I have to warn you : I'm on a HP-Course now (Sys-Admin 1), and am just playing around on the course-systems.

Our course trainer told me to also try this medium to get an answer to the problem. So.............don't spend to much time :-)

Concerning the problem :
This exactly as far we (trainer and I) have come. I'm glad that you encounter the same problem as we did.

If you, however, find something to solve the problem or correct our thinking, please keep me posted via this medium.

Best Regards,
Martijn Bos
Why use computers when you can go walking on the beach
Robert-Jan Goossens
Honored Contributor

Re: disk usage vs. inode usage (vxfs)

Hoi Martijn,

Could you give me the mount options in the /etc/fstab for that filesystem ?

UX001:/# cat /etc/fstab | grep dbappl
/dev/vg01/lvol4 /app/oracle/dbappl vxfs log,nodatainlog,largefiles,rw,suid 0 2

Groeten en succes,

Robert-Jan.
Martijn Bos
New Member

Re: disk usage vs. inode usage (vxfs)

Robert-Jan,

No problem, here it is :
root:/:>cat /etc/fstab | grep /home
/dev/vg00/lvol4 /home vxfs delaylog 0 2
root:/:>

Now I see this : Can the delaylog-option have something to do with it?

Best Regards
Martijn Bos
Why use computers when you can go walking on the beach
Robert-Jan Goossens
Honored Contributor

Re: disk usage vs. inode usage (vxfs)

James Murtagh
Honored Contributor

Re: disk usage vs. inode usage (vxfs)

Hi Martijn,

Thats ok, hope to see you more on the forums now! :-)

However, I'm afraid I couldn't find any safe way to do this leaving the filesystem intact. I suspect you will have to newfs it.

It may be possible with fsdb but you would never do this on a live system so it is not worth pursuing.

There is one workaround but it requires you to extend the volume by a large amount, fill it with large files, remove them then reduce it. As the inode free count is caluculated using the usage history and free space among others, if you can change the variables here you can change the inode count. However, as inodes are so small it takes thousands/millions to fill the filesystem. Even with only an 8MB filesystem populated with ~26000 files I had to increase the filesystem size dramatically to affect this. Out of the lab this situation would most likely not occur, so I suspect it is not a bug.

Regards,

James.