hibernating (S4?) with no swap - Setup

This is a discussion on hibernating (S4?) with no swap - Setup ; I got my laptop to run Linux (SuSE 9.1) entirely from a flash drive. I modified it a bit to mount as tmpfs certain directories that are written to often, since writing to flash is very slow, and flash supports ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: hibernating (S4?) with no swap

  1. hibernating (S4?) with no swap

    I got my laptop to run Linux (SuSE 9.1) entirely from a flash drive. I
    modified it a bit to mount as tmpfs certain directories that are written
    to often, since writing to flash is very slow, and flash supports a
    limited number of writes (10^6 or so IIRC). Swap, in particular, can
    kill it in short order, since it uses lots of short writes. Never mind
    that it'd be deathly slow in the process.

    So I have no swap. But I really need to be able to suspend (to disk or
    at least to RAM) to make this machine usable at school. All I've found
    about the suspend-to-disk procedure says that it'll use a swap
    partition. Is running "mkswap" on a partition sufficient, or would I
    need to run "swapon" as well? How about RAM compression? ISTR that
    it'd do that; how much compression is typical and how is it enabled?

    Failing that, how about suspend-to-RAM? How do I do that? Could it be
    automatically invoked on shutting the lid (I have a Thinkpad T40)?
    Could I unplug the flash drive (containing all the filesystems) while
    it's suspended, or do I need to get a (short!) right-angle cable so I
    can leave it connected in the bag?

    Thanks.

  2. Re: hibernating (S4?) with no swap

    >>>>> "Hactar" == Hactar (Eben) writes:

    Hactar> So I have no swap. But I really need to be able to
    Hactar> suspend (to disk or at least to RAM) to make this machine
    Hactar> usable at school. All I've found about the
    Hactar> suspend-to-disk procedure says that it'll use a swap
    Hactar> partition. Is running "mkswap" on a partition sufficient,
    Hactar> or would I need to run "swapon" as well? How about RAM
    Hactar> compression? ISTR that it'd do that; how much compression
    Hactar> is typical and how is it enabled?

    If you're talking about the swsusp in the vanilla kernel, then yes, it
    requires the suspend partition to be an active swap space.
    (Well... has that changed since kernel 2.6.9?)

    You may want to try suspend2, which does support suspending to a file,
    rather than swap partition.


    Hactar> Failing that, how about suspend-to-RAM?

    I've read on the web that it is possible for Linux to suspend to BOTH
    RAM and disk. It combines the best of both worlds. I can't remember
    if that's for suspend2 only.

    The idea is to do a suspend to disk first, and then instead of
    powering off the machine or rebooting it, do a suspend to RAM. As
    long as RAM gets power, it will retain its contents and you can resume
    from RAM. And that's very quick. However, if you run out of battery,
    then the RAM contents are lost, and you will be resuming from disk at
    the next reboot. This is slower than resuming from RAM, but what else
    do you expect when you run out of battery?


    Hactar> How do I do that? Could it be automatically invoked on
    Hactar> shutting the lid (I have a Thinkpad T40)? Could I unplug
    Hactar> the flash drive (containing all the filesystems) while
    Hactar> it's suspended, or do I need to get a (short!) right-angle
    Hactar> cable so I can leave it connected in the bag?

    With suspend to disk (i.e. the machine can be completely unpowered --
    less the CMOS battery), I think it is possible to remove the flash
    drive. But you have to remember to plug it in again at next boot, and
    you may need to fiddle with the init scripts (or initrd) to make sure
    it gets mounted at the right place for resume to work.



    --
    Lee Sau Dan u ~{@nJX6X~}

    E-mail: danlee@informatik.uni-freiburg.de
    Home page: http://www.informatik.uni-freiburg.de/~danlee

  3. Re: hibernating (S4?) with no swap

    In article <87ac3pbuy7.fsf@informatik.uni-freiburg.de>,
    LEE Sau Dan wrote:
    > >>>>> "Hactar" == Hactar (Eben) writes:

    >
    > Hactar> So I have no swap. But I really need to be able to
    > Hactar> suspend (to disk or at least to RAM) to make this machine
    > Hactar> usable at school. All I've found about the
    > Hactar> suspend-to-disk procedure says that it'll use a swap
    > Hactar> partition. Is running "mkswap" on a partition sufficient,
    > Hactar> or would I need to run "swapon" as well? How about RAM
    > Hactar> compression? ISTR that it'd do that; how much compression
    > Hactar> is typical and how is it enabled?
    >
    > If you're talking about the swsusp in the vanilla kernel, then yes, it
    > requires the suspend partition to be an active swap space.
    > (Well... has that changed since kernel 2.6.9?)


    FWIW, it unmounted all the filesystems (TYVM, swsusp) then aborted on 2.6.18.

    > You may want to try suspend2, which does support suspending to a file,
    > rather than swap partition.
    >
    >
    > Hactar> Failing that, how about suspend-to-RAM?
    >
    > I've read on the web that it is possible for Linux to suspend to BOTH
    > RAM and disk. It combines the best of both worlds. I can't remember
    > if that's for suspend2 only.
    >
    > The idea is to do a suspend to disk first, and then instead of
    > powering off the machine or rebooting it, do a suspend to RAM. As
    > long as RAM gets power, it will retain its contents and you can resume
    > from RAM. And that's very quick. However, if you run out of battery,
    > then the RAM contents are lost, and you will be resuming from disk at
    > the next reboot.


    Well, the main reason I would use suspend-to-disk is so it _wouldn't_
    use battery.

    > Hactar> Could I unplug
    > Hactar> the flash drive (containing all the filesystems) while
    > Hactar> it's suspended, or do I need to get a (short!) right-angle
    > Hactar> cable so I can leave it connected in the bag?
    >
    > With suspend to disk (i.e. the machine can be completely unpowered --
    > less the CMOS battery), I think it is possible to remove the flash
    > drive. But you have to remember to plug it in again at next boot, and
    > you may need to fiddle with the init scripts (or initrd) to make sure
    > it gets mounted at the right place for resume to work.


    Thanks. I'll look into suspend2. Any idea where I find that, or is
    Google my friend here?

    --
    -eben QebWenE01R@vTerYizUonI.nOetP royalty.no-ip.org:81
    TAURUS: You will never find true happiness - what you gonna
    do, cry about it? The stars predict tomorrow you'll wake up,
    do a bunch of stuff and then go back to sleep. -- Weird Al

+ Reply to Thread