LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 08-17-2006, 03:13 PM   #1
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Rep: Reputation: 30
'echo -n mem > /sys/power/state' Operation not permitted error


Status of /sys/power/state:
Code:
root@hb-130 ~ $ ls -l /sys/power/
total 0
-rwxrwxrwx 1 root root 0 2006-08-17 15:04 state

root@hb-130 ~ $ cat /sys/power/state
standby mem

root@hb-130 ~ $
My suspend script (many pointers found elsewhere in the forums:
Code:
#!/bin/sh

# discover video card's ID
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# securely create a temporary file
TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15

# switch to virtual terminal 1 to avoid graphics corruption in X
chvt 1

# write all unwritten data (just in case)
sync

# dump current data from the video card to the temporary file
cat /proc/bus/pci/$ID > $TMP_FILE

# unload modules
rmmod uhci_hcd
rmmod ehci_hcd
rmmod ipw2200

# suspend
echo -n mem > /sys/power/state

# wait
sleep 5

# restore video card data from the temporary file on resume
cat $TMP_FILE > /proc/bus/pci/$ID

# remove left-over dhcpcd pid
rm /etc/dhcpc/dhcpcd-eth*.pid

# reload modules
modprobe uhci_hcd
modprobe ehci_hcd
modprobe ipw2200

# switch back to virtual terminal 7 (running X)
chvt 7

# remove temporary file
rm -f $TMP_FILE
Output of script:
Code:
suspend.sh: line 25: echo: write error: Operation not permitted
Now I'm not sure what's holding it back...

Output of lsmod:
Code:
root@hb-130 ~ $ lsmod
Module                  Size  Used by
ipw2200                73024  0
ehci_hcd               18952  0
uhci_hcd               13580  0
rtc                     6580  0
i915                   11264  1
drm                    41236  2 i915
speedstep_centrino      4176  1
sg                     18332  0
snd_seq_oss            19200  0
snd_seq_midi_event      3456  1 snd_seq_oss
snd_seq                29264  4 snd_seq_oss,snd_seq_midi_event
snd_seq_device          3596  2 snd_seq_oss,snd_seq
snd_pcm_oss            25248  0
snd_mixer_oss          10752  3 snd_pcm_oss
xt_tcpudp               2176  1
iptable_mangle          1408  0
ip_conntrack_ftp        3824  0
xt_state                1280  3
iptable_nat             3460  0
ip_nat                  8492  1 iptable_nat
ip_conntrack           25056  4 ip_conntrack_ftp,xt_state,iptable_nat,ip_nat
iptable_filter          1408  1
ip_tables               8420  3 iptable_mangle,iptable_nat,iptable_filter
x_tables                6148  4 xt_tcpudp,xt_state,iptable_nat,ip_tables
nls_iso8859_1           3456  1
ntfs                  165652  1
video                   9732  0
thermal                 7304  3
processor              12388  2 speedstep_centrino,thermal
fuse                   21768  0
fan                     2180  0
button                  3344  0
battery                 5764  4
ac                      2308  0
b44                    13964  0
mii                     3072  1 b44
intel_agp              12572  1
agpgart                16332  3 drm,intel_agp
evdev                   5376  1
joydev                  5696  0
tsdev                   3776  0
snd_hda_intel           8340  2
ieee80211              20680  1 ipw2200
ieee80211_crypt         2432  1 ieee80211
snd_hda_codec          99632  1 snd_hda_intel
snd_pcm                45572  3 snd_pcm_oss,snd_hda_intel,snd_hda_codec
snd_timer              11908  2 snd_seq,snd_pcm
snd                    26596  9 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
soundcore               3936  3 snd
snd_page_alloc          4616  2 snd_hda_intel,snd_pcm

Also, why no 'disk' in /sys/power/state ?
Perhaps its a kernel issue?

Pointers welcome
 
Old 08-18-2006, 12:31 PM   #2
biophysics
Member
 
Registered: Jan 2002
Location: Germany
Distribution: Kubuntu
Posts: 444

Rep: Reputation: 30
I am not sure why you are giving the "-n" in the echo line. Try without it.

Also, I would recommend you to try out suspend2. It is not as complicated as it sounds like. Go to suspend2.net and download the proper patch - and get the latest stable kernel from kernel.org. apply the patches.

1. install hibernate script (from suspend2.net)
2. Test your suspend2.

Look in the wiki of suspend2 - it is written in detail. Suspend2 is NOT just fast but also reliable.

Alternatively, just install the hibernate script - try to suspend with hibernate script.
 
Old 08-18-2006, 01:04 PM   #3
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Original Poster
Rep: Reputation: 30
I'll look into it, the 'echo' command gives the same result with or without -n
 
Old 09-08-2006, 05:41 PM   #4
F_Ruta
LQ Newbie
 
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
'echo -n mem > /sys/power/state' Operation not permitted error

Did you forget the quote around mem?
# suspend
echo -n "mem" > /sys/power/state
 
Old 10-06-2006, 07:06 AM   #5
patrickdepingui
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 53

Rep: Reputation: 15
Did you get a solution for this yet? I am having the exact same problem...
 
Old 10-08-2006, 05:34 PM   #6
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by patrickdepingui
Did you get a solution for this yet? I am having the exact same problem...
Unfortunately I ended up and still am stumped. On Slackware, Zenwalk (Slackware based) this problem persists.... Including Slackware 11.0, which was recently released. One thing I did not try is patching a vanilla kernel with suspend2 (http://suspend2.net) and using that kernel.

However suspend/resume as well as hibernate work perfectly on my laptop under Fedora Core 5 and 6.
 
Old 10-09-2006, 04:04 AM   #7
patrickdepingui
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 53

Rep: Reputation: 15
Quote:
Originally Posted by hollywoodb
Unfortunately I ended up and still am stumped. On Slackware, Zenwalk (Slackware based) this problem persists.... Including Slackware 11.0, which was recently released. One thing I did not try is patching a vanilla kernel with suspend2 (http://suspend2.net) and using that kernel.

However suspend/resume as well as hibernate work perfectly on my laptop under Fedora Core 5 and 6.
Luckily I found a solution myself two days ago...
I have a Core Duo laptop, and chances are high you do as well. For hibernate and standby to work on a dual core system, the kernel needs support for "hotpluggable cpu's". I didn't had this enabled in my kernel config...

When patching the kernel with suspend2, they automatically select this option, but I believe that it is not necessary to suspend2 if you don't want to...

After adding the CONFIG_HOTPLUG_CPU option, I was able to write to /sys/power/state ...
Hopefully this works for you too...
 
Old 10-09-2006, 02:45 PM   #8
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by patrickdepingui
Luckily I found a solution myself two days ago...
I have a Core Duo laptop, and chances are high you do as well. For hibernate and standby to work on a dual core system, the kernel needs support for "hotpluggable cpu's". I didn't had this enabled in my kernel config...

When patching the kernel with suspend2, they automatically select this option, but I believe that it is not necessary to suspend2 if you don't want to...

After adding the CONFIG_HOTPLUG_CPU option, I was able to write to /sys/power/state ...
Hopefully this works for you too...

Like I said, I didn't try suspend2, although I suspect it would have worked based on the information I've seen regarding it.

Actually my system is a Pentium M 1.8GHz, single core, no hyper-threading or anything fancy like that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAT32 error operation not permitted Maverick1182 Mandriva 5 06-23-2006 02:09 AM
(echo -n "standby" > /sys/power/state) only allowed for root? brynjarh Debian 5 02-14-2005 09:08 AM
mknod gives Operation Not Permitted error choobad Linux - Software 2 07-13-2004 06:46 AM
Power Management(sysfs) /sys/power/state mavrick613 Linux - General 0 05-24-2004 03:04 PM
Type Read: Operation Not Permitted Error Snabber Linux - Newbie 5 06-05-2003 09:02 PM


All times are GMT -5. The time now is 06:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration