Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2006
    Posts
    2

    TS101 spindown working

    Hi,

    I was very close to buying a new NAS as for the last year I have struggled to get the spindown working and so just kept turning off the NAS when I was not using it. Which kind of takes some of the fun out of owning these things. I am sure you understand what I mean if you have the same problem with spindown.

    This was my last attempt to get this working and through a combination of things I managed to do just that:

    * putting swap on USB drive - I basically took the bones out of MR_HYDEs USB swap utility. From what I understood this does not work on the 101.
    * editing /etc/fstab did not seem to work so I eventually found a way to make swap stay on the USB drive after boot by editing autorun.sh
    * also using one of the posts on the QNAP forum I made several changes to the unix configuration to make it less prone to write to disk. Edited /etc/syslog.conf, /etc/hdparm.conf, /etc/crontab

    So after I disconnected it span down in a matter of minutes. This was the first time I have ever seen it do this and when I awoke this morning it was still there with the case as cool as cucumber.

    I have seen many posts about this on the forum and just wondered if others are interested in my experience? Is this old news? Do not wish to type it all out unless its useful.

    slimserver 6.5.4
    qnap ts101 with 500Gb Samsung Spin Point T (v 2.3)

  2. #2
    I for one would be very interested in this.

  3. #3
    Junior Member
    Join Date
    Dec 2006
    Posts
    2
    Sorry for long delay, have been away and its all working so well I do not need to come to the forum anymore :-).

    Here is a blow by blow account of what I did:

    ALWAYS MAKE SURE YOU TAKE A BACKUP FIRST!

    1. Insert the USB memory stick into one of the USB ports on the back.

    2. login into admin screen of ts101, mine is now on port 8080 after updating to v2.3.

    Under USB drives you should see some items listed. I have 2 items (USB drive 1 and USB drive 2) because the stick I used had 2 already formatted partitions on it.

    3. Select the partition you wish to use and set the type to 'EXT3' and click on format. This takes a little time but should eventually come back with a status of 'ready'.

    4. Now either using the DOS prompt or putty telnet into the NAS on port 13131.

    5. First, we need to idenfity the mount point for the usb memory stick. Issue the following commands:

    prompt> cat /proc/mounts | awk '{print $2}' | grep external

    This will probably return several rows. For me the one of interest was /share/external/sdm. The others listed will probably relate to the Public and Download mount points if you have them activated.

    6. Now, we need to idenfity the mount point for the swap device. Issue the following commands:
    prompt> cat /proc/swaps | awk '{print $1}' | grep /

    This should just return one row. My swap device was called /dev/sda2.

    7. Now we need to create a file on the the USB memory stick to be used for swap. The following command will create a file of 512mb. This is the recommended minimum and is a similar size to the swapfile created on the disk. This takes a few minutes.

    prompt> dd if=/dev/zero of=/share/external/sdm/swapfile bs=1M count=512

    8. Now we need to convert the file so it can be used as a swap file.

    prompt> mkswap /share/external/sdm/swapfile

    9. Now we are ready to use the swapfile.

    prompt> /sbin/swapon /share/external/sdm/swapfile
    prompt> /sbin/swapoff /dev/sda2
    prompt> /sbin/swapon /dev/sda2

    The order here is important. First we add the new swapfile so that we can remove the old one. Then we add it back. This is done to change the order of the swap files so that the USB memory stick is used first.

    10. Now you have swap working on the USB memory stick. If like me the USB stick has a light to indicate activity you can see it working. However if you reboot you will revert back to the old configuration. I also found that when I rebooted my memory stick had been mounted on /share/external/sdl instead of /share/external/sdm. So all references to the swap file have to be in this new location from now on. This new location seemed to persist for all future bounces.

    Therefore I would recommend that you reboot and perform just step 5 again to see where the usb memory stick is now mounted.

    11. To get the change to take permanently I had to do the following ( I don't really understand this, but it works):

    prompt> mkdir -p /tmp/config
    prompt> mount -t ext2 /dev/mtdblock4 /tmp/config
    prompt> vi /tmp/config/autostart.sh

    And add the following lines to this file (move the cursor to the bottom and type ESC and then 'o')

    # changes added to get spindown working SEP-2008
    /sbin/swapon /share/external/sdl/swapfile
    /sbin/swapoff /dev/sda2
    /sbin/swapon /dev/sda2

    Then save and quite (ESC and enter wq! at the ':' prompt). That takes you back to the prompt.

    prompt> umount /tmp/config

    12. Reboot and check that swap is still set up correctly:

    prompt> cat /proc/swaps

    This should show your new swapfile followed by the old one.


    13. Then I messed a little with the unix configuration using this forum post:

    http://forum.qnap.com/viewtopic.php?f=93&t=7456

    The files I edited were as follows:

    /etc/hdparm.conf
    /etc/crontab
    /etc/sysctl.conf

    The one big difference here was I actually found the files in /share/HDA_DATA/ubuntu/etc. It is probably a good idea to take a backup of these before you edit.

    Hope it works for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •