View Source

h1. SmartOS Clean Re-install

SmartOS can be re-installed clean on a previously used system after removing the old persistent zpool made by the installation script.
This zpool is named "zones" by default.

{note}Migrate all important ZFS snapshots, VM datasets, KVM images, /usbkey/config NIC settings, or persistent SMF scripts that you want to keep onto another system. This procedure WILL DESTROY all the persistent information stored in ZFS on the system.
{note}

Reboot SmartOS from media and choose the GRUB menu \[Live 64-bit(noinstall)\] option.
This disables the setup script and avoids importing and activating the persistent zpool.

Login and password are both "root" for single user (noinstall) mode.

From a SmartOS prompt the system can be scheduled for a factory reset (which will *DELETE* your zpools and the data on them) on the next reboot:

{code}
#zfs set smartdc:factoryreset=yes zones/var
#reboot
{code}

Reboot will take you back to the GRUB menu, and the default installation script will be activated after timeout.

{note}If you can't or want to avoid boot, you can set *destroy_zpools=true* in grub boot params to do the same thing. WARNING: this will destroy *ALL* zpools, not just zones.
{note}


NOW you should be at the point where you can reboot with a system with raidz2 with compression.

The system will find no old zpool to refer to on the drive and it is ready for a clean installation.

h3. Changing the zpool default configuration

Using the method, i.e., choosing the GRUB menu \[Live 64-bit(noinstall)\] option we can recreate the zpool with a different configuration (a raidz1 by default):

{code}
# zpool import zones
# zpool destroy zones
{code}
Now, instead of rebooting the OS, you can create a new zpool with different options:

{code}
# zpool create zones raidz2 c0t1d0 c1t1d0 c4t1d0 c5t1d0 c6t1d0 c7t1d02
{code}
NOW you should be at the point where you can reboot with a system with raidz2.

From [the mailing list|http://www.listbox.com/member/archive/184463/2013/09/sort/time_rev/page/1/entry/11:119/20130911232921:808DAAE6-1B5B-11E3-AC7D-B76A33434032/]. Thanks to Christopher W.V. Hogue.