Skip to Content.
Sympa Menu

baslinux - Re: [BL] Swapon

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: James Miller <jamtat AT mailsnare.net>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] Swapon
  • Date: Sat, 24 May 2003 16:01:48 -0500 (CDT)

On Sun, 25 May 2003 qwms-avib AT dea.spamcon.org wrote:
> >
> > I have obtained a formula for an alias swap turn on.
>
> I don't know why you want an alias for this, but let's
> look at what it does:
>
> > alias xtra='dd if=/dev/zero bs=1024k count=8 of=/swap;
> > mkswap /swap 8192; sync;swapon /swap'
>
> That means whenever you type 'xtra' the following
> sequence of commands will be executed:
>
> (1) dd if=/dev/zero bs=1024k count=8 of=/swap
>
> All that does is put zeros (8192k of them) into a file
> called swap (in the / directory)
>
> (2) mkswap /swap 8192
>
> That formats the file as a swap file (8mb).
>
> (3) sync
>
> That makes sure the file is fully updated.
>
> (4) swapon /swap
>
> That activates swap (using that file).
>
I see. So this is for making a swap file, as opposed to using a partition
for swap. I've been wondering how that works. This could be a useful
script, it seems. Steven, could you say something about what are the
merits/demerits of using a swap file as opposed to dedicating a partition
to swap? Also: this script is apparently written for adding more swap "on
the fly" - i.e., when a particularly memory intensive application needs to
be run - correct? I guess that's why it's called "xtra."

Thanks, James




Archive powered by MHonArc 2.6.24.

Top of Page