# Clearing state partition when using iPXE boot

**URL:** <https://forums.suse.com/t/clearing-state-partition-when-using-ipxe-boot/2313>\
**Category:** RancherOS\
**Created:** [April 5, 2016, 3:46am UTC](https://forums.suse.com/t/clearing-state-partition-when-using-ipxe-boot/2313 "2016-04-05T03:46:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roman\_Shtylman](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/roman_shtylman/32/1164_2.png) [@Roman\_Shtylman](https://forums.suse.com/u/Roman_Shtylman)\
**Post date:** [April 5, 2016, 3:46am UTC](https://forums.suse.com/t/clearing-state-partition-when-using-ipxe-boot/2313/1 "2016-04-05T03:46:37Z")

</div>

I have botched up my state such that my rancher instance doesn’t boot into a console. I have no critical data and just want to re-do the PXE boot and have it format the state partition. I can’t seem to find the option to do this. It always seems to want to mount the state partition and try to use it instead of formatting it and starting with a fresh state.

Any tips/help in formatting the state partition would be appreciated! Or a way to launch maybe with no state?

---

<div class="post-metadata">

**Author:** ![imikushin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/imikushin/32/17_2.png) [@imikushin](https://forums.suse.com/u/imikushin)\
**Post date:** [April 8, 2016, 5:22pm UTC](https://forums.suse.com/t/clearing-state-partition-when-using-ipxe-boot/2313/2 "2016-04-08T17:22:08Z")

</div>

On boot RancherOS will always try to mount a device labeled RANCHER\_STATE first. You might want to start with an empty disk.

You can append `rancher.state.formatzero=true rancher.state.autoformat=[/dev/sda,/dev/vda]` to kernel params, but your disk should have (at least) 1MB (1048576 bytes) prefix of zero bytes to be considered for auto-formatting (that’s the reason for `rancher.state.formatzero=true`): we don’t want to wipe your data by accident.

---

<div class="post-metadata">

**Author:** ![Roman\_Shtylman](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/roman_shtylman/32/1164_2.png) [@Roman\_Shtylman](https://forums.suse.com/u/Roman_Shtylman)\
**Post date:** [April 8, 2016, 5:35pm UTC](https://forums.suse.com/t/clearing-state-partition-when-using-ipxe-boot/2313/3 "2016-04-08T17:35:34Z")

</div>

Sorry, forgot to update this. I figured out how to do what I needed thanks to @ibuildthecloud

Adding the following to my kernel command line lets me start with no state.

> rancher.state.dev=none

I created a menu entry in PXE for booting rancher with no state just incase I do something really bad and have to start over.

I appreciate that rancher doesn’t wipe by default and think that is an excellent choice/feature. In my case I needed a way to avoid loading the state and setting the bytes to 0 doesn’t cut it cause to do that I need to boot into an OS and rancher is the OS I wanted to boot.
