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

Re: Where do you put your swap partition?



On Mon, 21 Jan 2008, Thomas Flaig wrote:
> Am Montag, 21. Januar 2008 15:50 schrieb Ron Johnson:
> > On 01/21/08 03:16, Thomas Flaig wrote:
> > > Am Samstag, 19. Januar 2008 03:30 schrieb Ron Johnson:
> > > > I think it's foolish to have a swap *partition* in the 21st century.
> > > But there are other reasons for a swap partition in the 21st century:
> > You miss the distinction between swap partition and swap *file*.
> Ok:

But I don't, and I really prefer a swap partition.  It is much easier and
faster to encrypt it to an ephemeral 64-bit blowfish key (fast, good enough
for my modest security needs) using dm-crypt than to use an encrypting
filesystem.

Of course, if you never need swap anyway, then by all means just disable it.
But there are a lot of usercases that ask for swap space, and there is
nothing ridiculous about them.  Many of which do include up-to-date hardware
with a lot of RAM (working with 16GB datasets on a current 4GB laptop while
travelling to a conference, for example!).

There is also the space you need for hibernation, which is far safer to keep
well away from live filesystems, so abusing the swap partition for this is a
common choice.

> > > * There are some Un*x-like operating system which are able to save
> > > system dumps on a swap partition for debuging after system crash.
> Which un*x-like operation system can do this with a swap *file*?

Recent Linux can.  And it can do a *lot* more, actually.  See
Documentation/kdump/* in the Linux kernel tree.

> > > 	CONFIG_PM_STD_PARTITION="/dev/sdaX"
> Does this also work for a swap *file*? Or do I need a swap partition?

It can be made to work on files, yes.  At least if you use tux-on-ice, which
is moderately more sane than that userspace suspend thing.  Not that the
resume from hibernation in Linux is sane on ACPI systems (it is NOT), so I
have to recommend sticking to sleep-to-RAM unless you really need
hibernation.

And protecting the hibernation data properly is a pain that requires
passphrases, anyway, so that's two reasons to stay away from it.

> If it works with a swap *file* I would like to see an explanation how to 
> do this or a link to a HOWTO.

Stock userspace suspend might not be able to hibernate to a swap file.  But
check http://www.tuxonice.net/, it can do it.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


Reply to: