You are not logged in.

#1 2010-06-08 11:58:39

Evengard
Member
Registered: 2010-06-08
Posts: 2

Hibernate/suspend problems

Hello to everyone! I have a bit unusual problem... Firstly I am new to Arch, but not to Linux, so basically I feel good with it...
But. I have a FireWire external hard drive. Configured to be mounted as /home - and basically it works well. But!
When I do a suspend to ram - the hard drive switches offline - and it is logical - power saving policy.
On resume it switch on automatically, but... It doesn't remount automaticaly, so I have after resume all my dmesg contemplating about failures of write to the disk. Basically a "sudo mount -a" solve it (the system reinitialize the drive and assing it a new device name, /dev/sdg for example instead of /dev/sdb, but in the fstab I have configured it by UUID - so no problems).
Now, the big question: how to "pause" the resuming from RAM to wait until the device is settled and to mount it then, and ONLY THEN resume the whole system? I have pm-utils, I tried a hook like this:

#!/bin/bash
case $1 in
    hibernate)
        
        ;;
    suspend)
        
        ;;
    thaw)
        sleep 10
        mount -a
        ;;
    resume)
        sleep 10
        mount -a
        ;;
    *)  
        ;;
esac

placed in /etc/pm/sleep.d/00restoreHardDrives (chmoded +x, so basically it should work, and even more - I was happy and one time it succeeded)
But even when it succeeded - it doesn't wait the 10 seconds, it continues to resume the system - so my programs are still contemplating about disk I/O failures... And the succeed rate is quite low - apparently 10 seconds isn't enough. So what is why I want to firstly make sure that all devices are settled correctly, and only then run the mount  -a... (something like the sysinit_udevsettled hook in rc.sysinit) Can you help me please?

Also, I have modified my menu.lst (of GRUB) and added a restore=/dev/disk/by-uuid/*** (my swap partition, which is big enough to contain the RAM), but when the system reboots after hibernating - the kernel just ignores it. Should I recompile it, or install some kind of module/enable a hook/regenerate CPIO file? I thougth it was built in...

Please help!

Offline

#2 2010-06-08 13:04:00

benmorgan
Member
From: Germany
Registered: 2006-07-28
Posts: 67

Re: Hibernate/suspend problems

Hey, I don't know if this helps you — I'll just tell you what works for me:
1. in menu.lst I have resume=/dev/sda2 (the difference here being that I use resume and not restore)
dunno if that makes a difference.
2. in mkinitcpio.conf you need to add the 'resume' hook and then regenerate the image (mkinitcpio -p kernel26). The resume hook needs to come before the filesystems hook! I have this:
HOOKS="base udev pata autodetect resume filesystems v86d"

Hope this helps you a little.

Offline

#3 2010-06-08 17:12:23

Evengard
Member
Registered: 2010-06-08
Posts: 2

Re: Hibernate/suspend problems

Thank you, benmorgan! Now suspend to hard drive works well... After adding the hook and regenerating the image smile
Now, I need to find out how to solve my second problem...

Offline

Board footer

Powered by FluxBB