Hi,
I use a zvol to export an iScsi Disk to my PC (NTFS filesystem)
I know that i can't take a snapshot of the zvol any time since ZFS didn't know any state of the underlying filesystem and snapshots may be inconsistents.
So, i want to do a script that perform this:
- check if the extent is "online" (that mean the PC is connected to the iscsi target throw the portal)
- if yes : store somewhere the target was used at least once from the last snapshot
- if not and if the target was used at least once from the last snapshot, i do a snapshot of the zvol, store now that the target was not used from the last snapshot and ending by exporting/destroying the snapshot.
I want to execute this script every minutes that allow me to save my disk each time i will shutdown my computer (without to boring when it will be and how many often it can occur).
So my question is
- How to poll the state of an iscsi target from a os-shell (ie connected or not) ?
Best regards,
Sébastien.
I use a zvol to export an iScsi Disk to my PC (NTFS filesystem)
I know that i can't take a snapshot of the zvol any time since ZFS didn't know any state of the underlying filesystem and snapshots may be inconsistents.
So, i want to do a script that perform this:
- check if the extent is "online" (that mean the PC is connected to the iscsi target throw the portal)
- if yes : store somewhere the target was used at least once from the last snapshot
- if not and if the target was used at least once from the last snapshot, i do a snapshot of the zvol, store now that the target was not used from the last snapshot and ending by exporting/destroying the snapshot.
I want to execute this script every minutes that allow me to save my disk each time i will shutdown my computer (without to boring when it will be and how many often it can occur).
So my question is
- How to poll the state of an iscsi target from a os-shell (ie connected or not) ?
Best regards,
Sébastien.