michalpolkowski / alt-f

Automatically exported from code.google.com/p/alt-f
0 stars 0 forks source link

dhcp renew wakes up sda #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. setup external dhcp server with a short lease time
2. standby all hdds
3. sda will wakeup when the lease is renewd, saying:
   .... user.notice udhcpc: udhcpc environment:
   .............
   .... Updating /etc/hosts
   .....

Why sda wakes up when ip address is renewd ?

Original issue reported on code.google.com by gabriele...@gmail.com on 15 Oct 2011 at 12:30

GoogleCodeExporter commented 9 years ago
That should not occur.
Do you have packages installed? If yes please post the output of

  ls -la /Alt-F/etc/

If any file contained under /Alt-F is written, the disk where /Alt-F directory 
is might be waked.

For your enlightenment, you can also read the "HowToFixOrCustomizeFirmware" 
wiki.

Of course, the solution is to use a longer lease time, or better, use a fixed 
IP, as all servers should have.

Original comment by whoami.j...@gmail.com on 15 Oct 2011 at 5:19

GoogleCodeExporter commented 9 years ago
Changed to fixed IP address, moved all ffp installation to usb hard disk, but 
sda keeps waking up:

Oct 26 17:44:17 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 26 18:22:08 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 26 18:33:48 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 26 19:22:08 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 26 19:33:48 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 26 20:22:08 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 26 20:33:48 quantum daemon.info sysctrl: right_dev disk (sda) standby

Here is
$ ls -la /Alt-F/etc/
total 60
drwxr-xr-x  2 root root 4096 Oct 26 20:23 .
drwxr-xr-x 10 root root 4096 Oct 22 18:37 ..
-rw-r--r--  1 root root  743 Oct 24 23:38 blkid.tab
-rw-r--r--  1 root root  743 Oct 24 23:38 blkid.tab.old
-rw-r--r--  1 root root  133 Oct 24 23:39 dnsmasq-hosts
-rw-r--r--  1 root root  479 Oct 24 23:39 dnsmasq-opts
-rw-r--r--  1 root root   46 Oct 24 23:39 dnsmasq-resolv
-rw-r--r--  1 root root  325 Oct 24 23:39 dnsmasq.conf
-rw-r--r--  1 root root  272 Oct 15 16:18 fstab
-rw-r--r--  1 root root  152 Oct 22 18:18 hosts
-rw-r--r--  1 root root  139 Oct 22 18:03 httpd.conf
-rw-rw-rw-  1 root root    0 Oct 14 21:41 mdadm.conf
-rw-r--r--  1 root root   15 Oct 22 18:03 modprobe.conf
-rw-r--r--  1 root root    7 Oct 26 20:23 ntp.drift
-rw-r--r--  1 root root  103 Oct 24 23:39 resolv.conf
-rw-r--r--  1 root root  526 Oct 15 19:34 shells

mmmh

Maybe ntp.drift ?

Original comment by gabriele...@gmail.com on 26 Oct 2011 at 7:07

GoogleCodeExporter commented 9 years ago
Tried to stop ntp.
Will write more tomorrow.

Original comment by gabriele...@gmail.com on 26 Oct 2011 at 7:10

GoogleCodeExporter commented 9 years ago
Take also a look at /Alt-F/var{lib,spool}

NFS and Samba might also update them. Use "ls -a", as some files are "hidden"

Original comment by whoami.j...@gmail.com on 26 Oct 2011 at 8:21

GoogleCodeExporter commented 9 years ago
It seems that there are no recent modified files in /Alt-F/var/{lib,spool}:

mnt.vvngrl@quantum.diesis.priv[2011-10-27 10:52:14]
/Alt-F
$ ls -laR /Alt-F/var/{lib,spool}

/Alt-F/var/lib:
total 16
drwxr-xr-x 4 root   root 4096 Sep 13 23:45 .
drwxr-xr-x 5 root   root 4096 Sep 16 13:59 ..
drwxr-xr-x 2 root   root 4096 Sep 21 20:31 misc
drwxr-xr-x 4 daemon root 4096 Oct 15 00:38 nfs

/Alt-F/var/lib/misc:
total 12
drwxr-xr-x 2 root root 4096 Sep 21 20:31 .
drwxr-xr-x 4 root root 4096 Sep 13 23:45 ..
-rw------- 1 root root  512 Oct 15 00:38 random-seed

/Alt-F/var/lib/nfs:
total 16
drwxr-xr-x 4 daemon root 4096 Oct 15 00:38 .
drwxr-xr-x 4 root   root 4096 Sep 13 23:45 ..
-rw------- 1 daemon root    0 Sep 14 02:19 .etab.lock
-rw------- 1 daemon root    0 Sep 14 08:03 .xtab.lock
-rw-r--r-- 1 daemon root    0 Oct 26 21:08 etab
-rw-r--r-- 1 daemon root    0 Oct 26 21:08 rmtab
drwxr-xr-x 2 daemon root 4096 Sep 13 23:45 sm
drwxr-xr-x 2 daemon root 4096 Sep 13 23:45 sm.bak
-rw-r--r-- 1 daemon root    0 Oct 26 21:08 state
-rw-r--r-- 1 daemon root    0 Oct 26 21:08 xtab

/Alt-F/var/lib/nfs/sm:
total 8
drwxr-xr-x 2 daemon root 4096 Sep 13 23:45 .
drwxr-xr-x 4 daemon root 4096 Oct 15 00:38 ..

/Alt-F/var/lib/nfs/sm.bak:
total 8
drwxr-xr-x 2 daemon root 4096 Sep 13 23:45 .
drwxr-xr-x 4 daemon root 4096 Oct 15 00:38 ..

/Alt-F/var/spool:
total 16
drwxr-xr-x 4 root root 4096 Sep 14 01:31 .
drwxr-xr-x 5 root root 4096 Sep 16 13:59 ..
drwxr-xr-x 3 root root 4096 Sep 14 01:31 cron
drwxr-xr-x 2 root root 4096 Sep 13 23:44 lpd

/Alt-F/var/spool/cron:
total 12
drwxr-xr-x 3 root root 4096 Sep 14 01:31 .
drwxr-xr-x 4 root root 4096 Sep 14 01:31 ..
drwxr-xr-x 2 root root 4096 Oct 26 21:09 crontabs

/Alt-F/var/spool/cron/crontabs:
total 12
drwxr-xr-x 2 root root 4096 Oct 26 21:09 .
drwxr-xr-x 3 root root 4096 Sep 14 01:31 ..
-rw------- 1 root root  794 Oct 26 21:08 root

/Alt-F/var/spool/lpd:
total 8
drwxr-xr-x 2 root root 4096 Sep 13 23:44 .
drwxr-xr-x 4 root root 4096 Sep 14 01:31 ..

/dev/sda keeps waking up:

mnt.vvngrl@quantum.diesis.priv[2011-10-27 10:54:40]
/Alt-F
$ logread | grep right_dev | tail

Oct 27 06:32:13 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 27 07:22:08 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 27 07:32:13 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 27 08:14:06 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 27 08:32:02 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 27 09:22:08 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 27 09:32:13 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 27 10:22:08 quantum daemon.info sysctrl: right_dev disk (sda) wakeup
Oct 27 10:32:13 quantum daemon.info sysctrl: right_dev disk (sda) standby
Oct 27 10:39:58 quantum daemon.info sysctrl: right_dev disk (sda) wakeup

Maybe someone of these files is read ?

Here are the processes alive on the box:

$ ps auxw
PID   USER     COMMAND
    1 root     init      
    2 root     [kthreadd]
    3 root     [ksoftirqd/0]
    4 root     [events/0]
    5 root     [khelper]
    6 root     [async/mgr]
    7 root     [sync_supers]
    8 root     [bdi-default]
    9 root     [kblockd/0]
   10 root     [ata_aux]
   11 root     [ata_sff/0]
   12 root     [khubd]
   13 root     [kswapd0]
   14 root     [aufsd/0]
   15 root     [aufsd_pre/0]
   16 root     [scsi_eh_0]
   17 root     [scsi_eh_1]
   23 root     [mtdblock0]
   25 root     [mtdblock1]
   26 root     [mtdblock2]
   27 root     [mtdblock3]
   28 root     [mtdblock4]
   31 root     [usbhid_resumer]
   32 root     [scsi_eh_2]
   33 root     [usb-storage]
   52 root     [loop0]
  398 root     [kjournald]
  510 root     [kjournald]
  624 root     syslogd -C -m 0 -D 
  626 root     klogd 
  637 root     sysctrl 
  644 root     crond 
  668 root     inetd 
  676 root     [jbd2/sdc1-8]
  677 root     [ext4-dio-unwrit]
  702 nobody   /ffp/bin/mlnet -run_as_user nobody -log_file mlnet.log 
  713 nobody   /ffp/bin/mlnet -run_as_user nobody -log_file mlnet.log 
  714 nobody   /ffp/bin/mlnet -run_as_user nobody -log_file mlnet.log 
  715 nobody   /ffp/bin/mlnet -run_as_user nobody -log_file mlnet.log 
  765 root     [kjournald]
  833 root     [kjournald]
  834 root     nmbd -D 
  836 root     smbd -D 
  895 root     smbd -D 
  978 root     /bin/sh -- 
 1002 root     SCREEN 
 1003 root     /bin/sh 
 1033 root     /bin/sh 
 2542 root     dropbear -i -s 
 2549 root     SCREEN -DR 
 2550 mnt.vvng -/bin/bash 
 2569 root     [flush-8:32]
 2572 root     dropbear -i -s 
 2573 mnt.vvng -bash 
 2578 mnt.vvng screen -DR 
 2580 root     [flush-8:0]
 2592 mnt.vvng ps auxw 
 3788 root     /ffp/bin/rsync --daemon --config=/ffp/etc/rsyncd.conf 
 4023 nobody   dnsmasq 

Note that mlnet is on the usb external hard drive.

Here are the opened files on /mnt/sda*, that are the ones of my ssh session:

$ lsof  | grep sda
bash      2550 mnt.vvngrl  cwd       DIR    8,3     4096 108429313 
/mnt/sdadata/Alt-F
bash      2573 mnt.vvngrl  cwd       DIR    8,2     1024     16324 
/mnt/sdasystem/Users/mnt.vvngrl
lsof      2598 mnt.vvngrl  cwd       DIR    8,3     4096 108429313 
/mnt/sdadata/Alt-F
lsof      2600 mnt.vvngrl  cwd       DIR    8,3     4096 108429313 
/mnt/sdadata/Alt-F

Cheers,
G

Original comment by gabriele...@gmail.com on 27 Oct 2011 at 8:58

GoogleCodeExporter commented 9 years ago
Well, investigated deeply.
To be absolutely sure to not "touch" anything on the internal hdds, I have
* moved all ffp stuff to the external usb drive
* disabled all the ffp daemons

In this way, the internal hdds are not spinned up anymore.
BUT, if from the root telnet prompt, I issue for the first time a simple
 ls /ffp/root
both disks are awakened.
If I put in standby the disk again, and I issue the ls again, the disks are not 
awakened.
Very strange.
I made another test: i run mldonkey inside the ffp environment, and I have put 
EVERYTHING related to ffp and mldonkey on the usb hdd.ù
But the internal disks are awakened every ten minutes ...

Original comment by gabriele...@gmail.com on 5 Nov 2011 at 5:19

GoogleCodeExporter commented 9 years ago
Thanks for continuing investigating this and, mainly, for sharing your findings 
with us.

>BUT, if from the root telnet prompt, I issue for the first time a simple
 ls /ffp/root
both disks are awakened.

Yes, as ffp is on disk

>If I put in standby the disk again, and I issue the ls again, the disks are 
not awakened.
Very strange.

Not really, they are on the disk buffer cache. As there was no write to the 
disk, the system assumes that the cache is still valid.

>I made another test: i run mldonkey inside the ffp environment, and I have put 
EVERYTHING related to ffp and mldonkey on the usb hdd.

I know what you think that "Everything" means. But the process is running, has 
allocated some memory, opened some files, and that deploys the OS buffer cache, 
both the disk and the page (virtual memory) cache. Have you checked if swap is 
being used?

As there are other processes running, and the physical memory is very low, some 
portions (pages) of the programs code (or data) might have been be swapped to 
disk.

You can try to turn swap off, (just for diagnosing!)

   cat /proc/swaps
   swapoff /dev/sd?? # previous command output partitions

>But the internal disks are awakened every ten minutes ...

Or the process is doing something every then minutes, or it is some OS 
mechanism, such as 'bdflush'

History: it is *very* difficult to have unix running and not having disks to be 
awakened. In unix everything is a file, and there is the caches, etc.

This issue become more critical when laptops become of widespread use, and 
users want to preserve battery and want their disk to spin down. Frequent disk 
spin-up/down soon made disks fail, and disk manufacturers start making 2.5" 
laptop disk more resilient to spin up/down and head parking cycles.

Linux attacked the problem by made some disk-related parameters "tunable", take 
a look at /etc/sysctl.conf. It might or might not help you...

Thanks,
Joao

Original comment by whoami.j...@gmail.com on 6 Nov 2011 at 8:49

GoogleCodeExporter commented 9 years ago
It was swap ...
I removed the swap partitions on the internal hdds from fstab, and saved 
settings, and swapoffed them because I use a simple swapfile on my usb hdd.
But rebooting still reconfigure these swap partitions: now I swapoff them from 
a script, but I think it's better to remove them !

Original comment by gabriele...@gmail.com on 14 Nov 2011 at 10:52

GoogleCodeExporter commented 9 years ago
A swap partition must be always active, so this is not "fixable".

Advanced users can disable swap partitions on internal disks by removing or 
changing the partition type in the Disk Partitioner.

Original comment by whoami.j...@gmail.com on 6 Feb 2012 at 5:26