Monday, February 14, 2011

Rolling Back a Root Pool Snapshot From a Failsafe Boot

This procedure assumes that existing root pool snapshots are available. In this example, the root pool snapshots are available on the local system

# zfs snapshot -r rpool@0730
# zfs list
rpool 6.87G 60.1G 37K /rpool
rpool@0730 18K - 37K -
rpool/ROOT 3.87G 60.1G 18K legacy
rpool/ROOT@0730 0 - 18K -
rpool/ROOT/zfs1008BE 3.87G 60.1G 3.82G /
rpool/ROOT/zfs1008BE@0730 52.3M - 3.81G -
rpool/dump 1.00G 60.1G 1.00G -
rpool/dump@0730 16K - 1.00G -
rpool/export 52K 60.1G 19K /export
rpool/export@0730 15K - 19K -
rpool/export/home 18K 60.1G 18K /export/home
rpool/export/home@0730 0 - 18K -
rpool/swap 2.00G 62.1G 16K -
rpool/swap@0730 0 - 16K -

1. Shutdown the system and boot failsafe mode.

ok boot -F failsafe
Multiple OS instances were found. To check and mount one of them
read-write under /a, select it from the following list. To not mount
any, select 'q'.

1 /dev/dsk/c0t1d0s0 Solaris 10 xx SPARC
2 rpool:5907401335443048350 ROOT/zfs1008

Please select a device to be mounted (q for none) [?,??,q]: 2
mounting rpool on /a

2. Roll back the individual root pool snapshots

# zfs rollback rpool@0730
# zfs rollback rpool/ROOT@0730
# zfs rollback rpool/ROOT/zfs1008BE@0730
# zfs rollback rpool/export@0730

Current ZFS snapshot rollback behavior is that recursive snapshots are not rolled back with the -r option. You must roll back the individual snapshots from the recursive snapshot.

3. Reboot back to multiuser mode
# init 6

No comments:

Post a Comment