# Making FreeBSD 9 DVD .iso bootable on a USB drive



## FreeDomBSD (Feb 28, 2012)

At the location I'm at there is no Internet connection. I would like to use a DVD .iso file and boot with it.

I tried Unetbootin with no success.
I tried Universal USB Installer with no success.

Any recommendations?


----------



## dave (Feb 29, 2012)

You have the DVD and no way to burn it?


----------



## OH (Feb 29, 2012)

The memstick-edition?

ftp://ftp.freebsd.org/pub/FreeBSD/r...ES/9.0/FreeBSD-9.0-RELEASE-amd64-memstick.img
or of course
ftp://ftp.freebsd.org/pub/FreeBSD/r...GES/9.0/FreeBSD-9.0-RELEASE-i386-memstick.img


----------



## FreeDomBSD (Feb 29, 2012)

I have a 2+ GB ISO file without a way of making it bootable. The 600MB IMG files work excellent using win32 disk manager (as per handbook's instructions), but I need to "burn" the DVD ISO to a USB drive.


----------



## FreeDomBSD (Feb 29, 2012)

I could use Ubuntu, but *I* had trouble finding the right commands. This looks too complicated: http://www.cyberciti.biz/faq/linux-create-a-bootable-usb-pen/. I think there is an easier way.


----------



## bbzz (Mar 1, 2012)

If you are on Windows then Unetbootin is by far the easiest method. It is also easy if you have access to a live FreeBSD system as well.


----------



## FreeDomBSD (Mar 1, 2012)

bbzz said:
			
		

> If you are on Windows then Unetbootin is by far the easiest method. It is also easy if you have access to a live FreeBSD system as well.



I tried it, but it failed to boot


----------



## FreeDomBSD (Mar 1, 2012)

I've tried once more to use UNetBootin to make a i386 FreeBSD DVD iso image bootable on a USB drive. It took about two hours for the process to finish and the results are: non existent. The hardware totally ignores the idea that this USB drive has any bootable information on it (I tested booting of a USB drive prepared with an .img file as described above with good results.

Quite a frustrating problem. I do not yet understand the cause of this unbootability.

:/


----------



## FreeDomBSD (Mar 1, 2012)

I quick-formatted a 16gb USB flash drive with FAT32 fs under Windows instead of NTFS. I'm running UNetbootin once more to see if it makes a difference.


----------



## tingo (Mar 1, 2012)

Have you tried simply *dd*'ing the file (ISO image) to the USB device? (Note: to the root of the device, eg. da0, not da0s...). It has worked for me in the past (I haven't tried it with 9.0 yet)


----------



## FreeDomBSD (Mar 1, 2012)

tingo said:
			
		

> Have you tried simply dd'ing the file (iso image) to the usb device? (Note: to the root of the device, eg. da0, not da0s...)
> It has worked for me in the past (I haven't tried it with 9.0 yet)



Tingo, that flew over my head. Could you explain in detail how to *dd*.
Thanks!


----------



## Beastie (Mar 2, 2012)

FreeDomBSD, in every RELEASE announcement you can read:


> memstick
> 
> This can be written to an USB memory stick (flash drive) and used to do an install on machines capable of booting off USB drives. It also supports booting into a "livefs" based rescue mode. There are no pre-built packages.
> 
> ...



Also check dd(1).

You said you were formatting it with FAT32 instead of NTFS, but it doesn't matter since FreeBSD can only be installed on UFS or ZFS and the existing filesystem will be overwritten anyway.


----------



## FreeDomBSD (Mar 2, 2012)

The memory stick image (.img) works great. I can't get the .iso file to work. Will the command for .iso retain the format of the .img command?

After reading the man page I was no closer in understanding the function of the command. How is it different from copying?

I will try it out, assuming it's available in Ubuntu. 

If I can't get it to work I will buy a USB DVD burner.

Thank you so much for the tips!


----------



## Beastie (Mar 2, 2012)

FreeDomBSD said:
			
		

> The memory stick image (.img) works great. I can't get the .iso file to work. Will the command for .iso retain the format of the .img command?


The IMG must be dd-ed, the ISOs must be burnt.



			
				FreeDomBSD said:
			
		

> After reading the man page I was no closer in understanding the function of the command. How is it different from copying?


You mean doing copy/paste or using the cp(1) command? These copy files from a source to a target directory and work on a filesystem level. The dd(1) command has the ability to copy every single block (sector), in other words the boot sector, filesystem structures, etc.



			
				FreeDomBSD said:
			
		

> I will try it out, assuming it's available in Ubuntu.


It's a standard Unix command so it's available on practically everything UNIX(R)/Unix-like with small usage differences (related to devices and how they work).


----------



## bbzz (Mar 2, 2012)

You can't just *dd* .iso to USB stick, it won't boot. Instead, partition USB and add bootcode to it. Then mount .iso and copy contents from it to created USB partition. This is very easy if you have a working FreeBSD setup already. You also have dd for Windows, but I never tried it.


----------



## dave (Mar 2, 2012)

Why not just go to the local shop and buy a cheap USB CD/DVD drive?


----------



## tingo (Mar 2, 2012)

bbzz said:
			
		

> You can't just *dd* .iso to USB stick, it won't boot.


Yes, you can. Or at least, that is what I have done several times in the past. Simply *dd* the .iso file to the root of a USB memory stick. IIRC, this worked for me on 7.3-RELEASE, 8.1-RELEASE and 8.2-RELEASE at least. Both i386 and amd64. YMMV.


----------



## bbzz (Mar 3, 2012)

You are right, it can work but it really shouldn't.


----------



## kpa (Mar 3, 2012)

Debian's netinst ISO is meant to be used that way, the boot loader (I think it's GRUB) works out of the box both on a CD and on a memory stick.


----------



## T-Daemon (Mar 3, 2012)

You just could install the base FreeBSD system from the working memstick.img, afterwards mount dvd1.iso to that file system with mdconfig() (see below how to) and pkg_add the needed packages from there, presuming he package collection is what you need from the DVD. No need to buy a USB DVD burner.

`# mdconfig -a -t vnode -f /path/to/image.img -u 0`
`# mount -t cd9660 /dev/md0 /mnt`
After you are done:
`# umount /mnt`
`# mdconfig -d -u 0`


----------



## Beastie (Mar 3, 2012)

tingo said:
			
		

> Yes, you can. Or at least, that is what I have done several times in the past. Simply *dd* the .iso file to the root of a USB memory stick. IIRC, this worked for me on 7.3-RELEASE, 8.1-RELEASE and 8.2-RELEASE at least. Both i386 and amd64. YMMV.


Yep, there's an "emulation mode" where the BIOS sees USB mass storage devices as CDROM or floppies depending on the format.


----------



## FreeDomBSD (Mar 3, 2012)

tingo said:
			
		

> Yes, you can. Or at least, that is what I have done several times in the past. Simply *dd* the .iso file to the root of a USB memory stick. IIRC, this worked for me on 7.3-RELEASE, 8.1-RELEASE and 8.2-RELEASE at least. Both i386 and amd64. YMMV.



Under Ubuntu, the option to format my 14.91 GiB hard drive was grayed out. So I deleted the old FAT32 partition and made a new unformated partition (I considered not making any new partitions, but decided to try it with an unformated partition spanning the whole disk first).

Alright, so I used the command from the handbook and replaced .img with .iso.
The command went through OK.

I tried to boot off the USB and one again: nothing.

Ubuntu auto-mounts the USB drive as FREEBSD_INSTALL and you can browse the files on it. Meanwhile GParted thinks that the drive is unformatted and as I've mentioned it won't boot from it.

Maybe all I need now is a boot sector? How can I add one?


----------



## FreeDomBSD (Mar 3, 2012)

```
ubuntu@ubuntu:~$ cd /media/xdrive/
ubuntu@ubuntu:/media/xdrive$ sudo dd if=FreeBSD-9.0-RELEASE-amd64-dvd1.iso of=/dev/sdd bs=10240 conv=sync
233255+0 records in
233255+0 records out
2388531200 bytes (2.4 GB) copied, 715.281 s, 3.3 MB/s
```


----------



## FreeDomBSD (Mar 3, 2012)

dave said:
			
		

> Why not just go to the local shop and buy a cheap USB CD/DVD drive?



No good reason not to: as I mentioned, I'll do so if nothing else works. I'm just trying to learn a thing or two and operaiting within an environment where resource constraints (no USB DVDRW drive) force me to learn and experiment were always the way I learned the fastest (good way to "dive into" a subject for me as well). Plus it's pretty useful, wouldn't you say?


----------



## FreeDomBSD (Mar 3, 2012)

Maybe I can do something like this?
I know these are two different OSs, but boot code is boot code, right?



			
				https://help.ubuntu.com/community/BootFromUSB said:
			
		

> Either boot from the Ubuntu Desktop Live CD or mount it in the filesystem. Suppose that Ubuntu is running and the live CD is mounted in /media/cdrom (as simple as *sudo mount karmic-desktop-i386.iso /media/cdrom*), let's make a new dir and store vmlinuz and initrd in it:
> 
> ```
> sudo mkdir /boot/usb-boot
> ...


----------



## FreeDomBSD (Mar 3, 2012)

T-Daemon said:
			
		

> You just could install the base FreeBSD system from the working memstick.img, afterwards mount dvd1.iso to that file system with mdconfig() (see below how to) and pkg_add the needed packages from there, presuming he package collection is what you need from the DVD. No need to buy a USB DVD burner.
> 
> `# mdconfig -a -t vnode -f /path/to/image.img -u 0`
> `# mount -t cd9660 /dev/md0 /mnt`
> ...



Thanks! Great idea! I didn't think of it at all. I'll try it regardless if my success of failure with making a bootable USB drive from an .iso of the FreeBSD DVD.


----------



## tingo (Mar 3, 2012)

FreeDomBSD said:
			
		

> I tried to boot off the USB and one again: nothing.


Exactly how did you try to boot from this usb drive? Did you press the boot menu key (F8 on some BIOSes, F12 on others), or ...?



			
				FreeDomBSD said:
			
		

> Meanwhile GParted thinks that the drive is unformatted and as I've mentioned it won't boot from it.


What has GParted to do with booting anything? In my world GParted is used to partition a disk, it is not a boot manager...



			
				FreeDomBSD said:
			
		

> Maybe all I need now is a boot sector? How can I add one?


The image (.img) and the iso (.iso) already contains a boot sector. Why do you think that replacing it with another one would help anything?
Either your machine can boot from a boot sector, or it can't.


----------



## FreeDomBSD (Mar 3, 2012)

I have a newer Thinkpad I'm trying this on. It boots from a live Ubuntu USB drive (that's how I used the *dd* command) and from the USB drive that I made with FreeBSD 9 .img. I don't have to press anything: the Thinkpad automatically set up to boot from USB first. 

For the heck of it I tried it on a desktop PC with the same (non-booting) results.

As for other things, I'm just trying different things and brainstorming. I don't know much about UNIXes, but I was attempting to work through the problem with what I knew about:

Gparted says: there are no partitions on the disk, but I definitely see a file system with folders and files -- so I mention it. I didn't mean to confuse/offend.


----------



## linuxmq (Mar 22, 2015)

I realized this is 3 years old now and FreeBSD has moved to newer files. However I noticed that the issue is very similar among several ISO burning to USB questions using any of the available conversion/burning applications such as Unetbootin.

I also had similar issues. I go through the entire process to end up with a USB stick that just can't boot.

Until I realized that the partition that is supposed to be booting is not "active" or not flagged as "boot".

If using Unetbootin in Windows, launch Diskpart and select your disk and partition. then just type "active".
If using Unetbootin in Linux, launch `gparted` and right click the partition to boot, then select "manage flag" and click "boot".

This hopefully should help resolve your non booting stick.

It worked for me.


----------



## Areeb Qaisar (Nov 21, 2016)

linuxmq said:


> I realized this is 3 years old now and FreeBSD has moved to newer files. However I noticed that the issue is very similar among several ISO burning to USB questions using any of the available conversion/burning applications such as Unetbootin.
> 
> I also had similar issues. I go through the entire process to end up with a USB stick that just can't boot.
> 
> ...



But in case of FreeBSD, it did not worked for me


----------



## dave (Nov 21, 2016)

Now you can just use the memstick images and write them directly to USB


----------



## Areeb Qaisar (Nov 22, 2016)

dave said:


> Now you can just use the memstick images and write them directly to USB



Yes, but the Memstick editions lacks many packages. 
To install a Desktop Environment such as KDE etc we need to connect to internet and download the packages.
In case of KDE, I remember the download size was around 1 GB, which is huge.


----------



## ANOKNUSA (Nov 22, 2016)

Areeb Qaisar said:


> In case of KDE, I remember the download size was around 1 GB, which is huge.



It pretty much all equals out in the end. KDE plus all dependencies is about 1GB to download. The DVD image is over 2GB. The CD image will almost certainly lack some packages you want, necessitating that you install them from the Internet. It doesn't matter how the packages get on your system; ultimately, you're going to have to download more than 1GB to get the FreeBSD desktop you want.


----------



## Areeb Qaisar (Nov 25, 2016)

ANOKNUSA said:


> It pretty much all equals out in the end. KDE plus all dependencies is about 1GB to download. The DVD image is over 2GB. The CD image will almost certainly lack some packages you want, necessitating that you install them from the Internet. It doesn't matter how the packages get on your system; ultimately, you're going to have to download more than 1GB to get the FreeBSD desktop you want.



Absolutely true. But in my case, I am a FreeBSD Beginner, and while configuring I made up mistakes, which made the system non-bootable. Therefore I had to install FreeBSD a couple of time in last few days. So for me, I was looking for a method to install from DVD.


----------

