# Updating when rootfs is in RAM?

**URL:** <https://hub.mender.io/t/updating-when-rootfs-is-in-ram/1127>\
**Category:** General Discussions\
**Created:** [October 9, 2019, 4:18am UTC](https://hub.mender.io/t/updating-when-rootfs-is-in-ram/1127 "2019-10-09T04:18:33Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 9, 2019, 10:42am UTC](https://hub.mender.io/t/updating-when-rootfs-is-in-ram/1127/5 "2019-10-09T10:42:05Z")

</div>

I am wondering if this code,

```auto
	// First check if mountCandidate matches rootDevice
	if mountCandidate != "" {
		if rootChecker(p, mountCandidate, rootDevice) {
			p.active = mountCandidate
			log.Debugf("Setting active partition from mount candidate: %s", p.active)
			return p.active, nil
		}
		// If mount candidate does not match root device check if we have a match in ENV
		if checkBootEnvAndRootPartitionMatch(bootEnvBootPart, mountCandidate) {
			p.active = mountCandidate
			log.Debug("Setting active partition: ", mountCandidate)
			return p.active, nil
		}
		// If not see if we are lucky somewhere else
	}

```

Should be converted to:

```auto
	// First check if mountCandidate matches rootDevice and ENV
	if mountCandidate != "" {
		if rootChecker(p, mountCandidate, rootDevice) && checkBootEnvAndRootPartitionMatch(bootEnvBootPart, mountCandidate) {
			p.active = mountCandidate
			log.Debugf("Setting active partition from mount candidate: %s", p.active)
			return p.active, nil
		}
		// If not see if we are lucky somewhere else
	}

```

@kacf, any input?

---

_[View the full topic](https://hub.mender.io/t/updating-when-rootfs-is-in-ram/1127)._
