hibernate and swap partition size (newbie question) - Debian

This is a discussion on hibernate and swap partition size (newbie question) - Debian ; >From what I've read online, I get the general idea that in order to be able to hibernate/suspend to disk properly, the swap partition has to be big enough to hold all of the RAM inside it, right? Is it ...

+ Reply to Thread
Results 1 to 14 of 14

Thread: hibernate and swap partition size (newbie question)

  1. hibernate and swap partition size (newbie question)

    >From what I've read online, I get the general idea that in order to be
    able to hibernate/suspend to disk properly, the swap partition has to
    be big enough to hold all of the RAM inside it, right?

    Is it possible to hibernate if my swap partition is smaller than my
    RAM? I have 2 GB of RAM, and when I installed Debian, I figured I
    would hardly ever need that much, so I made swap 1.4 GB.

    Just a bit of extra information:
    I tried a sudo pm-hibernate today, and it ran fine. I saw s2disk
    running, and then the computer powered off without any errors. I
    pressed the power button to turn it back on, and the computer got past
    grub, saw the saved file, and began resuming from it. After that
    though, all I got was a black screen and a bunch of beeps. I ended up
    having to force a reboot with Alt+SysRq.

    I am trying to figure out if my swap partition size has anything to do
    with it. I tend to think no, because if it was too small, it
    shouldn't have been able to hibernate. And the more stuff I read
    online about swsusp, uswsusp, suspend 2 etc, the more confused I get

    I am running Debian Sid on a Thinkpad T61, in case that matters.
    Also, I am running Xfce4 so i do not have the gnome-power-manager.

    Thanks in advance!

    Jimmy
    --
    Registered Linux User #454138


    --
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. Re: hibernate and swap partition size (newbie question)

    On Thu, Feb 21, 2008 at 11:47 PM, Rich Healey wrote:
    [...]
    > Jimmy Wu wrote:
    > >>From what I've read online, I get the general idea that in order to be

    > > able to hibernate/suspend to disk properly, the swap partition has to
    > > be big enough to hold all of the RAM inside it, right?

    [...]
    > Yes, you'll need to have the same sized swap as RAM, although from
    > memory there is a way to force it to do it with less...


    All right, I'll look into that. What I can't figure out is why the
    actual hibernate part (setting restore point) seems to have worked.

    > Actually this is a useless post, sorry


    well, I wouldn't say that. All responses are appreciated.

    Thanks again,
    --
    Jimmy
    Registered Linux User #454138


    --
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  3. Re: hibernate and swap partition size (newbie question)

    On Fri, Feb 22, 2008 at 12:07 AM, Jimmy Wu wrote:
    > On Thu, Feb 21, 2008 at 11:47 PM, Rich Healey wrote:
    > [...]
    >
    > > Jimmy Wu wrote:
    > > >>From what I've read online, I get the general idea that in order to be
    > > > able to hibernate/suspend to disk properly, the swap partition has to
    > > > be big enough to hold all of the RAM inside it, right?

    > [...]
    >
    > > Yes, you'll need to have the same sized swap as RAM, although from
    > > memory there is a way to force it to do it with less...

    >
    > All right, I'll look into that. What I can't figure out is why the
    > actual hibernate part (setting restore point) seems to have worked.


    Just found this article about using swap files instead of swap partitions
    http://www.debian-administration.org/articles/550

    Not really what you were saying, but I suppose it might work. But
    first I have to figure out if it really is inadequate swap that's
    giving me grief.

    --
    Jimmy Wu
    Registered Linux User #454138


    --
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  4. Re: hibernate and swap partition size (newbie question)

    Is High memory support turned on in the kernel? This could explain why
    hibernation is working whilst you have 2gig's in the system.

    Processor type and features
    -----> High Memory Support




    On Thu, Feb 21, 2008 at 9:11 PM, Jimmy Wu
    wrote:

    > On Fri, Feb 22, 2008 at 12:07 AM, Jimmy Wu
    > wrote:
    > > On Thu, Feb 21, 2008 at 11:47 PM, Rich Healey

    > wrote:
    > > [...]
    > >
    > > > Jimmy Wu wrote:
    > > > >>From what I've read online, I get the general idea that in order

    > to be
    > > > > able to hibernate/suspend to disk properly, the swap partition has

    > to
    > > > > be big enough to hold all of the RAM inside it, right?

    > > [...]
    > >
    > > > Yes, you'll need to have the same sized swap as RAM, although from
    > > > memory there is a way to force it to do it with less...

    > >
    > > All right, I'll look into that. What I can't figure out is why the
    > > actual hibernate part (setting restore point) seems to have worked.

    >
    > Just found this article about using swap files instead of swap partitions
    > http://www.debian-administration.org/articles/550
    >
    > Not really what you were saying, but I suppose it might work. But
    > first I have to figure out if it really is inadequate swap that's
    > giving me grief.
    >
    > --
    > Jimmy Wu
    > Registered Linux User #454138
    >
    >
    > --
    > To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    > with a subject of "unsubscribe". Trouble? Contact
    > listmaster@lists.debian.org
    >
    >



  5. Re: hibernate and swap partition size (newbie question)

    Jimmy Wu wrote:
    > From what I've read online, I get the general idea that in order to be
    > able to hibernate/suspend to disk properly, the swap partition has to
    > be big enough to hold all of the RAM inside it, right?
    >
    > Is it possible to hibernate if my swap partition is smaller than my
    > RAM? I have 2 GB of RAM, and when I installed Debian, I figured I
    > would hardly ever need that much, so I made swap 1.4 GB.


    IIRC the ram image is compressed using lzw compression. Therefore it
    actually depends upon how well things compress. If you have good
    compression then it would fit. But if not then it wouldn't. But it
    is data dependent upon what is in ram at the moment. Using lzw is not
    really intended to reduce the amount of disk needed but is done as a
    way to speed up the hibernate process. Writing disk is slow and if
    that can be reduced then hibernation is faster. But it might work to
    your advantage anyway.

    With the big disks available these days it is actually a good idea to
    have enough swap to avoid the out of memory killer. Search for oom
    and you will find a number of problems with it. Having enough virtual
    memory to avoid triggering it is a good thing.

    Bob

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHvm+e0pRcO8E2ULYRApOgAJwMHP6Yh6RUaHq5Z189//sUM8SI9QCdGqXR
    8h/8h3Dq+EFAlGlE6UhXET4=
    =OzQ+
    -----END PGP SIGNATURE-----


  6. Re: hibernate and swap partition size (newbie question)

    On Fri, Feb 22, 2008 at 12:11:54AM -0500, Jimmy Wu wrote:
    >
    > Not really what you were saying, but I suppose it might work. But
    > first I have to figure out if it really is inadequate swap that's
    > giving me grief.


    I would assume that upon doing a fresh boot-up you would be using much
    less memory than your available swap partition. (You can check and
    confirm using, say, top.) Then if you try suspending and still have the
    same problems when resuming, I think it would be a good indicator that
    your problems lie elsewhere.

    Selim Erdo─čan


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  7. Re: hibernate and swap partition size (newbie question)

    On 22/02/2008, Bob Proulx wrote:
    > Jimmy Wu wrote:
    > > From what I've read online, I get the general idea that in order to be
    > > able to hibernate/suspend to disk properly, the swap partition has to
    > > be big enough to hold all of the RAM inside it, right?
    > >
    > > Is it possible to hibernate if my swap partition is smaller than my
    > > RAM? I have 2 GB of RAM, and when I installed Debian, I figured I
    > > would hardly ever need that much, so I made swap 1.4 GB.

    >
    > IIRC the ram image is compressed using lzw compression. Therefore it
    > actually depends upon how well things compress. If you have good
    > compression then it would fit. But if not then it wouldn't. But it
    > is data dependent upon what is in ram at the moment. Using lzw is not
    > really intended to reduce the amount of disk needed but is done as a
    > way to speed up the hibernate process. Writing disk is slow and if
    > that can be reduced then hibernation is faster. But it might work to
    > your advantage anyway.


    Is it me or you also need big enough /tmp. I installed lenny 64 with
    /tmp of 512mb with ram of 2gb suspend/hibernate would not work. On a
    reinstall (for some other reason) I made /tmp 2.5gb now both work.
    Puzzled...

    --
    Regards,
    Sudev Barar

    Read http://blog.sudev.in for topics ranging from here to there.


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  8. Re: hibernate and swap partition size (newbie question)

    Jimmy Wu wrote:

    >>From what I've read online, I get the general idea that in order to be

    > able to hibernate/suspend to disk properly, the swap partition has to
    > be big enough to hold all of the RAM inside it, right?
    >
    > Is it possible to hibernate if my swap partition is smaller than my
    > RAM? I have 2 GB of RAM, and when I installed Debian, I figured I
    > would hardly ever need that much, so I made swap 1.4 GB.
    >


    Are you aware that you can resize your partitions non destructively using
    something like qtparted? First backup all your data before you do anything
    like this. This is what I did when I found out that my RAM size is larger
    than my swap partition.

    raju
    --
    Kamaraju S Kusumanchi
    http://www.people.cornell.edu/pages/kk288/
    http://malayamaarutham.blogspot.com/


    --
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  9. Re: hibernate and swap partition size (newbie question)

    On Fri, Feb 22, 2008 at 1:07 AM, Chris Riley wrote:
    > Is High memory support turned on in the kernel? This could explain why
    > hibernation is working whilst you have 2gig's in the system.
    >
    > Processor type and features
    > -----> High Memory Support
    >



    I remember seeing such a menu from compiling a kernel once, but I
    don't remember how I got to it.

    Instead I did this:

    jimmy@jimmy-laptop:/boot$ grep HIGH config-2.6.24-1-686
    CONFIG_HIGH_RES_TIMERS=y
    # CONFIG_NOHIGHMEM is not set
    CONFIG_HIGHMEM4G=y
    # CONFIG_HIGHMEM64G is not set
    CONFIG_HIGHMEM=y
    # CONFIG_HIGHPTE is not set
    # CONFIG_DEBUG_HIGHMEM is not set


    --
    Jimmy Wu
    Registered Linux User #454138


    --
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  10. Re: hibernate and swap partition size (newbie question)

    On Fri, Feb 22, 2008 at 7:52 AM, Kamaraju S Kusumanchi
    wrote:
    > Jimmy Wu wrote:
    >
    > >>From what I've read online, I get the general idea that in order to be

    > > able to hibernate/suspend to disk properly, the swap partition has to
    > > be big enough to hold all of the RAM inside it, right?
    > >
    > > Is it possible to hibernate if my swap partition is smaller than my
    > > RAM? I have 2 GB of RAM, and when I installed Debian, I figured I
    > > would hardly ever need that much, so I made swap 1.4 GB.
    > >

    >
    > Are you aware that you can resize your partitions non destructively using
    > something like qtparted? First backup all your data before you do anything
    > like this. This is what I did when I found out that my RAM size is larger
    > than my swap partition.


    I always thought resizing or doing any partition editing carried some
    risk of losing data (ie no guarantees), but perhaps ext3 is different.

    Anyways, I think I have ruled out the low swap explanation:

    On Fri, Feb 22, 2008 at 2:19 AM, Selim T. Erdogan wrote:
    > On Fri, Feb 22, 2008 at 12:11:54AM -0500, Jimmy Wu wrote:
    > >
    > > Not really what you were saying, but I suppose it might work. But
    > > first I have to figure out if it really is inadequate swap that's
    > > giving me grief.

    >
    > I would assume that upon doing a fresh boot-up you would be using much
    > less memory than your available swap partition. (You can check and
    > confirm using, say, top.) Then if you try suspending and still have the
    > same problems when resuming, I think it would be a good indicator that
    > your problems lie elsewhere.


    Right after boot, I logged in to tty1 and did a sudo pm-hibernate
    While staring at the screen for messages, I noticed that the snapshot
    image was less than 400 MB, and it correctly determined free swap as
    just short of 1.4 GB - so swap is more than enough.

    On resume, I got a lot of beeps, but after waiting for like 2-3
    minutes or so, I was back at my console prompt. However, when I tried
    to switch over to gdm on tty7, the screen is black, system goes
    unresponsive, and I can't get back to my tty1 anymore.

    Just as an experiment, I did a sudo hibernate -v3 > hibernate.out, and
    it says that it was unable to unload nvidia and aborts hibernation
    (see attached file). So I guess pm-hibernate kind of went ahead and
    shut down without properly taking care of nvidia, so that is why I had
    an unresponsive X server on resume, right? If that's what's happening,
    is there any way to get nvidia properly unloaded? I am running a
    stock kernel, and have nvidia installed from the Debian repositories.

    Also, there's a script in this article I found:
    http://www.linux.com/feature/114220. I never like running scripts
    that I don't understand, and I was wondering if whatever it's doing
    with the video card solve my problem?

    Thanks again for everyone's help and responses
    --
    Jimmy Wu
    Registered Linux User #454138


  11. Re: hibernate and swap partition size (newbie question)

    On Fri, Feb 22, 2008 at 12:15 PM, Jimmy Wu wrote:
    > Just as an experiment, I did a sudo hibernate -v3 > hibernate.out, and
    > it says that it was unable to unload nvidia and aborts hibernation
    > (see attached file). So I guess pm-hibernate kind of went ahead and
    > shut down without properly taking care of nvidia, so that is why I had
    > an unresponsive X server on resume, right? If that's what's happening,
    > is there any way to get nvidia properly unloaded? I am running a
    > stock kernel, and have nvidia installed from the Debian repositories.
    >
    > Also, there's a script in this article I found:
    > http://www.linux.com/feature/114220. I never like running scripts
    > that I don't understand, and I was wondering if whatever it's doing
    > with the video card solve my problem?


    An update: tried the script, and no it did not solve suspend to disk issues.
    After a bit of searching on Google, I am pretty much sure that it is
    the nvidia driver that is causing problems (and not insufficient
    swap). None of the workarounds Google turned up seem to work for me,
    though.
    Anyways, I've subscribed to the linux-thinkpad mailing list and posted
    my questions there.

    Thanks for the responses,
    --
    Jimmy Wu
    Registered Linux User #454138


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  12. Re: hibernate and swap partition size (newbie question)

    Jimmy Wu wrote:

    > I always thought resizing or doing any partition editing carried some
    > risk of losing data (ie no guarantees), but perhaps ext3 is different.
    >


    The "no guarantees" disclaimer goes with pretty much all of the GPL
    software. The users always have to make backups. No software is 100% bug
    free.

    > Anyways, I think I have ruled out the low swap explanation:
    >


    ok.

    --
    Kamaraju S Kusumanchi
    http://www.people.cornell.edu/pages/kk288/
    http://malayamaarutham.blogspot.com/


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  13. Re: hibernate and swap partition size (newbie question)

    On Wed, Feb 27, 2008 at 1:18 PM, Kamaraju S Kusumanchi <
    kamaraju@bluebottle.com> wrote:

    > Tyler Smith wrote:
    >
    > > On 2008-02-22, Kamaraju S Kusumanchi wrote:
    > >>
    > >> Are you aware that you can resize your partitions non destructively

    > using
    > >> something like qtparted? First backup all your data before you do
    > >> anything like this. This is what I did when I found out that my RAM

    > size
    > >> is larger than my swap partition.
    > >>

    > >
    > > Please correct me if I'm wrong, but I think the options for resizing
    > > partitions without losing data is pretty limited. I recently went
    > > through a round of resizing, and while I could move swap into adjacent
    > > unused space, I could only alter the end of a data partition. i.e., I
    > > could make an existing partition bigger or smaller, but I could not
    > > move it.
    > >

    >
    > I do not know. It has been some time I did this. It worked at that time
    > and
    > I did not bother to dig deeply into it. May be other people on the list
    > know it better.
    >
    > > ps - your message was flagged follow-up-to gmane.linux.debian.user,
    > > which was rejected by slrn as an invalid newsgroup. I don't know if
    > > this is a problem at my end or your end...

    >
    > gmane.linux.debian.user is the news group's name. I am accessing d-u via
    > gmane's news server. Sorry to say, but I think the problem is at your end.
    > But feel free to correct me if I am wrong.
    >
    > raju
    > --
    > Kamaraju S Kusumanchi
    > http://www.people.cornell.edu/pages/kk288/
    > http://malayamaarutham.blogspot.com/
    >
    >
    > --
    > To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    > with a subject of "unsubscribe". Trouble? Contact
    > listmaster@lists.debian.org
    >
    > my advice would be to get gparted.. i've resized hundreds of partitions

    of different fs types and not had any lost files, excepting power failure,
    me kicking the box out of boredom etc...


  14. Re: hibernate and swap partition size (newbie question)

    what about vista ntfs partitions if someone is duel booting?

    On Wed, Feb 27, 2008 at 1:48 PM, Rich Healey wrote:

    >
    >
    > On Wed, Feb 27, 2008 at 1:18 PM, Kamaraju S Kusumanchi <
    > kamaraju@bluebottle.com> wrote:
    >
    > > Tyler Smith wrote:
    > >
    > > > On 2008-02-22, Kamaraju S Kusumanchi wrote:
    > > >>
    > > >> Are you aware that you can resize your partitions non destructively

    > > using
    > > >> something like qtparted? First backup all your data before you do
    > > >> anything like this. This is what I did when I found out that my RAM

    > > size
    > > >> is larger than my swap partition.
    > > >>
    > > >
    > > > Please correct me if I'm wrong, but I think the options for resizing
    > > > partitions without losing data is pretty limited. I recently went
    > > > through a round of resizing, and while I could move swap into adjacent
    > > > unused space, I could only alter the end of a data partition. i.e., I
    > > > could make an existing partition bigger or smaller, but I could not
    > > > move it.
    > > >

    > >
    > > I do not know. It has been some time I did this. It worked at that time
    > > and
    > > I did not bother to dig deeply into it. May be other people on the list
    > > know it better.
    > >
    > > > ps - your message was flagged follow-up-to gmane.linux.debian.user,
    > > > which was rejected by slrn as an invalid newsgroup. I don't know if
    > > > this is a problem at my end or your end...

    > >
    > > gmane.linux.debian.user is the news group's name. I am accessing d-u via
    > > gmane's news server. Sorry to say, but I think the problem is at your
    > > end.
    > > But feel free to correct me if I am wrong.
    > >
    > > raju
    > > --
    > > Kamaraju S Kusumanchi
    > > http://www.people.cornell.edu/pages/kk288/
    > > http://malayamaarutham.blogspot.com/
    > >
    > >
    > > --
    > > To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
    > > with a subject of "unsubscribe". Trouble? Contact
    > > listmaster@lists.debian.org
    > >
    > > my advice would be to get gparted.. i've resized hundreds of partitions

    > of different fs types and not had any lost files, excepting power failure,
    > me kicking the box out of boredom etc...
    >



+ Reply to Thread