WhiteTiger
Explorer
- Joined
- Jan 2, 2014
- Messages
- 86
I would like to keep some disks offline, for example two internal and one external on USB, and take them online at a certain time.
How can I do?
How can I do?
FreeNAS isn't designed for this.
What might be possible depends on your concept of "offline".
Are these going to be powered on all the time? That fails many definitions of "offline", but you might be able to do that and just have a cron script to import the pool at the desired time.
If they're not going to be powered on all the time, you'd be better off having the operator coordinate with the NAS when the disks are attached and powered on.
My idea might be that some discs are connected and configured, but not mounted.
Obviously in this case they are not accessible to users or to the same services as the NAS, for example they are not accessible for backup.
However, a script could mount them and this script can be started at a certain time or launched by a service.
Great!Okay, so disks just sort of standing by. You can implement a script to do whatever you'd like and call it from cron ("scheduled task"). It won't really be easy to have it do anything NAS-y, but you could use it for making a backup copy of data or something like that.
If you just yank out (export) a pool, the shares from it remain (although the user experience of trying to access it at that point may not be pretty... probably timeouts and other errors), when you re-attach (import) it again, all the shares would start working as before.
Maybe look here for some inspiration:
How to: Backup to local disks
How to: Backups to local disks Overview: This subject comes up often enough that I thought I would start a post of how I do it. Specifically I back up my TrueNAS to a hot-inserted, locally attached disk, then when done, hot-remove and take...www.truenas.com
I disagree.The document reported does not help me much.
At a predetermined time a script mounts two other HDDs already configured but kept offline.
https://www.truenas.com/community/resources/how-to-backup-to-local-disks.26/ said:zpool import Backup
Once these are online too, the first 5 HDDs will be backed up on these two.
You need to write the syntax of that script to tell rsync what to send to the Backup Pool.https://www.truenas.com/community/resources/how-to-backup-to-local-disks.26/ said:./backup_freenas_rsync
At the end of the backup, the two HDDs are placed offline again.
https://www.truenas.com/community/resources/how-to-backup-to-local-disks.26/ said:Export backup disk:
cd /
sync
zpool status Backup
zpool export Backup
zpool list
rsync does thatSo the folders on the "offline" disks must already be created.
If you were to follow all of the steps it mentioned, yes.The document reported instead assumed that a disk was hot-inserted and hot-removed when the job was finished.
Right... hence export the pool and only import it when you want to use it, then export it when done.In fact, I thought I had a second RAID (RAID 0 or 5/6) that I would like to put online only when I need it and put offline when the job was finished.
Yes, it can.It can be done / no, it cannot be done.
Any ZFS pool will work, RAIDZ, Mirror or otherwise.It can be done, but only with single disks, not with RAID.
Nope. No reboot required.It can be done, but you need to reboot before you can use them.
You would need to script the stop/start of jails/plugins to correspond with what you're doing. Some plugins/jails could work to help, but are not specifically required.Can / cannot be done using this plugin / app
Do what you want. If you're going to script things, then the possibilities are endless.We recommend that you do this other thing instead.
What I was expecting are answers like, for example, these:
It can be done / no, it cannot be done.
It can be done, but only with single disks, not with RAID.
It can be done, but you need to reboot before you can use them.
Can / cannot be done using this plugin / app
We recommend that you do this other thing instead.
About the document, I'm re-reading it better, to immediately do some tests with a NAS using a Virtual Machine.
As I said earlier, the goal is to manage a backup.
I am not talking about an Enterprise environment, nor a home environment.
I'm talking about a small office where I want to secure backups made from the NAS or PC so that if ransomware comes along, it won't find all the drives online.
I want to avoid human intervention because I have no guarantee that the job will then be done or done correctly.