# How can i create bootable usb in FreeBSD?



## create_bootable_usb (Mar 21, 2018)

Hi,
I installed FreeBSD 11.1 with Kde and it works. (It doesnt have gpu accelerator but works anyway)

Question is how can I create bootable Windows10 usb or Ubuntu usb in FreeBSD?

I downloaded the ubuntu-16.04.4-desktop-amd64.iso file. If it's possible I can download Windows10-x64.iso too.

Is that possible?

I created Windows10 bootable usb in Ubuntu with WoeUsb. I just want to make Ubuntu or Windows10 bootable usb drive in FreeBSD.


----------



## ShelLuser (Mar 21, 2018)

Depends. If it's a full (raw) filesystem image you should be able to use dd to place it onto the memory stick. Just be very careful that you access the right device (check using either `gpart`, `sysctl kern.disks` or perhaps even the output from `dmesg`).

Also be sure the image is indeed usable on a memory stick. Quite often ISO images are mainly provided for burning onto optical media (for which sysutils/cdrtools might be useful).


----------



## create_bootable_usb (Mar 21, 2018)

Thats my usb drive.

```
<SanDisk Cruzer Blade 1.26>        at scbus3 target 0 lun 0 (da0,pass3)
```


Windows10 and Ubuntu iso files is usable on a memory stick. Whats can i do now?

I tryed to extract all Ubuntu.iso files to the Usb but it stuck in the initramfs. So extracting doesnt work.

Gnome looks more clean and it has more useful features than Kde. I am disappointed with Kde at this moment.

Is there any packages like Disk Utility for FreeBSD?


----------



## ShelLuser (Mar 21, 2018)

As I mentioned above: you could use dd, see dd(1). Whether it works or not depends on the used image obviously.


----------



## create_bootable_usb (Mar 21, 2018)

```
dd if=/home/john/ubuntu-16044-desktop-amd64.iso of=/dev/da0
```

Gives an error.

```
dd: /dev/da0: Operation not permitted
```

I write this.

```
umount /dev/da0*
```

and this.

```
# sudo fdisk -l
```

and this.

```
mkfs.vfat /dev/da0 -I
```

Started.

```
dd if=/home/john/ubuntu-16044-desktop-amd64.iso of=/dev/da0
```

I accidentally stopped it with Ctrl+S

```
^C219817+0 records in
219816+0 records out
112545792 bytes transferred in 449.702716 secs (250267 bytes/sec)
```

Process will take 100 minutes.

i did exactly same things again after formatting the usb drive. But it gives an error again.

```
dd: /dev/da0: Operation not permitted
```

I removed the drive and plugged in. Now it started again.


----------



## priyadarshan (Mar 21, 2018)

For Ubuntu and many other similar distros, one could use sysutils/unetbootin


----------



## create_bootable_usb (Mar 21, 2018)

priyadarshan said:


> For Ubuntu and many other similar distros, one could use sysutils/unetbootin



I installed unetbootin.

```
pkg install unetbootin
```

How can *I* run it with root privileges? This pkg will make easy this process.


----------



## priyadarshan (Mar 21, 2018)

create_bootable_usb said:


> How can i run it with root privileges?



I do not have a workstation handy with unetbootin installed, but, if you go to a terminal and try to launch it, it will quit, giving the exact command to use to launch it with sudo. I remember one needs to set an environment variable, I do not remember which.


----------



## create_bootable_usb (Mar 21, 2018)

priyadarshan said:


> I do not have a workstation handy with unetbootin installed, but, if you go to a terminal and try to launch it, it will quit, giving the exact command to use to launch it with sudo. I remember one needs to set an environment variable, I do not remember which.



I write this.

```
cd /usr/local/bin/
```


gives an error.

```
# su -m john -c unetbootin
No protocol specified
unetbootin: cannot connect to X server :0
```


I can run Unetbootin without root privileges. Doesnt work properly without root.


----------



## scottro (Mar 21, 2018)

I haven't used unetbootin in years.  I do know that some people were having problems with it (on Linux).
I may have missed something in this this thread.  Is there a reason you can't have root privileges? The dd command definitely requires it, and almost all Linux iso files can now be burned to a USB with the dd command, as mentioned earlier.  However, you do need root privilege.  (Had you done the dd command you mentioned earlier with root privilege, it should have worked).


----------



## create_bootable_usb (Mar 21, 2018)

scottro said:


> I haven't used unetbootin in years.  I do know that some people were having problems with it (on Linux).
> I may have missed something in this this thread.  Is there a reason you can't have root privileges? The dd command definitely requires it, and almost all Linux iso files can now be burned to a USB with the dd command, as mentioned earlier.  However, you do need root privilege.  (Had you done the dd command you mentioned earlier with root privilege, it should have worked).



I am just waiting dd command at the moment. Running dd command with root privileges.

I couldn*'*t believe 1,5 GB ISO file takes 2 hours to burn in USB. I stopped it many times because of this and dd command doesn*'*t have progress bar. I thought it wasn*'*t working. But not anymore *I* am waiting dd command. Lets see what dd command can do.


----------



## scottro (Mar 21, 2018)

Though there is no progress bar, (on Linux you can do something like status=progress, don't think FreeBSD has that) you can do ctl+t which will show how much has happened so far and won't stop it from continuing.


----------



## create_bootable_usb (Mar 21, 2018)

dd command worked! Thanks everyone.


----------

