Monday, 10 December 2012

ZFS pre-requisites before kernel patching.

Hi Guys,
Here are the few steps you need to check before you initiate kernel patch upgrade.

#zfs list  -o name,creation -t snapshot
This command gives the name and creation date if snapshot.

Sample Output

NAME                                                        CREATION
root@S1                                                   Wed Apr 22 12:35 2009
root/ROOT@S1                                      Tue Apr 21 22:00 2009
root/ROOT/zfsroot@S1                         Tue Apr 21 22:00 2009
root/ROOT/zfsroot/var@S1                  Tue Apr 21 22:00 2009

#zfs list -H -t snapshot|cut -f1 
 This command will list only the snapshots.


Script for removing the snapshots

for i in `zfs list -H -t snapshot|cut -f1`
do
zfs destroy $i
done

Creating Snapshots

zfs snapshot -r root@S1

Rolling back the snapshots.

# zfs rollback -r root/ROOT@S1

# zfs rollback -r root/ROOT/zfsroot@S1

# zfs rollback -r root/ROOT/zfsroot/var@S1

Booting with Snapshot from OBP

OK> boot -Z root/ROOT/zfsroot@S1

To list all the reservations from the zpool.

# zfs get -r refreservation root

To disable the reservations from the zpool.

# zfs set refreservation=none root/ROOT/zfsroot
# zfs set refreservation=none root/ROOT/zfsroot/var

No comments:

Post a Comment