# How to install 440B MBR



## balanga (Jul 23, 2019)

Is it possible to use FreeBSD's dd() to install a 440B MBR on a USB stick?  My attempts so far have resulted in 





> dd: /dev/da0: Invalid argument


This works fine with Linux's `dd`.


----------



## Alain De Vos (Jul 24, 2019)

If have not tried it, but first anything need to be destroyed with  gpart destroy da0.
da0 should be a character device.


----------



## aragats (Jul 24, 2019)

balanga said:


> Is it possible to use FreeBSD's dd() to install a 440B MBR on a USB stick?  My attempts so far have resulted in `dd: /dev/da0: Invalid argument`
> This works fine with Linux's `dd`.


BSD's dd() uses 512-byte blocks when working with block devices. However, you can easily do that:
1) Back up your first block:

```
dd if=/dev/da0 of=first512.img count=1
```
2) Copy MBR to that file without destroying the partition table etc (using 1-byte blocks):

```
dd if=mbr of=first512.img bs=1 conv=notrunc
```
3) Now copy that 512-byte block back to your device:

```
dd if=first512.img of=/dev/da0
```


----------

