- Community Home
 - >
 - Servers and Operating Systems
 - >
 - Operating Systems
 - >
 - Operating System - HP-UX
 - >
 - Can HPUX use a file for swap space?
 
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
 - Entry Storage Systems
 - Legacy
 - Midrange and Enterprise Storage
 - Storage Networking
 - HPE Nimble Storage
 
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
 - Appliance Servers
 - Alpha Servers
 - BackOffice Products
 - Internet Products
 - HPE 9000 and HPE e3000 Servers
 - Networking
 - Netservers
 - Secure OS Software for Linux
 - Server Management (Insight Manager 7)
 - Windows Server 2003
 - Operating System - Tru64 Unix
 - ProLiant Deployment and Provisioning
 - Linux-Based Community / Regional
 - Microsoft System Center Integration
 
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
 - Mark Topic as New
 - Mark Topic as Read
 - Float this Topic for Current User
 - Bookmark
 - Subscribe
 - Printer Friendly Page
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 02:53 AM
09-20-2006 02:53 AM
Thank you!
Solved! Go to Solution.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 02:56 AM
09-20-2006 02:56 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
Yes, you can use a filesystem for swap space. See the manpages for 'swapon(1M)':
http://docs.hp.com/en/B2355-60127/swapon.1M.html
Regards!
...JRF...
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 02:57 AM
09-20-2006 02:57 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
lvol2 in vg00 is primary swap by default when you install HP-UX system. If you want to create a secondary swap then create another logical volume on any other volume group (local disk preferred) other than vg00 and make it as swap.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 03:09 AM
09-20-2006 03:09 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
I think you can only use a filesystem, not an individual file for this.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 03:12 AM
09-20-2006 03:12 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
The first two examples enable paging to the file system containing the /paging directory. The maximum number of file system blocks available to the paging system is set to 5000, the number of file system blocks reserved for file system use only is set to 10000, and the priority is set to 2. The number of file system blocks initially taken by the paging system defaults to 0 in the first example, and is set to 0 in the second example. On a file system with the default 8kB block size, these examples allocate approximately 40MB of file system paging.
/usr/sbin/swapon -l 5000 -r 10000 -p 2 /paging
/usr/sbin/swapon /paging 0 5000 10000 2
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 04:05 AM
09-20-2006 04:05 AM
SolutionThis is because the predominant usage of swap space is for reservation.
Since device swap is always used first (no matter what priority you assign your filesystem swap) for pageouts (and hopefully never swapouts) I think it's an acceptible compromise to split half of the swap requirement to inferior filesystem swap.
The SAP requirement was 20 GB of swap.
So I gave it 10 GB of primary device swap.
Note that (unlike with Solaris and Linux where most of the times you can reclaim unused swap by "swap -d" or "swapoff" online) under HP-UX you can never release "swapon-ed" space until you reboot!
Thus, a swap device is instantly fully unavailable for other purposes.
Whereas filesystem swap is only taken on demand.
As you can see the system has so far reserved abt. 7 GB from the filesystem swap, and may take up to 10 GB as set by the lim attribute.
Thus, as long as your system's swap requirements remain low you can still use it as ordinary filsystem space.
Afaik, you can only designate a filesystem for filesystem swap under HP-UX (hence the name, I suppose).
The swapon command automatically creates a subdir named paging in that filesystem that it fills with swap file chunks corresponding to actual swap requirements (viz. reservation).
Whereas under Linux you can assign any file chunk as swap space.
$ /usr/sbin/swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 10240 43 10197 0% 0 - 1 /dev/vg00/lvol2
localfs 10240 0 10240 0% 10240 0 10 /var/adm/crash/paging
reserve - 17497 -17497
memory 14146 2445 11701 17%
total 34626 19985 14641 58% - 0 -
$ grep swap /etc/fstab
... /var/adm/crash swapfs pri=10,min=0,lim=1310720 0 0
$ echo $((10240*1024/8))
1310720
Note, that the swapon command had an fstab issue that was fixed with this patch (which is part of the latest GOLDBASE11i bundle
$ /usr/sbin/swlist GOLD\*|grep swapon
GOLDBASE11i.PHCO_27010 1.0 swapon(1M) patch
$ /usr/sbin/swlist -l fileset -a readme GOLDBASE11i.PHCO_27010|more
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 04:11 AM
09-20-2006 04:11 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
Agreed with everybody else, you can create a logical volume and use it as file swap, but not get a file and use it as a file system.
Regards,
Jaime.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 04:26 AM
09-20-2006 04:26 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
By default HP will use /dev/vg00/lvol2 as primary swap logical volume. I think you can only use a locial volume to increase the size. I don't think you cam use just a file. You can create another logical volume like /dev/vg03/lvol3 if not being used.
sp,
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 06:56 AM
09-20-2006 06:56 AM
			
				
					
						
							Re: Can HPUX use a file for swap space?
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-20-2006 06:57 AM
09-20-2006 06:57 AM