Loading ...
Sorry, an error occurred while loading the content.

Spinning down disks when using Samba

Expand Messages
  • fmarkgraf
    Hello, experimenting with the instructions to allow spin down of disk 1. I followed the steps described here
    Message 1 of 4 , Mar 5, 2008
    • 0 Attachment
      Hello,
      experimenting with the instructions to allow spin down of disk 1.
      I followed the steps described here
      http://www.nslu2-linux.org/wiki/FAQ/SpinDownUSBHarddisks
      and here
      http://www.nslu2-linux.org/wiki/HowTo/SetSpinDownTimeOnMaxtorOneTouch
      to modify the system.
      Since the disk would still not spin down, I stopped smbd and nmbd from
      Samba 3.0.24. This made the disk to spin down after a while.
      Can I do anything to allow disk spindown with the Samba demons running?

      Thanks,
      Frank
    • bloedmann999
      ... Frank, ... Do that and you will probably see that the smbd daemon is constantly opening and closing /var/cache/samba/browse.dat. That was the case on my
      Message 2 of 4 , Mar 6, 2008
      • 0 Attachment
        --- In nslu2-linux@yahoogroups.com, "fmarkgraf" <fmarkgraf@...> wrote:
        >
        > Hello,
        > experimenting with the instructions to allow spin down of disk 1.
        > I followed the steps described here
        > http://www.nslu2-linux.org/wiki/FAQ/SpinDownUSBHarddisks
        > and here
        > http://www.nslu2-linux.org/wiki/HowTo/SetSpinDownTimeOnMaxtorOneTouch
        > to modify the system.
        > Since the disk would still not spin down, I stopped smbd and nmbd from
        > Samba 3.0.24. This made the disk to spin down after a while.
        > Can I do anything to allow disk spindown with the Samba demons running?
        >
        > Thanks,
        > Frank
        >
        Frank,
        I had the same problem. A helpfull tip told me to do the following:

        >>Easiest way to find out what a process is accessing
        >>is to use 'strace'
        >>in combo with -e trace=open,close,read,write to see what it is
        >>opening/closing,reading/writing.

        Do that and you will probably see that the smbd daemon is constantly
        opening and closing /var/cache/samba/browse.dat. That was the case on
        my slug.
        I solved it by moving /var/cache/samba also onto ramfs, and then
        setting a symlink in /var/cache called samba that points to the ramfs
        directory.

        Hope that helps.

        Cheers Brian
      • JW
        ... thanks brian - i installed strace i tried the following commands strace -e trace=open,close,read,write strace -e trace=read but the command syntax is wrong
        Message 3 of 4 , Mar 6, 2008
        • 0 Attachment
          On 06/03/2008, bloedmann999 <Brian_Dorling@...> wrote:
          > >>Easiest way to find out what a process is accessing
          > >>is to use 'strace'
          > >>in combo with -e trace=open,close,read,write to see what it is
          > >>opening/closing,reading/writing.

          thanks brian - i installed strace
          i tried the following commands

          strace -e trace=open,close,read,write
          strace -e trace=read

          but the command syntax is wrong and am unable to figure out the
          correct syntax after --help study

          can you give full command you use

          thanks
          JW
        • bloedmann999
          ... JW, sure. BTW its nmbd not smbd that is to blame. Slug2: ps -A ........ 5981 root 6156 S smbd -D 5982 root 6156 S smbd
          Message 4 of 4 , Mar 7, 2008
          • 0 Attachment
            --- In nslu2-linux@yahoogroups.com, JW <brenreid@...> wrote:
            >
            > On 06/03/2008, bloedmann999 <Brian_Dorling@...> wrote:
            > > >>Easiest way to find out what a process is accessing
            > > >>is to use 'strace'
            > > >>in combo with -e trace=open,close,read,write to see what it is
            > > >>opening/closing,reading/writing.
            >
            > thanks brian - i installed strace
            > i tried the following commands
            >
            > strace -e trace=open,close,read,write
            > strace -e trace=read
            >
            > but the command syntax is wrong and am unable to figure out the
            > correct syntax after --help study
            >
            > can you give full command you use
            >
            > thanks
            > JW
            >
            JW, sure. BTW its nmbd not smbd that is to blame.
            Slug2: ps -A
            ........
            5981 root 6156 S smbd -D
            5982 root 6156 S smbd -D
            5991 root 4816 S nmbd -D
            5992 ttyp0 root 1984 R ps -A

            Slug1: strace -t -p 5991 -e trace=open,close,read,write
            Process 5991 attached - interrupt to quit
            10:06:34 close(12) = 0
            10:06:53 open("/var/lock/samba/browse.dat.",
            O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 12
            10:06:53 write(12, "\"HOME\" c00010"..., 361) = 361
            10:06:53 close(12) = 0
            10:07:53 open("/var/lock/samba/browse.dat.",
            O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 12
            10:07:53 write(12, "\"HOME\" c00010"..., 361) = 361
            10:07:53 close(12) = 0
            10:08:35 close(12) = 0
            10:10:43 close(12) = 0
            etc.

            or,

            Slug2: killall -9 nmbd
            Slug2: strace -t -e trace=open,close,read,write nmbd

            But this causes some problems if the parent process detaches other
            processes, so attaching to existing processes (with -p) seems to be
            the best solution when tracing nmbd.

            BTW. I think the problem only occurs when the machine is the master
            browser, or some kind of master browser. I do not see any activity by
            nmbd on my second slug.


            Cheers Brian
          Your message has been successfully submitted and would be delivered to recipients shortly.