Zpool offline and disks spindown

markoff

Cadet
Joined
Mar 15, 2019
Messages
5
Hi! I would like to poweroff a specific group of hdd because I have a zpool with just 1 vdev that is accessed less than once a week (sometimes less than once a month).
I don't have howswap bay and I would like to be able to "poweroff" unused hdd via software and bring em up online in the same way.

How can I achieve this without phisically disconnect power cable from hdd?

I was thinking about "zpool offline -t" but it doesn't spindown hdd inside that zpool.

Any advice?
Thanks in advance!
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
It takes some planning before the pool is ever created to be able to have a pool that can do that, partly because FreeNAS puts a swap partition on every disk by default, and you can't just spin down a disk with a swap partition. Do you already have data on the pool?
 

markoff

Cadet
Joined
Mar 15, 2019
Messages
5
It takes some planning before the pool is ever created to be able to have a pool that can do that, partly because FreeNAS puts a swap partition on every disk by default, and you can't just spin down a disk with a swap partition. Do you already have data on the pool?

I didn't expect that. No, I don't have any data on those disk at the moment so I can do everything I need to.
I know it's something that no one usually do, any help/hint is really appreciated!
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
I didn't expect that. No, I don't have any data on those disk at the moment so I can do everything I need to.
I know it's something that no one usually do, any help/hint is really appreciated!
Just to be sure, you have another pool that is not going to spin-down, right? That pool was created first? If that is true, it solves some of the potential problems right up front.
I built a system that would spin the disks down once, so I know that there is a lot involved in getting it to work, but some things have changed since then. I don't claim to be the authority on it, so I will give you some links to reading on the subject. The first is possibly best, but do take some time to read through these and understand it is a project because it is a change from the default configuration of FreeNAS in many ways.
One of the biggest and I am not sure this is covered in the documents I am about to link you to, is that you need to delete the swap space from the disks that will be used in the pool that can spin-down. The easy way to get there is by exporting the pool and checking the box for "Destroy data on this pool" so the disks will be cleaned. See documentation here:
https://www.ixsystems.com/documentation/freenas/11.2/storage.html#export-disconnect-a-pool
Then, change the value in "Swap size in GiB" under the Advanced tab to zero. See that in the documentation here:
https://www.ixsystems.com/documentation/freenas/11.2/system.html#advanced
Once set to zero, there will be no swap partition created on the pool when you make it again. After the pool is created, you can set this value back to default if you wish or leave it at zero. It is only a factor to consider when a pool is created and possibly when a disk is replaced. I am not sure if the functionality has been changed but there was some discussion that if a disk is replaced due to disk failure and this value was set to zero at the time, the new disk would also have no swap space regardless of if the disk being replaced did have swap space. This means you need to keep track of which disks have swaps space and which disks don't and set this value accordingly before replacing a disk when you have a disk failure. So, there is an extra admin burden on you. The way swap space on the disks is used changed after FreeNAS version 11.1, so documents from before that may reference the "old way" where all disks in the system were always used as a single large swap space. Now, the first ten disks to come ready at boot are used for swap space, and only the first ten to come ready, no matter how many disks you have, and it is not always the same ten disks, so if your other pool has less than ten disks, it is a guarantee that disks in the pool you want to sleep would be used for swap without doing this. By deleting the swap space, you ensure that they can't be used for swap and that is only one of the steps in this journey.

Here are the links to further discussion:
https://www.ixsystems.com/community/threads/how-to-let-drives-spin-down.26314/

https://www.ixsystems.com/community/threads/hdd-standby-spindown.10763/

https://www.ixsystems.com/community/threads/how-to-spin-down.62709/

https://www.ixsystems.com/community...s-and-checking-power-states-new-script.41559/

https://www.ixsystems.com/community/threads/rules-of-thumb-for-disk-power-management.40691/

Like I said, it has been a while since I did this but I remember it took quite a bit of work to get it all working right.
 
Top