Other dd: /dev/da0: Invalid argument

The above error has been driving me nuts over the last few days and can't figure out why I'm getting it.

This is what I'm trying to do:-
Bash:
DISK=da0
gpart destroy -F $DISK
gpart create -s MBR $DISK
head -c 440 /boot/mbr >mbr-new
dd  if=mbr-new of=/dev/da0
gpart show da0

and this what I get:
Code:
da0 destroyed
da0 created
dd: /dev/da0: Invalid argument
0+1 records in
0+0 records out
0 bytes transferred in 0.000094 secs (0 bytes/sec)
=>       63  249644911  da0  MBR  (119G)
         63  249644911       - free -  (119G)

What am I doing wrong?
 
Output data size isn't 512 bytes.

I suspect you're trying to save the partition table? So you can write the ventoy bootcode to the master boot record? Use gpart backup/ gpart restore. That will backup and restore the partition table (and only the partition table, not the bootcode).
 
Back
Top