# eMMC storage



## balanga (Jan 2, 2018)

I have a Z83 Mini-PC with Windows 10 installed on 32GB eMMC storage, how would I go about replacing that with FreeBSD?


----------



## Phishfry (Jan 3, 2018)

Well with an x86 board you could just boot up off a FreeBSD memstick and install it from there.
If it were me, I would go into LiveCD mode, use `ls /dev` to get an idea of what the mmc node is called.


----------



## balanga (Jan 3, 2018)

Unfortunately it stops in the process of booting - last msg being:-

```
atkbd0: [GIANT-LOCKED]
ppc0: cannot reserve I/O range
```


----------



## balanga (Jan 3, 2018)

https://forum.opnsense.org/index.php?topic=3927.0

Sounds like I may need to try FreeBSD 12...


----------



## balanga (Jan 3, 2018)

FreeBSD 12.0-CURRENT gives me this:-


```
atkbd0: [GIANT-LOCKED]
atkbdc0: non-PNP ISA device will be removed from GENERIC in FreeBSD 12.
```


----------



## balanga (Jan 3, 2018)

Been here before ...

Thread 60224


----------



## balanga (Jan 3, 2018)

Phishfry said:


> Well with an x86 board you could just boot up off a FreeBSD memstick and install it from there.
> If it were me, I would go into LiveCD mode, use `ls /dev` to get an idea of what the mmc node is called.




```
crw-r-----   1 root  operator  0x38 Jan  3 15:32 mmcsd0
crw-r-----   1 root  operator  0x4b Jan  3 15:32 mmcsd0boot0
crw-r-----   1 root  operator  0x4c Jan  3 15:32 mmcsd0boot1
crw-r-----   1 root  operator  0x39 Jan  3 15:32 mmcsd0p1
crw-r-----   1 root  operator  0x3a Jan  3 15:32 mmcsd0p2
crw-r-----   1 root  operator  0x3b Jan  3 15:32 mmcsd0p3
crw-r-----   1 root  operator  0x3c Jan  3 15:32 mmcsd0p4
crw-r-----   1 root  operator  0x4d Jan  3 15:32 mmcsd0rpmb
```

`gpart show`

```
=>      34  60620733  mmcsd0  GPT  (29G)
        34      2014          - free -  (1.0M)
      2048    204800       1  efi  (100M)
    206848    262144       2  ms-reserved  (128M)
    468992  58542080       3  ms-basic-data  (28G)
  59011072   1607680       4  ms-recovery  (785M)
  60618752      2015          - free -  (1.0M)
```


----------



## Phishfry (Jan 4, 2018)

Well from here you have to decide if you want to wipe the whole eMMC. If so just dd zero it.
`dd if=/dev/zero of=/mmcsd0 bs=1M`

You probably could just `gpart destroy` the GPT if you want to save some time.

Perhaps you could backup the eMMC before destroying contents in case you ever want to revert back.


----------



## Phishfry (Jan 4, 2018)

If using FreeBSD on the eMMC you need to consider the use of `trim` and also you might want to reduce the level of logging to avoid costly disk writes.
If you notice on Arm they offload 3 directories to memory disks via fstab. That is an approach worth considering.
The idea being that the eMMC is a fixed drive. Once you burn it up there is no replacing it.
It does make for a nice OS drive for things like tvheadend or even zoneminder.
I put the OS plus apps on eMMC and use SATA for storage which has a high turnover rate.

edit#looking at yours there is no eSATA jack, but I do see USB3 and SD Card slot.
These would also be good for external storage. You really want to go easy on the eMMC.

Seeing how you need to run -CURRENT then you really need to recompile after install to build/`installkernel KERNCONF=GENERIC-NODEBUG` .
All those debugging features on -CURRENT write to the disk and slow down things.
Plus lots of console chatter that is meaningless.

Are you using this for a media center or desktop?
Not sure if Xorg Intel drivers work with this. I think on -CURRENT there is a newer Intel drm driver.


----------



## balanga (Jan 4, 2018)

Thanks for the suggestions...

After some experimenting, I've found that I can run 11.1-RELEASE if /boot/loader.conf contains:-

```
hint.uart.0.disabled="1"
hint.uart.1.disabled="1"
```

For the time being, I'll leave Windows installed and run FreeBSD from a USB hard disk to see how well it works and maybe eventually copy it to eMMC.
eMMC is new to me and the idea of wearing it out is something I hadn't considered. Are there any indicators of how much life is left?

As for backing up what is installed, can I do that using `dd` or maybe I should use the internal Windows 10 backup option, but then I would need to have Windows installed to be able to restore - seems like a Catch 22 situation...

Also wondered if using the UEFI shell provided a means of copying files from one device to another.


----------



## Phishfry (Jan 4, 2018)

balanga said:


> Are there any indicators of how much life is left?


There does not seem to be a good indicator of wear.
Some SSD manufacturers have their own tools but no there is no SMART on my eMMC's.
sysutils/smartmontools has the `smartctl` tool for devices with SMART enabled in the BIOS.
That tool has mad specs down to number of power-ups and total hours ran and temperatures



balanga said:


> As for backing up what is installed, can I do that using  dd


Yes indeed. there are also graphical tools like Clonezilla Live Memstick.
I have also used bootleg WinPE8SE on memstick which has some image tools.



balanga said:


> Also wondered if using the UEFI shell provided a means of copying files from one device to another.


I certain hope not. Whoever decided to put a filesystem in the BIOS should have a pack of wild cats lick him to death..


----------

