Will my internal drive on my Tonido Plug2 ever stop spinning

Support for your TonidoPlug
michaelbuddy
Rookie Tonidoid
Rookie Tonidoid
Posts: 7
Joined: Thu Oct 20, 2011 11:55 pm

Will my internal drive on my Tonido Plug2 ever stop spinning

Postby michaelbuddy » Thu Nov 24, 2011 1:32 am

So I feel like I don't have a definitive answer. Is my drive on my TP2 going to stop spinning?

Do I need to get a smaller and more expensive SSD drive to get around this fact? I've already spent enough money on this, I just don't understand why my drive would spin when it's not being accessed and the OS is on the plug itself, not my internal drive.

Please gimme some detail here. Are we waiting on an update that will stop this? Why was this not in the documentation here in the first place? Kind of an important detail. My drive might last 6 months instead of a few years because of this.

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8615
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby madhan » Thu Nov 24, 2011 1:43 am

We don't actively manage hdd spindown on the plug which runs the Linux OS. It is dependent on the power management settings on the HDD.

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby UrbanVoyeur » Thu Nov 24, 2011 9:44 am

michaelbuddy wrote:My drive might last 6 months instead of a few years because of this.

It seems it may be quite the opposite. Spinning down/ spinning up too often could shorten your hard disk life.
http://samwel.tk/laptop_mode/faq

It may be possible to use use the laptop-mode-tools and to set a spin down time. I have not tried this yet.
https://wiki.archlinux.org/index.php/Laptop_Mode_Tools

You will need to install these tools.

Code: Select all

apt-get install laptop-mode-tools

Please let us know what you find.

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby UrbanVoyeur » Mon Nov 28, 2011 12:15 am

So I played around a bit with the laptop mode tools. My drive definitely spins down fully now. For this test I used a Western Digital WD7500BVT 750 GB drive.

I also enabled the power mode via the jumper and quiet acoustic mode via the Hitachi disk tool. These two decreased the spin ups, noise and heat even without the laptop tools -

With these HD power and acoustic settings, there were still occasional random spins until the laptop tools were enabled - now drive stays down until accessed.

The gist of it is:
install laptop tools
edit the /etc/laptop-mode/laptop-mode.conf
- enable tools
- set the target disk to sda
- enable default modules
- enable during AC power
- set spindown time. I used 1200 sec
- save & close
start the tools: /etc/init.d/laptop-mode start

I'll post more detailed instructions when I have a bit more time, and I've tested them more thoroughly.

michaelbuddy
Rookie Tonidoid
Rookie Tonidoid
Posts: 7
Joined: Thu Oct 20, 2011 11:55 pm

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby michaelbuddy » Wed Nov 30, 2011 9:34 pm

@UrbanVoyeur nice work figuring that out. This is a little beyond my skills to even know what to do.

I also decided to purchase a very affordable 64GB SSD because I was liking the deal.. however this seems like the way to go for a lot of people.

I think the drive spinning down in many cases is a better idea than just letting it run. I will see what to do from this. Really appreciate your complete answer. And if you offer any more detail, even better!

Sorry for my delay posting. Just went through a job transition and it has been tough to get back to my favorite forums.

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby UrbanVoyeur » Thu Dec 01, 2011 11:51 pm

How To Spin Down A Hard Drive
There are many ways to spin down a hard drive in Linux. Here’s one method using laptop-mode-tools. I make no claim that this is the best, easiest or most elegant way – but it worked for me.

Note: If any of your apps are accessing your drive, it won’t spin down.
Note: these instructions require you to install packages. You should only install software if you are booting from a USB or SATA drive.

1. SSH into your plug.
2. Update your repositories and upgrade your packages.

Code: Select all

apt-get update
apt-get upgrade

3. Install laptop-mode-tools.

Code: Select all

apt-get install laptop-mode-tools

4. Open the config file in nano.

Code: Select all

nano /etc/laptop-mode/laptop-mode.conf

5. Change the following settings.

Code: Select all

Enable Laptop Tools
ENABLE_LAPTOP_MODE_TOOLS=1
ENABLE_LAPTOP_MODE_ON_AC=1
ENABLE_AUTO_MODULES=1

Set Drive Spin down Time In Seconds
LM_AC_HD_IDLE_TIMEOUT_SECONDS=600
NOLM_HD_IDLE_TIMEOUT_SECONDS=600

6. Save and close the file.

Code: Select all

CTRL-o
ENTER
CTRL-X

7. Restart the laptop tools

Code: Select all

/etc/init.d/laptop-mode restart


Source: http://samwel.tk/laptop_mode/faq

If it causes you problems, stop it and remove it:

Code: Select all

/etc/init.d/laptop-mode stop
apt-get remove  laptop-mode-tools

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby UrbanVoyeur » Fri Dec 02, 2011 12:19 am

michaelbuddy wrote:I also decided to purchase a very affordable 64GB SSD because I was liking the deal.

Using an SSD raises its own set of issues, namely enabling TRIM to ensure minimal, even wear on the SSD’s NAND. Some of the newer SSD’s may have their own built in wear leveling, and may not need TRIM. The one I use in my plug does not, and this is how I enabled TRIM.

Linux has had automatic, built in TRIM since kernel 2.6.33. To enable it, the SSD must be formatted ext4. The TonidoPlug 2 will support reading and writing to ext4, but it cannot boot from it – u-boot isn’t set up to boot from ext4 by default.

So, if you want to use and SSD and you want to enable TRIM, then the SSD must be a data only drive and you will need to boot from the internal flash or a USB.
To enable TRIM, you have to edit the fstab file that directs Linux on how to mount drives, and include the “discard” option.

1. SSH into your plug.

2. Stop Samba and the Tonido apps.

Code: Select all

/etc/init.d/samba stop
initctl emit tstop

3. Unmount your SSD drive, where “/media/disk1part1” is the SSD mount point.

Code: Select all

umount /media/disk1part1

4. Format the SSD as ext4, where “/dev/sda” is your SSD device.

Code: Select all

mkfs.ext4 /dev/sda1

5. Get the UUID of your drive.

Code: Select all

blkid

The output should look like:
/dev/sda1: UUID="6f938513-ac2c-4e2a-804b-887b302b8c2d" TYPE="ext4

6. Open fstab in nano.

Code: Select all

nano /etc/fstab

7. Find your drive by the UUID. Add “discard” to the line before “noauto”, so that it looks like the line below. If no line with that ssd exists, add this line.

Code: Select all

UUID=6f938513-ac2c-4e2a-804b-887b302b8c2d    /media/disk1part1 ext4 discard,noauto,defaults 0       0

8. Save and close.

Code: Select all

CRTL-o
ENTER
CTLR-x

9. Mount your drive.

Code: Select all

mount /dev/sda /media/disk1part1


Testing automatic TRIM:

1. To Test if Trim is working issue the following commands, where /media/disk1part1 is your SSD.

Code: Select all

cd  /media/disk1part1
sudo dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct
sudo hdparm --fibmap tempfile 

2. From the output copy the number under "begin_LBA" and use it in the next command. Replace 2638848 with the number obtained before and /sda with your SSD drive.

Code: Select all

sudo hdparm --read-sector 2638848 /dev/sda

3. You should receive a long string of characters for those sectors.

Code: Select all

sudo rm tempfile
sync
sudo hdparm --read-sector 2638848 /dev/sda

4. Even after removing the file the sectors are still not empty. Wait a while then run the command again.

Code: Select all

sudo hdparm --read-sector 2638848 /dev/sda

5. If you get only zeros, then automatic TRIM is working.

Source: http://askubuntu.com/questions/18903/how-to-enable-trim, https://wiki.archlinux.org/index.php/Fstab
Last edited by UrbanVoyeur on Sat Apr 07, 2012 10:20 am, edited 1 time in total.

palanmcmahon
Veteran Tonidoid
Veteran Tonidoid
Posts: 66
Joined: Mon Feb 20, 2012 12:50 pm

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby palanmcmahon » Sat Apr 07, 2012 10:11 am

great post.

non-geek
Rookie Tonidoid
Rookie Tonidoid
Posts: 7
Joined: Sun Apr 08, 2012 7:24 am

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby non-geek » Sun Apr 08, 2012 7:35 am

madhan wrote:We don't actively manage hdd spindown on the plug which runs the Linux OS. It is dependent on the power management settings on the HDD.


Since this is a feature that everyone using the tonidoplug2 would need, should it be included in the next firmware upgrade?

For a non geek like me, booting up using a usb with a alien operating system is a challenge.

For Tonidoplug2 to be successful, plug-and-play and easy-to-use feature is a must.

Please include the spin-down feature for internal hard disk to be implemented in next firmware upgrade.

jcjohnson
Rookie Tonidoid
Rookie Tonidoid
Posts: 2
Joined: Sun Apr 22, 2012 11:48 am

Re: Will my internal drive on my Tonido Plug2 ever stop spin

Postby jcjohnson » Sun Apr 22, 2012 11:52 am

I found that to control the tool, I needed to do: laptop_tools start instead of laptop-tools start.

Note the underscore instead of a hyphen.

Nice advice though. Thanks.


Return to “TonidoPlug Support”

Who is online

Users browsing this forum: No registered users and 7 guests