K.S. Bhaskar on 19 Dec 2007 11:57:12 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Pros and cons of swap in a partition vs. in a file in the file system


Sorry, my reply went only to Brent, not to the group.

-- Bhaskar

On Dec 19, 2007 2:56 PM, K.S. Bhaskar <bhaskar@bhaskars.com> wrote:
> Thanks, all.
>
> I am actually going with implementing swap as a file, /home/swap.
> This is because I try to put enough RAM on my machines to avoid
> swapping under normal use (otherwise, I would use a partition).  So,
> swap is there primarily to keep the machine from crashing under low
> memory conditions.  Yesterday, I was trying to run a test that created
> a >4GB shared library, and I didn't realize that ld would just try to
> build it all in memory and then write out the .so file.  As the test
> ran, I saw swap space running out, and was able to add a few GB more
> swap space to keep the machine from crashing.  [ld still had not
> finished this morning, so I had to kill it.]
>
> Apropos security, any machine I set up these days has encrypted /home,
> and, if swap is on a partition, it is encrypted too.  I realize that I
> give up Hibernate when I do this, but Suspend still works.
>
> Regards
> -- Bhaskar
>
>
> On Dec 19, 2007 2:46 PM, brent saner <brent.saner@gmail.com> wrote:
> > Dan Widyono wrote:
> > > Make sure you protect access to swap with appropriate permissions if you use
> > > a file.
> > >
> > > Dan W.
> > dan brings up an important point. no matter what you use, file or
> > partition, remember that if someone really wants to crack their way into
> > it, swap can be (semi-)readable. so permissions should definitely always
> > be kept in mind if it's a file, and lockdown to mount and other assorted
> > system utilities should always be an important part of your system if
> > it's a partition (well, they should be locked down regardless).
> >
> > as for me personally, if it's on an older box, i use swap as a partition
> > (and as the first partition on the disk, because that has the fastest
> > spin-up time), usually twice the size of physical RAM. if it's on a more
> > recent box that i know has enough physical RAM to play nicely, i'll add
> > a swap partition ("just in case") about half the size of physical RAM
> > and i'm not as concerned about placement of the partition on the disk,
> > since at that point swap is just a contingency.
> >
> > --
> > Brent Saner
> > 215.264.0112(cell)
> > 215.362.7696(residence)
> >
> > http://www.thenotebookarmy.org
> >
> > Bill Gates is to hacking as Sid Vicious was to the Sex Pistols: no talent, everyone hates him, and he's just in it for the fame and money.
> >
> >
>
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug