Operating System - HP-UX
1820592 Members
2216 Online
109626 Solutions
New Discussion юеВ

Correct fstab syntax for swapfs

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Correct fstab syntax for swapfs

Hello,

I'm fighting to work out the accepted fstab syntax for filesystem paging by the swapon command (this is taking place on 11.11).

I was demanded to provide 20 GB of swap (probably only needed for reservation, or even merely checked to be prevelent, during startup of SAP)
which I find such a waste of disk space.
Therefore during OS installation I deliberately only assigned 10 GB to lvol2.
I would like to provide the remaining 10 GB as filesystem swap with low priority (anyway man swapon says, that swap devs are always allocated first no matter what pri options say).
But I am somewhat fooled by swapon.
I read manpages of swapon and fstab several times, but the more I read the more contradicting it appears to me.

Here is what I try.

# grep crash /etc/fstab
/dev/vg00/lvol12 /var/adm/crash vxfs delaylog 0 2
... /var/adm/crash swapfs pri=10,min=0,lim=1310720 0 0


# bdf /var/adm/crash
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol12 18874368 2848 18724096 0% /var/adm/crash


# lvdisplay /dev/vg00/lvol12|grep -i lv\ size
LV Size (Mbytes) 18432


when I try to swapon I get this


# swapon -a
swapon: unable to find the mount point for /var/adm/crash.


See, it's taking the mickey.
That mount point exists (see bdf above)

Because manpage says something about specifying an existing directory in the swapfs used filesystem I tried this


# mkdir /var/adm/crash/paging

# bdf /var/adm/crash/paging
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol12 18874368 2848 18724096 0% /var/adm/crash

# grep crash /etc/fstab
/dev/vg00/lvol12 /var/adm/crash vxfs delaylog 0 2
... /var/adm/crash/paging swapfs pri=10,min=0,lim=1310720 0 0


# swapon -a
swapon: unable to find the mount point for /var/adm/crash/paging.


Ok, since swapon manpage says a paging subdir will be automatically generated in the root of swapfs I removed it

# rmdir /var/adm/crash/paging

But now it's complaining about a missing paging directory.

# swapon -a
swapon: /var/adm/crash/paging: No such file or directory
swapon: unable to find the mount point for /var/adm/crash/paging.


So can anyone tell me how the manpages are to be interpreted?

Rgds.
Ralph


Madness, thy name is system administration
2 REPLIES 2
john korterman
Honored Contributor
Solution

Re: Correct fstab syntax for swapfs

Hi Ralph,

just a suggestion: perhaps the defect description for patch PHCO_27010 applies to your situation?

regards,
John K.
it would be nice if you always got a second chance
Ralph Grothe
Honored Contributor

Re: Correct fstab syntax for swapfs

Hi John,

great PHCO_27010 fixes this contradiction.
So someone must have stumbled over it like me.

Only the swapinfo output of the limits is irretating me.
According to manpage (if I recall correctly limits can be given as filesystem blocks.
I used 8 K block size, and want swapfs to allocate maximally 10 GB of the filesystem.
So I calulated those 1310720 blocks.
But maybe swapon's calculations are rather based on swchunk tunable?


# swlist -l fileset -a state PHCO_27010|grep ^[^#]
PHCO_27010.UX-CORE configured

# swapon -a
Enabling file system paging on /var/adm/crash.

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 10240 0 10240 0% 0 - 1 /dev/vg00/lvol2
localfs 1900 0 1900 0% 2048 0 10 /var/adm/crash/paging
reserve - 105 -105
memory 14146 45 14101 0%
total 26286 150 26136 1% - 0 -

# fstyp -v /dev/vg00/lvol12|grep bsiz
f_bsize: 8192

# kmtune -q swchunk
Parameter Current Dyn Planned Module Version
===============================================================================
swchunk 2048 - 2048
Madness, thy name is system administration