# hibernate-script: /bin/echo: write error: device busy

## LoTeK

hi,

after an hour of googling I have to ask this question, because I haven't very much time at the moment for gentoo and I urgently need the hibernate-ram feature   :Sad: 

since a week everytime when I enter "hibernate-ram" then my laptop tries to hibernate but wakes up a second later with the error message:

```
/bin/echo: write error: device or resource busy
```

any ideas?

----------

## Hu

What did you change about a week ago?  I suspect you disabled your ability to suspend to RAM, possibly by building a kernel which lacked that feature.

----------

## syn0ptik

 *Hu wrote:*   

> What did you change about a week ago?  I suspect you disabled your ability to suspend to RAM, possibly by building a kernel which lacked that feature.

 

What do you mean of kernel feature?

If enabled

```
CONFIG_ARCH_HIBERNATION_POSSIBLE=y

CONFIG_ARCH_HIBERNATION_HEADER=y

CONFIG_HIBERNATION=y

```

That will work?

Not try yet.

----------

## LoTeK

 *Quote:*   

> What did you change about a week ago? I suspect you disabled your ability to suspend to RAM, possibly by building a kernel which lacked that feature.

 

I don't remember (I always say: as from now I will log every change and then I don't do it   :Smile:  ). I've read something about disabling ACPI-support but it was an old article and secondly I had ACPI enabled before when it worked.

 *Quote:*   

> 
> 
> What do you mean of kernel feature?
> 
> If enabled
> ...

 

I have those features enabled and it doesn't work.

----------

## Hu

Hibernation is not S3.  Suspend is S3.

----------

## LoTeK

 *Quote:*   

> Hibernation is not S3. Suspend is S3.

 

?   :Embarassed: 

Is it correct that when you execute hibernate (from the hibernate script) then everything is written to the disk and it's nearly the same as shutting down your computer (from the "boot-time" and "energy-consuming" viewpoint) so this would be hibernate, but when you execute hibernate-ram (like I do) then everything is written to RAM and it's way faster to boot up again, so this would be suspend?

edit: could my problem be associated with the laptop-mode-tools?

edit: I've read about the sleep states, and I need S3 because S4 costs as much time as a reboot.

----------

## Hu

 *LoTeK wrote:*   

> Is it correct that when you execute hibernate (from the hibernate script) then everything is written to the disk and it's nearly the same as shutting down your computer (from the "boot-time" and "energy-consuming" viewpoint) so this would be hibernate, but when you execute hibernate-ram (like I do) then everything is written to RAM and it's way faster to boot up again, so this would be suspend?

 Everything is already in RAM, so entering S3 does not require copying.

 *LoTeK wrote:*   

> edit: could my problem be associated with the laptop-mode-tools?

 Possibly, but my guess is still on the idea that you reconfigured your kernel to remove support for suspend.

 *LoTeK wrote:*   

> edit: I've read about the sleep states, and I need S3 because S4 costs as much time as a reboot.

 S4 costs as much pre-Linux time as a reboot, but it restores all your application state, so once you finish loading the resume image, all your programs are ready.

----------

## LoTeK

 *Quote:*   

> Possibly, but my guess is still on the idea that you reconfigured your kernel to remove support for suspend. 

 

strange, because:

grep SUSPEND /usr/src/linux/.config:

```
CONFIG_ARCH_SUSPEND_POSSIBLE=y

CONFIG_SUSPEND=y

CONFIG_SUSPEND_FREEZER=y

CONFIG_PM_TEST_SUSPEND=y

# CONFIG_USB_SUSPEND is not set
```

the whole /usr/src/linux/.config:

http://bpaste.net/show/82688/

----------

## Hu

Are you sure that /usr/src/linux/.config corresponds to the kernel exhibiting the problem?  You never stated the version of the troublesome kernel, so I cannot even check that this is the right version.

----------

## LoTeK

 *Quote:*   

> Are you sure that /usr/src/linux/.config corresponds to the kernel exhibiting the problem?

 

yes because I recompiled the kernel yesterday and then I run:

```
cp arch/x86_64/boot/bzImage /boot/kernel-3.7.5-hardened-default
```

and then I've booted this kernel!

output of uname -a:

```
Linux M2-01 3.7.5-hardened #6 SMP Sat Mar 9 18:27:53 CET 2013 x86_64 Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz GenuineIntel GNU/Linux
```

----------

## toralf

Run 

```
echo 0 > /sys/power/image_size
```

and check if s2ram/s2disk now works.

----------

## LoTeK

I run it and unfortunately it still doesn't work. (first I run your code-suggestion, then hibernate-ram). 

According to this website:

http://www.gentoo-wiki.info/Power_Management

I've run:

```
cat /sys/power/state
```

and the output was:

```
mem disk
```

then I've run:

```
 echo -n "mem" > /sys/power/state
```

and the same error message appeared and the application sys-power/s2ram is not available anymore.

----------

## syn0ptik

```
echo disk > /sys/power/state
```

works to me, it show procents of swapping on disk partition

but after 

```
echo mem > /sys/power/state
```

it shutoff laptop and after wakeup I can see the black screen only.

No procents I see with swapping to memory.

----------

## syn0ptik

hi all,

I want continue it.

I cant restore statefrom swap after reboot swap is on and awailable in fstsb since initrd boot.

How insist for system read swap for recover saved state on it?

----------

## khayyam

 *LoTeK wrote:*   

> [..] sys-power/s2ram is not available anymore.

 

LoTeK ... s2ram is part of sys-power/suspend ... but development of s2ram has been discontinued, I assume as many have moved to using sys-power/hibernate-script.

best ... khay

----------

## LoTeK

 *Quote:*   

> I want continue it. 

 

me too, I haven't made any progression.   :Smile: 

 *Quote:*   

> 
> 
> LoTeK ... s2ram is part of sys-power/suspend ... but development of s2ram has been discontinued, I assume as many have moved to using sys-power/hibernate-script. 

 

ok thanks, so I have so stay with hibernate-script and solve my problem...

----------

## syn0ptik

here

https://forums.gentoo.org/viewtopic-t-874959-highlight-sys+power+state.html

 *Quote:*   

> You can also use s2disk from sys-power/suspend in a stock kernel if you enable the hibernation options.

 

echo disk > /sys/power/state loos like enough for hibernate, questions in why system is not read existen parked as saved to swap hibernate dumb memory.

Also I've tryed option resume=swap:/dev/sda8, anyway it's not working. System not start read swap partition on boot.

LoTeK,

if you looking for any way to making it work you can try this

http://wiki.linuxformat.ru/index.php/LXF97:Hibernate

for me hibernate to swap is okay and I want todo that it this way.

:edit

okay, resume=/dev/sda2 work for me, hibernate enveloped from swap partition after I boot it.

----------

