Page 1 of 1

optimizing power drain

PostPosted: Mar 19th, '13, 00:47
by djmarian
Hi,

great performance i get latelly with updates from beta 3, but i was wondering about a hdd i don't use allot
i found something to spin it down

/etc/rc.d/rc.local file
#Spin down hard disks after 1 minute..
/sbin/hdparm -S12 /dev/sda
/sbin/hdparm -S12 /dev/sdb

but i don't find the file
also any ideas on reducing power drain are wellcomed

and off topic, how do i stop mageia for waiting during boot for this hdd if i remove it, do i just delete it from fstab?

Re: optimizing power drain

PostPosted: Mar 19th, '13, 20:11
by doktor5000
Which file you can't find? For /etc/rc.local, that's a symlink to the actual file /etc/rc.d/rc.local:
Code: Select all
[doktor5000@Mageia2 ~]$ ls -la /etc/rc.local
lrwxrwxrwx 1 root root 13 Jun 17  2012 /etc/rc.local -> rc.d/rc.local


But maybe what you want is /etc/sysconfig/harddisks ?

Re: optimizing power drain

PostPosted: Mar 26th, '13, 01:36
by djmarian
doktor5000 wrote:Which file you can't find? For /etc/rc.local, that's a symlink to the actual file /etc/rc.d/rc.local:
Code: Select all
[doktor5000@Mageia2 ~]$ ls -la /etc/rc.local
lrwxrwxrwx 1 root root 13 Jun 17  2012 /etc/rc.local -> rc.d/rc.local


But maybe what you want is /etc/sysconfig/harddisks ?


well, no chance with these files, i did not find any of them

Re: optimizing power drain

PostPosted: Mar 26th, '13, 07:53
by doktor5000
How did you search them? Please show the output of
Code: Select all
cat /etc/rc.local
and
Code: Select all
cat /etc/sysconfig/harddisks


Either you don't have hdparm installed (for /etc/sysconfig/harddisks)
Code: Select all
[doktor5000@Mageia2 ~]$ rpm -qf /etc/sysconfig/harddisks
hdparm-9.39-1.mga2

but if you don't have the other file, your system seems severely broken, as that belongs to initscripts package:
Code: Select all
[doktor5000@Mageia2 ~]$ rpm -qf /etc/rc.local
initscripts-9.34-20.mga2
[doktor5000@Mageia2 ~]$ rpm -qf /etc/rc.d/rc.local
initscripts-9.34-20.mga2

Re: optimizing power drain

PostPosted: Mar 26th, '13, 08:40
by Ken-Bergen
doktor5000

He's running MGA3 and his output is correct.
From my Cauldron install.
Code: Select all
[root@localhost bin]# rpm -qf /etc/rc.d/rc.local                                                                                           
error: file /etc/rc.d/rc.local: No such file or directory                                                                                   
[root@localhost bin]#

Re: optimizing power drain

PostPosted: Mar 26th, '13, 21:15
by doktor5000
Well, then somebody else needs to take over and help, as i'm not running cauldron.

Re: optimizing power drain

PostPosted: Mar 27th, '13, 05:11
by Ken-Bergen
I took a look at two Cauldron installs and it seems hdpram is not installed if you use the Live DVD but can be added post install.

For /etc/rc.d/rc.local, create the file and put in the text, if it doesn't work no harm done.

I'll move this to "Testing : Alpha, Beta, RC and Cauldron" as that's where it belongs.

Re: optimizing power drain

PostPosted: Mar 29th, '13, 09:07
by djmarian
Ken-Bergen wrote: if it doesn't work no harm done.

and how do i find out if it works?

Re: optimizing power drain

PostPosted: Mar 29th, '13, 09:54
by gohlip
Mageia3 is (finally) now on systemd.
"/etc/rc.d/rc.local" won't work, try instead...
Code: Select all
systemctl -p rc-local.service

to show properties

Systemd is continually evolving and I am not too clear how to go about it so ...., say, to shut down a partitcular hard disk, I don't know.

[edit] oh...press 'q' to exit. Sorry did not mention this.

Re: optimizing power drain

PostPosted: Mar 29th, '13, 16:10
by doktor5000
gohlip wrote:Systemd is continually evolving and I am not too clear how to go about it so ...., say, to shut down a partitcular hard disk, I don't know.

What has systemd to do with controlling device shutdown?

Re: optimizing power drain

PostPosted: Mar 29th, '13, 16:19
by gohlip
doktor5000 wrote:What has systemd to do with controlling device shutdown?


Well...djmarian wants to..
/etc/rc.d/rc.local file
#Spin down hard disks after 1 minute..

So /etc/rc.d/rc.local file won't work anymore with systemd
and rc-local is now at /etc/systemd/system

Re: optimizing power drain

PostPosted: Mar 29th, '13, 16:42
by doktor5000
/etc/rc.d/rc.local was normally only some workaround ...

You can run custom scripts or commands in many ways, not requiring systemd.
For a more proper solution see my first reply, last line.

Re: optimizing power drain

PostPosted: Mar 29th, '13, 17:11
by gohlip
Excuse me, gentlemen and ladies...talking to doktor5000 requires me to talk like doktor5500 :)

For a more proper solution see my first reply, last line.

which one? :)
Code: Select all
But maybe what you want is /etc/sysconfig/harddisks ?
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts


What about the following you do not understand?
So /etc/rc.d/rc.local file won't work anymore with systemd
and rc-local is now at /etc/systemd/system

And from http://www.freedesktop.org/wiki/Softwar ... dQuestions
Code: Select all
Q: I want to change a service file, but rpm keeps overwriting it in /usr/lib/systemd/system all the time, how should I handle this?

A: The recommended way is to copy the service file from /usr/lib/systemd/system to /etc/systemd/system and edit it there. The latter directory takes precedence over the former, and rpm will never overwrite it. If you want to use the distributed service file again you can simply delete (or rename) the service file in /etc/systemd/system again.


What has /etc/sysconfig/harddisks got to do with systemd?
systemd overides everything else.

You okay, doktor5000? Heh heh heh. No hard feelings, lan?
ps: our own wiki
https://wiki.mageia.org/en/Features/Systemd

Re: optimizing power drain

PostPosted: Mar 29th, '13, 23:21
by man_drake
doktor5000 wrote:Well, then somebody else needs to take over and help, as i'm not running cauldron.


:P

Re: optimizing power drain

PostPosted: Mar 30th, '13, 00:23
by djmarian
well this is fun... but
Code: Select all
dev-disk...Z702947.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart1.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart3.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart4.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart5.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart6.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2d0963d.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart1.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart3.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart4.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart5.device loaded active   plugged       SAMSUNG_HD322GJ
dev-disk...2dpart6.device loaded active   plugged       SAMSUNG_HD322GJ

so is there somewhere to change these things?

oh and about a question not answered
how do i stop mageia for waiting during boot for this hdd if i remove it, do i just delete it from fstab?

Re: optimizing power drain

PostPosted: Mar 30th, '13, 07:26
by gohlip
how do i stop mageia for waiting during boot for this hdd if i remove it, do i just delete it from fstab?

Yes, but there are a few things to watch out for.
First, make sure the removed hard drive is not the sda (mbr) otherwise you will not be able to boot,
and if using grub-legacy, recheck menu.lst to ensure device mapping is to right drive.
Then make sure there are no partition there required by Mageia.
And no directories/files sym-linked to it.
And swap: is it there also? (but you can create a new one in connected hard drive with a new fstab entry)