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

unslung or openslug without swap

Expand Messages
  • johannes
    Hi, Can the NSLU2 live without a swap space? The thing is: I would like to have a silent slug that spins down the harddrive when it is not used. In my
    Message 1 of 8 , Mar 1, 2007
    • 0 Attachment
      Hi,

      Can the NSLU2 live without a swap space?

      The thing is: I would like to have a silent slug that spins down the
      harddrive when it is not used. In my understanding, this means:
      * I cannot have a swap partition on the harddrive, otherwise it will
      never spin down.
      * I cannot have the swap on my usb stick either because swapping would
      wear out the flash memory.

      The only remaining option I can see is not to use swapping at all.
      Therefore the question:
      1.) Can an unslung nslu2 live without swapping?
      2.) Can a SlugOS/OpenSlug nslu2 live without swapping?


      thanks for your help!
      Johannes
    • Brian Wood
      ... Obviously this depends on what you are doing, but the answer might surprise you. I have a slug running OpenSlug 2.7 and Cyrus Imap with Postfix and even
      Message 2 of 8 , Mar 1, 2007
      • 0 Attachment
        On Mar 1, 2007, at 6:21 PM, johannes wrote:

        > Hi,
        >
        > Can the NSLU2 live without a swap space?
        >
        > The thing is: I would like to have a silent slug that spins down the
        > harddrive when it is not used. In my understanding, this means:
        > * I cannot have a swap partition on the harddrive, otherwise it will
        > never spin down.
        > * I cannot have the swap on my usb stick either because swapping would
        > wear out the flash memory.
        >
        > The only remaining option I can see is not to use swapping at all.
        > Therefore the question:
        > 1.) Can an unslung nslu2 live without swapping?

        > 2.) Can a SlugOS/OpenSlug nslu2 live without swapping?
        >

        Obviously this depends on what you are doing, but the answer might
        surprise you. I have a slug running OpenSlug 2.7 and Cyrus Imap with
        Postfix and even after weeks of uptime it still shows zero swap space
        used. I do have a 10GB drive attached that holds the OS and all the
        software as well as the mail files for about 6 domains, and obviously
        I couldn't spin down that drive without some problems, but it never
        appears to touch swap.

        As long as whatever you are doing can handle the spin-up delay you
        might well be OK as long as you don't get too ambitious.

        As for Unslung I suspect that due to the web server and all the
        graphic pages you might have more trouble. I've never used UnSlung so
        I can't say - I find it totally confusing because it is so non-
        standard as far as Unix systems.

        As for using a flash drive, the "accepted wisdom" is that it will die
        soon from too much activity, but I've been running Debian on a test
        slug for months using a 2GB flash stick that I picked up for $20 (so
        I was willing to sacrifice it for a test). Mount any file systems
        using the "noatime" parameter and don't swap to it and you might be
        surprised how long it lasts. (but of course not having the access
        time updated correctly can cause problems with some applications).

        Of course as always YMMV, and please do not take this as any sort of
        guarantee, and if you have any truly critical application use a hard
        drive, you can get small 2.5" or even smaller drives quite cheaply
        (at least in the USA) and they are very hard to hear even with a
        stethoscope.
      • johannes
        Thank you Brian for your response! 1.) Your experience makes me think it should be possible (though maybe not advisable) to run SlugOS with no swapping. What
        Message 3 of 8 , Mar 2, 2007
        • 0 Attachment
          Thank you Brian for your response!

          1.) Your experience makes me think it should be possible (though maybe
          not advisable) to run SlugOS with no swapping. What would happen if a
          slug with no swapping runs out of memory?


          2.) As for the silent slug, I have been rethinking my question:

          Let's say my slug is running 24/7 in my living room but I only access
          it once a day to make a backup. The slug swaps onto the harddrive that
          is attached to it. Will the harddrive get any rest?

          I mean, if the slug does not have anything to do, does it need to
          access the swap on the harddrive at all? Will the network traffic (not
          when I am trying to backup, but any lost packages swirling around)
          cause access to the swap?

          Maybe the harddisk can be spun down even though there is a swap space
          on it? What do you think?


          thank you so far!
          Johannes



          Brian Wood wrote:
          > On Mar 1, 2007, at 6:21 PM, johannes wrote:
          >
          >> Hi,
          >>
          >> Can the NSLU2 live without a swap space?
          >>
          >> The thing is: I would like to have a silent slug that spins down the
          >> harddrive when it is not used. In my understanding, this means:
          >> * I cannot have a swap partition on the harddrive, otherwise it will
          >> never spin down.
          >> * I cannot have the swap on my usb stick either because swapping would
          >> wear out the flash memory.
          >>
          >> The only remaining option I can see is not to use swapping at all.
          >> Therefore the question:
          >> 1.) Can an unslung nslu2 live without swapping?
          >
          >> 2.) Can a SlugOS/OpenSlug nslu2 live without swapping?
          >>
          >
          > Obviously this depends on what you are doing, but the answer might
          > surprise you. I have a slug running OpenSlug 2.7 and Cyrus Imap with
          > Postfix and even after weeks of uptime it still shows zero swap space
          > used. I do have a 10GB drive attached that holds the OS and all the
          > software as well as the mail files for about 6 domains, and obviously
          > I couldn't spin down that drive without some problems, but it never
          > appears to touch swap.
          >
          > As long as whatever you are doing can handle the spin-up delay you
          > might well be OK as long as you don't get too ambitious.
          >
          > As for Unslung I suspect that due to the web server and all the
          > graphic pages you might have more trouble. I've never used UnSlung so
          > I can't say - I find it totally confusing because it is so non-
          > standard as far as Unix systems.
          >
          > As for using a flash drive, the "accepted wisdom" is that it will die
          > soon from too much activity, but I've been running Debian on a test
          > slug for months using a 2GB flash stick that I picked up for $20 (so
          > I was willing to sacrifice it for a test). Mount any file systems
          > using the "noatime" parameter and don't swap to it and you might be
          > surprised how long it lasts. (but of course not having the access
          > time updated correctly can cause problems with some applications).
          >
          > Of course as always YMMV, and please do not take this as any sort of
          > guarantee, and if you have any truly critical application use a hard
          > drive, you can get small 2.5" or even smaller drives quite cheaply
          > (at least in the USA) and they are very hard to hear even with a
          > stethoscope.
          >
          >
          >
          >
          >
        • Robert Hammond
          In message , johannes writes ... I have two swaps, the default swap partition and also a swap file off of the
          Message 4 of 8 , Mar 2, 2007
          • 0 Attachment
            In message <es7u6k$bm9$1@...>, johannes <jjh_nospam@...>
            writes
            >Hi,
            >
            >Can the NSLU2 live without a swap space?
            >
            >The thing is: I would like to have a silent slug that spins down the
            >harddrive when it is not used. In my understanding, this means:
            >* I cannot have a swap partition on the harddrive, otherwise it will
            > never spin down.
            I have two swaps, the default swap partition and also a swap file off
            of the root folder. My disk spins down with no problems.



            --
            Robert Hammond
            PGP:0x154144DA
          • Brian Wood
            ... To make a long story short: It stops running properly. ... If all you want to do is run backups I would think the stock firmware would do it with the
            Message 5 of 8 , Mar 2, 2007
            • 0 Attachment
              On Mar 2, 2007, at 3:04 AM, johannes wrote:

              > Thank you Brian for your response!
              >
              > 1.) Your experience makes me think it should be possible (though maybe
              > not advisable) to run SlugOS with no swapping. What would happen if a
              > slug with no swapping runs out of memory?

              To make a long story short: It stops running properly.

              >
              >
              > 2.) As for the silent slug, I have been rethinking my question:
              >
              > Let's say my slug is running 24/7 in my living room but I only access
              > it once a day to make a backup. The slug swaps onto the harddrive that
              > is attached to it. Will the harddrive get any rest?
              >
              > I mean, if the slug does not have anything to do, does it need to
              > access the swap on the harddrive at all? Will the network traffic (not
              > when I am trying to backup, but any lost packages swirling around)
              > cause access to the swap?
              >
              > Maybe the harddisk can be spun down even though there is a swap space
              > on it? What do you think?
              >

              If all you want to do is run backups I would think the stock firmware
              would do it with the exception of the spindown, remember that the
              stock F/W runs with no swap space. Running backups will probably not
              require swap at all but you might need it for some of the
              installation routines (depends on the F/W you use) and you would
              definitely need it to compile anything beyond "hello world" (and
              maybe even then).

              But some questions come to mind:

              How much data are you needing to back up? If it's over 100GB or so
              the small form factor drives are pretty much out of the question.

              Why does the slug have to be in your LR ? Since it is on your network
              I'd think you could put it just about anywhere.

              How much noise can you tolerate? As I said the small drives are
              pretty quiet these days.

              Many USB drive/case combinations can handle spindown, and you could
              connect the drive to a regular Linux/Unix machine and use the
              standard utilities to set up the spindown. I know the Maxtor units
              can do this - in fact they come set to spindown and I had trouble
              getting them to stop doing that. I'll bet if you connected one out of
              the box to the stock F/W or UnSlung it would work fine and spindown
              well. I think there's lots of info on spindown on the NSLU2 sites as
              well.

              I run backups using a slug as an NFS server and a spun-down condition
              simply results in a brief delay when the job starts.

              I know a lot of folks will disagree with me, but I believe you are
              better off not spinning down a drive. The constant running will age
              the motor and bearings more, but IMHO it will increase the overall
              life. Every drive I've ever had fail did so at startup, and replacing
              them more often due to drive/bearing failure is something I'm willing
              to accept. Please no flames on this, it's just an opinion :-)
            • johannes
              Thank you Brian, thank you Robert for your responses! I am now running slugOs with no swap: The root system is on my memory stick on usbPort1 (I will always
              Message 6 of 8 , Mar 2, 2007
              • 0 Attachment
                Thank you Brian, thank you Robert for your responses!

                I am now running slugOs with no swap: The root system is on my memory
                stick on usbPort1 (I will always leave the memory stick plugged in).
                It is doing very well, but I have to say I have not done yet much
                apart from formatting harddrives and installing nano. We'll see how it
                does when I install Samba.

                The harddisk is on usbPort2. I can switch it on and off as I want and
                leave the slug running. I get automatically mounted into /media/sdb1
                when I turn it on. I can spin the drive down manually by calling
                scsci-stop /dev/sdb. I have not found out yet if it is going to be
                spun down automatically if I wait long enough (is this what the kernel
                patch is supposed to do?)

                I think I will reserve a swap partition on the harddisk but only
                activate it when I need it - that could be a good option! If the drive
                spins down despite the activated swap partition (like Robert's drive
                does), I could leave it activated all the time.


                Brian Wood wrote:
                > On Mar 2, 2007, at 3:04 AM, johannes wrote:
                >
                >> Thank you Brian for your response!
                >>
                >> 1.) Your experience makes me think it should be possible (though maybe
                >> not advisable) to run SlugOS with no swapping. What would happen if a
                >> slug with no swapping runs out of memory?
                >
                > To make a long story short: It stops running properly.
                giving random errors etc? does not sound nice!


                >>
                >> 2.) As for the silent slug, I have been rethinking my question:
                >>
                >> Let's say my slug is running 24/7 in my living room but I only access
                >> it once a day to make a backup. The slug swaps onto the harddrive that
                >> is attached to it. Will the harddrive get any rest?
                >>
                >> I mean, if the slug does not have anything to do, does it need to
                >> access the swap on the harddrive at all? Will the network traffic (not
                >> when I am trying to backup, but any lost packages swirling around)
                >> cause access to the swap?
                >>
                >> Maybe the harddisk can be spun down even though there is a swap space
                >> on it? What do you think?
                >>
                >
                > If all you want to do is run backups I would think the stock firmware
                > would do it with the exception of the spindown, remember that the
                > stock F/W runs with no swap space. Running backups will probably not
                > require swap at all but you might need it for some of the
                > installation routines (depends on the F/W you use) and you would
                > definitely need it to compile anything beyond "hello world" (and
                > maybe even then).
                I don't think I'll start compiling things on my slug (yet) - but then
                I would certainly have to activate some swap space on my harddisk.

                >
                > But some questions come to mind:
                >
                > How much data are you needing to back up? If it's over 100GB or so
                > the small form factor drives are pretty much out of the question.
                I bought a desktop drive because it they are lot cheaper than the
                laptop ones. It's a Hitachi one because it was said to be not too
                noisy. 320 GB had the best price per MB right now (at least in
                europe), so that's what I went for.


                >
                > Why does the slug have to be in your LR ? Since it is on your network
                > I'd think you could put it just about anywhere.
                I am a student and I pretty much only have one room that I have to
                share with my computer equipment :-)

                > How much noise can you tolerate? As I said the small drives are
                > pretty quiet these days.
                The drive I have actually is quite ok - it makes about as much noise
                as my macbook when the fans are starting to spin up a bit.

                > Many USB drive/case combinations can handle spindown, and you could
                > connect the drive to a regular Linux/Unix machine and use the
                > standard utilities to set up the spindown. I know the Maxtor units
                > can do this - in fact they come set to spindown and I had trouble
                > getting them to stop doing that. I'll bet if you connected one out of
                > the box to the stock F/W or UnSlung it would work fine and spindown
                > well. I think there's lots of info on spindown on the NSLU2 sites as
                > well.
                I guess that by 'setting the spindown' you are referring to method1
                (hdparm) on http://www.nslu2-linux.org/wiki/FAQ/SpinDownUSBHarddisks -
                I am using method3 (scsi-stop) to spindown.


                > I run backups using a slug as an NFS server and a spun-down condition
                > simply results in a brief delay when the job starts.
                that's about what i have in mind. i don't think i'd care about the
                delay too much, though.


                > I know a lot of folks will disagree with me, but I believe you are
                > better off not spinning down a drive. The constant running will age
                > the motor and bearings more, but IMHO it will increase the overall
                > life. Every drive I've ever had fail did so at startup, and replacing
                > them more often due to drive/bearing failure is something I'm willing
                > to accept. Please no flames on this, it's just an opinion :-)
                yes, i've heard about this, and I respect your opinion. (I know
                there's a lot of discussion on this topic)

                my calculation is: if the drive supports about 50.000 spinups (I don't
                remember where I found this number), it would last for more than ten
                years even if I'd spin it up 10 times a day. Considering the comfort
                of sleeping in total silence, I think I will spin the drive up and down.

                thank you all for your kind help,
                Johannes
              • Brian Wood
                ... Not sure if this will be of help but remember that you can swap to a file as well as a partition.
                Message 7 of 8 , Mar 2, 2007
                • 0 Attachment
                  On Mar 2, 2007, at 4:29 PM, johannes wrote:

                  >
                  >
                  > I think I will reserve a swap partition on the harddisk but only
                  > activate it when I need it - that could be a good option! If the drive
                  > spins down despite the activated swap partition (like Robert's drive
                  > does), I could leave it activated all the time.
                  >

                  Not sure if this will be of help but remember that you can swap to a
                  file as well as a partition.
                • johannes
                  ... thanks for the hint, this is the smarter option!
                  Message 8 of 8 , Mar 3, 2007
                  • 0 Attachment
                    Brian Wood wrote:
                    > On Mar 2, 2007, at 4:29 PM, johannes wrote:
                    >
                    >>
                    >> I think I will reserve a swap partition on the harddisk but only
                    >> activate it when I need it - that could be a good option! If the drive
                    >> spins down despite the activated swap partition (like Robert's drive
                    >> does), I could leave it activated all the time.
                    >>
                    >
                    > Not sure if this will be of help but remember that you can swap to a
                    > file as well as a partition.
                    thanks for the hint, this is the smarter option!
                  Your message has been successfully submitted and would be delivered to recipients shortly.