Solaris 10 swap device and filesystem


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris 10 swap device and filesystem
# 8  
Old 07-21-2016
Oh no, please don't have a swap file in /var/tmp/ !! "Application is slow, perhaps it helps to delete some temporary files..."
Better something like /critical_swapfile/
And then, isn't a sparse file a risk by itself? What happens if there is no free disk space in the file system? Kernel panic?
This User Gave Thanks to MadeInGermany For This Post:
# 9  
Old 07-21-2016
Quote:
Originally Posted by MadeInGermany
Oh no, please don't have a swap file in /var/tmp/ !! "Application is slow, perhaps it helps to delete some temporary files..."
Better something like /critical_swapfile/
Well, nothing particular will happen if that file is removed by a clueless administrator. The lofi device will still point to the same inode, now linkless. After a reboot, the system will start without that extra swap configured whether the file is removed or not.
Quote:
And then, isn't a sparse file a risk by itself? What happens if there is no free disk space in the file system? Kernel panic?
I'm not sure but it might lock or panic indeed. To clarify, my suggestion actually assumes no physical swapping will occur, and is just there to trick an application that demand plenty of swap but won't write anything to it. As you might know, Solaris is not overcommiting memory so each reservation must be backed by some storage (RAM or swap) but there is no physical I/O as long as that reserved memory is not accessed.
This User Gave Thanks to jlliagre For This Post:
# 10  
Old 07-21-2016
Quote:
Originally Posted by jlliagre
Given the fact using a swapfile would be the most sensible solution, can you elaborate on this personal preference against it?

How much free space is available on the 100GB partition and on the root (/) one?

Will the application make actually use of the swap, i.e. is there a risk the application do more than reserving that extra memory and effectively write pages there?

If you are sure the answer is no for the last question, you might fake swap space by using a sparse file:

e.g.:
Code:
mkfile -n 64g /var/tmp/64g-sparse
swap -a `lofiadm -a /var/tmp/64g-sparse`

Hi jilliare,

Thanks for your reply.
Reason for not using a swapfile is mostly due to standardization. We have a few solaris servers running and none of them are using swapfile.

The 100GB partition is totally empty, except that I have newfs it. Probably touch some files in it, but I have rm -r *.

Thus i am thinking of using it to replace my current 32GB swap partition.
The only concern I have is (-- the UFS filesystem on it ) and if there will be any problem if the OS actually start utilizing the swap space.

Regards,
Noob
# 11  
Old 07-21-2016
Well, if your 100Gb partition is empty, you can either create a swapfile in it, or trash the filesystem on it and use the partition as swap. The former method (swapfile) would be simpler to implement.

You should never configure a partition containing a file system as a raw swap device, especially if it is mounted at the same time. In any case, any actual paging operation will corrupt the file system.
This User Gave Thanks to jlliagre For This Post:
# 12  
Old 07-21-2016
Quote:
Originally Posted by MadeInGermany
Ensure that the 100GB is not mounted. Then it can be trashed, you can add it to swap.
(If it's a partition on a physical disk on Sparc, it might give an error - in this case you must change the "wm" flag to "wu" in "format"s partition menu, in order to declare it unmountable. It's a good habit anyway.)
With used swap I mean the utilized swap, (blocks - free) in swap -l
Hi MadeInGermany,

Yeap. I am using SPARC and i managed to add the UFS partition as swap. It did not prompt me any error (but i am not sure if it is because the swap is not used yet)

I have also change the partition flag from wm to wu.

Regards,
Noob

---------- Post updated at 06:50 AM ---------- Previous update was at 06:47 AM ----------

Quote:
Originally Posted by jlliagre
Well, if your 100Gb partition is empty, you can either create a swapfile in it, or trash the filesystem on it and use the partition as swap. The former method (swapfile) would be simpler to implement.

You should never configure a partition containing a file system as a raw swap device, especially if it is mounted at the same time. In any case, any actual paging operation will corrupt the file system.
Hi Jilliagre,

Thanks. Sorry for my poor english, but what do you mean by "trash the filesystem on it" ?
Do you mean to mount the 100GB partition as swap and ignore the fact of the UFS filesystem on it ?
(p.s. the 100GB is already umounted from its original mountpoint)

Regards,
Noob
# 13  
Old 07-21-2016
You do not need to manually trash anything. Swap does not care about any pre-existing data.
This User Gave Thanks to MadeInGermany For This Post:
# 14  
Old 07-21-2016
Quote:
Originally Posted by MadeInGermany
You do not need to manually trash anything. Swap does not care about any pre-existing data.
Hi MadeinGermany,

Thanks for your reply. Seeing the word trash make me curious.
How do you trash a filesystem ? What do you guys mean by trash ?Smilie

Regards,
Noob
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Solaris

Force unmount of a SWAP filesystem left over from bad Live Upgrade

Hello, Long story short, we built an alternate boot env. back in July and applied the latest CPU to about 15 servers. Of the 15 servers, 7 servers failed to start the zones after the luactivate / reboot. The zones failed to rename from <zone>-<boot_env> back to <zone>. This is fixed in patch... (16 Replies)
Discussion started by: mainegeek
16 Replies

2. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

3. UNIX for Advanced & Expert Users

translating device to filesystem in solaris10

Greetings, I have a oracle database server and i keep getting grid control message Metric=Disk Device Busy (%) Metric Value=98.66 Disk Device=ssd430 Severity=Critical Message=Disk Device ssd430 is 98.66% busy. so I am trying to correlate the ssd430 to the filesystem. I understand this... (3 Replies)
Discussion started by: p4cldba
3 Replies

4. UNIX for Advanced & Expert Users

Swap Device & Unix Disk Buffer

Does anyone know if when the Swap Device / Page file in unix is carrying out Page / Swap In's and Page / Swap outs, does it go through the Unix Disk Cache ( I am presuming raw partitions are not being used ) ? Therefore if there is paging activity on a system ( measured by sar -p, sar -g and... (0 Replies)
Discussion started by: jimthompson
0 Replies

5. UNIX for Dummies Questions & Answers

device to filesystem?

On a HP-UX box, I can execute the sar command which will give me the device, %busy, etc. I would like to know how to take a given device name and determine on which filesystem it's located when I do a bdf. I've done some searching through the posts but so far have not had any luck in... (2 Replies)
Discussion started by: jimedwards
2 Replies
Login or Register to Ask a Question