How to rollback a ZFS snapshot in Solaris?



  • To discard all changes made since a snapshot was taken and revert the filesystem back to its state at the time the snapshot was taken:

    # zfs rollback <snapshot_to_roll_back_to>
    
    # zfs rollback test_pool/fs1@monday
    

    Note: if the filesystem you want to rollback is currently mounted, you will need to unmount it and remount it. Use -f to force unmount.

    You can only rollback to the most recent snapshot. If you want to rollback to an earlier snapshot, either delete the snapshots in between or use the -r option.

    # zfs rollback test_pool/fs1@monday
    cannot rollback to test_pool/fs1@monday  more recent snapshots exist
    use to force deletion of the following snapshots:
    test_pool/fs1@tuesday
    test_pool/fs1@wednesday
    
    # zfs rollback -r test_pool/fs1@monday
    


© Lightnetics 2024