# Suspend to disk

## gsfgf

Is there a way to do suspend to disk?  I have apm installed, but it doesn't do hibernate.  What do i need?

Vaio F580.

----------

## insomniac

See http://www.linux-on-laptops.com/sony.html and see if you can find your model 

One way to enable hibernation is to use the swsusp kernel patch, which is included in the 2.5.25 kernel, i believe. This works with any computer regardless of hibernation support in the BIOS, and does not require a hibernation file of any sort. However, the patch I use is a little flaky on my Thinkpad T20 - after resumiung my clock just stops, my soundcard doesn't work and neither does USB. Apart from that it is fully usable. So if you can set your clock, don't use any USB devices and don't need sound, you can use swsusp. (The issues may be resolved in the current patch).

The biggest advantage of swsusp is that you can dual-hibernate the computer between Windows and Linux - the hibernation files do not disturb each other and you never have to reboot.

Another way is to set up a hibernation file or partition (depends on your computer and model which one you need...) and get hibernation working through the computers bios. I've tried this on my thinkpad as well - works fine but was a bit hard to set up - I had to create a hibernation file on a bootable primary fat32 partition with a special, hard-to-find utility available from IBM-s website. This works fine as well, and I can hibernate with Fn+F12 - just like in Windows. The downside (?) is that I am not able to hibernate and bring Windows up, then hibernate windows and bring back the hibernated Linux, as I am able to with swsusp...

----------

## gsfgf

ok, i'm confused.  I don't want swsup since i don't even have windows, and don't want to deal w/ the problems.  (I need sound).  I can suspend to memory just by hitting the power button ort Fn+F12, what do i do from there to enable save to disk.  I don't know what partition i need.  can you tell from the partition info if hda1 (it seems to have a bunch of filesystems on it left over from various windowses).  Phoenix's site also said i can suspend to a file which i thionk may be the way it was done under win2k since i formatted the entire disk.

Partition info - might be useless

```
Disk /dev/hda1: 255 heads, 63 sectors, 12 cylinders

Units = cylinders of 16065 * 512 bytes

     Device Boot    Start       End    Blocks   Id  System

/dev/hda1p1   ?    116388    126889  84344761   69  Unknown

Partition 1 has different physical/logical beginnings (non-Linux?):

     phys=(68, 13, 10) logical=(116387, 225, 36)

Partition 1 has different physical/logical endings:

     phys=(288, 115, 43) logical=(126888, 82, 1)

Partition 1 does not end on cylinder boundary:

     phys=(288, 115, 43) should be (288, 254, 63)

/dev/hda1p2   ?    105915    222310 934940732+  73  Unknown

Partition 2 has different physical/logical beginnings (non-Linux?):

     phys=(371, 114, 37) logical=(105914, 175, 47)

Partition 2 has different physical/logical endings:

     phys=(366, 32, 33) logical=(222309, 108, 57)

Partition 2 does not end on cylinder boundary:

     phys=(366, 32, 33) should be (366, 254, 63)

/dev/hda1p3   ?         1         1         0   74  Unknown

Partition 3 has different physical/logical beginnings (non-Linux?):

     phys=(371, 114, 37) logical=(0, 40, 54)

Partition 3 has different physical/logical endings:

     phys=(372, 97, 50) logical=(0, 40, 53)

Partition 3 does not end on cylinder boundary:

     phys=(372, 97, 50) should be (372, 254, 63)

/dev/hda1p4        179626    179629     26207+   0  Empty

Partition 4 has different physical/logical beginnings (non-Linux?):

     phys=(0, 0, 0) logical=(179625, 87, 47)

Partition 4 has different physical/logical endings:

     phys=(0, 0, 0) logical=(179628, 154, 45)

Partition 4 does not end on cylinder boundary:

     phys=(0, 0, 0) should be (0, 254, 63)

Partition table entries are not in disk order

```

----------

## insomniac

So you'd rather have hibernation working than swsusp.

First of all - I think your partition table looks strange - you'd probably be better off fixing it before you try messing with hibernation... 

There is a utility called 'lphdisk' which works for Phoenix bioses (i think) - try searching Google for clues and see if anyone else has succeeded... I think you can use it to create hibernation files or partitions...

----------

## gsfgf

ok.  i got the lphdisk, split my swap (which i've never used) to make room and am ready to make the partition type a0.  How do i do that?  there is no mka0fs command.

----------

## zojas

don't dismiss swsusp so quickly. they have it for the 2.4.18 kernel, too, as a patch. my buddy put it on his laptop. it just uses your swap partition. he's the kind of person that will suspend, then leave it sitting for a few days. it works quite nicely.

----------

## gsfgf

My laptop supports suspend w/ the bios and apparantly it works so i'll try that first.

----------

## insomniac

I'm not sure about the Vaio, but on my thinkpad I had to make a hibernation file (not a partition) and it had to reside on a

*bootable

*primary

*fat (16|32)

partition, at least the size of the computer's RAM + video memory. 

I.e if you have 128 Mb RAM and 8 Mb on your video card, 128+8=136 - make the partition at least 150 Mb... I don't know if lphdisk takes care of this though... and you might have to use a hibernation _partition_ instead of a file... Check with the Vaio community (Google?) for clues!

----------

## gsfgf

i got it.  is there a way to make it power my pcmcia card back on and rerun dhcpcd eth0 automatically or will i need to do that manually everytime it wakes up.  Other than that it works perfectly.  woohoo!!!

----------

## aardvark

if you try the "mjc-sources" in portage, you will find a hibernation-kinda thingy. I believe it is swsusp as stated before, but then in a kernel that our gentoo dev offer us!

I must admit, I haven't tried it as I have a desktop system and furthermore because I cant get my powerbutton to be read out in /proc using the acpi option in the kernel.

Maybe you can bake a kernel with those sources and check it out!

----------

## gsfgf

I'd consider that, but i've got it working and i've had bad experiance fixing things that ain't broke.  Plus, i need xfs support.

----------

## Hole

Very few Vaios have the suspend to disk in the BIOS. swsusp is the only option on the modern Vaios

----------

