• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

HOWTO: Create FreeBSD USB bootable disk from a Mac

torr_from_fallout2

Member

Thanks: 19
Messages: 43

#1
HOWTO: Create FreeBSD USB bootable disk from Mac
Purpose:
The purpose of this HOWTO is to teach inexperienced users on how to create a USB bootable disk from a Apple Macintosh computer.

Assumption:
You are running OSX Mountain Lion

Steps:
Step 1:
We must download the distro. we are looking to install. Go to the following link:
http://www.freebsd.org/where.html

Step 2:
Select 'i386' if the computer you are setting up FreeBSD on cannot support x64 bits, else it's recommended to select the 'amd64' distro. Once you have decided, select "ISO". If you don't know which one to choose, read up more here

Step 3:
Login in as 'Guest'

Step 4:
Copy the file with the 'memstick' keyword to your desktop. I will select the "FreeBSD-10.0-RELEASE-amd64-memstick.img" and will use it throughout this demonstration.

Step 5:
Load up your terminal. If you don't know where it is, go to:
Applications -> Utilities -> Terminal

Step 6:
Insert the USB stick that you want to use. Note: All data on the disk will be deleted!

Step 7:
Type in the following in the terminal and look for the name of the USB device:
Code:
df -h
Step 8:
Once you found the device in the list, make a note of it because the next step we are going to unmount it (note: disk1s1 is the id of my USB, yours will vary, so make a note of what yours is):
Code:
sudo diskutil umount /dev/disk1s1
Step 9:
Now, I'm assuming you copied your "FreeBSD-10.0-RELEASE-amd64-memstick.img" file to your desktop. In the terminal write the following:
Code:
/~Desktop
Step 10:
Now we will be mounting the bootable disk to our USB stick:
Code:
sudo dd if="FreeBSD"-10.0-RELEASE-amd64-memstick.img of="/dev/disk1s1" bs="10240"
You are now done! The terminal will look like it's hanged but don't worry! The USB is being written and will become available when the writing is done. If you have any questions, feel free to ask. Good luck and best wishes with your FreeBSD journey! :beer
 

andersbo87

Member

Thanks: 3
Messages: 57

#2
Hey!

I attempted to follow your guide, but when I reboot my Mac and attempt to boot off the USB stick, when I press the alt/option key, the USB disk does not show up. It does show up when I use en EFI boot manager like rEFIt and rEFInd, but when I choose the USB stick, an error message appears, saying that no bootable devices were found. What am I doing wrong?
 

andersbo87

Member

Thanks: 3
Messages: 57

#4
torr_from_fallout2 said:
1) What distro are you attempting to install? (amd64, i386, ARM, etc)

2) What year was your Mac made?
1) I'm attempting to install the amd64 version because of my amount of installed memory (8 GB).
2) My Mac was made in 2011 and bought in 2012. It's a 17-inch MacBook Pro. (MacBookPro8,3). I suspect the reason why I can't get it to work is because my Mac isn't new enough and/or because I use the wrong kind of Mac to this purpose. I'm considering removing my internal DVD drive and replacing it with an SSD disk (so that I have 2 internal hard drives), and therefore I'm looking at different ways of installing FreeBSD and Windows as well as Mac OS X. Because of "conflicts" between GTP (Mac OS only installs to a disk formatted as GPT) and MBR (since Macs don't support GPT BIOS boot), I'm considering getting a new disk formatted with MBR and install FreeBSD and Windows on that one, or formatting the one I already have and install Mac OS on a new SSD. A bit off topic, I know. :)

What kind of Mac are you using?
 

torr_from_fallout2

Member

Thanks: 19
Messages: 43

#5
Hmmm ok thanks.

The reason why I asked what year is because if you had any of the older Macs, you would of have had to download the PowerPC distro. Check out this link for more info. But a 2011 Mac (with 8 GB) would require an amd64 distro so you where correct with your decision.

When I wrote this HOWTO, I basically used a Mac to write the boot stick and then used that USB to install freebsd FreeBSD on a Zotac ZBox Nano XS computer. I'm embarassed to say I haven't tried this procedure on an actual Mac itself! :p You very well might have done everything right but the procedure is a little different with installing it on a Mac.

If you want to install FreeBSD on a Mac, I believe there must be simpler ways with easy to understand GUI then what I described. Have you heard of 'Bootcamp' for Mac? Personally, I would advise you don't format your Mac with freebsd FreeBSD, this person said it best. Well, at least NOT YET. The gentler and safer approach would be to install a VM of FreeBSD on Mac and get a hang of it first. A second alternative is that if you want to use the specific UNIX apps/features, install "MacPorts" on it. Completely installing FreeBSD on a Mac should be your third choice IMHO.

Myself, I am running a 2008 MacMini with MacPorts to get all my FreeBSD needs for development. When I finish working on code, I port it to a FreeBSD computer and continue integrating. But as far as dev, I use Mac, for production, freebsd.

Anyway, sorry I can't help right now. I'll look into this issue more this weekend if I have some time. Take care,
 

andersbo87

Member

Thanks: 3
Messages: 57

#6
Sorry for the late reply. Yes, I have heard of Bootcamp. I used it quite often to run Windows on it. However, when it came to FreeBSD, I never quite got it to work that way. I always ended up modifying parts of the partition table so that FreeBSD would do an MBR boot instead of GPT. And after that, I decided to triple boot the system: 1) Mac OS for the main use, 2) Windows to play some games that are unavailable on Mac OS X, and 3) FreeBSD to experiment with a UNIX based OS and learn more of the basics of how UNIX works, as well as some local development. I'm aware of using a VM, and I do so when I'm running Linux and Solaris. I like to try out new operating systems on real hardware, to see what I can get to work and what I can't get to work. :)

However, last Thursday, I got my new disk, and I'm happily running FreeBSD and Windows on my old MBR formatted disk and Mac OS on my new SSD.

In the last few days, I read a post somewhere that said that most Macs, especially those that came with a built-in DVD ROM, do not support USB booting at all (whether it is from a USB DBD/BluRay drive, a USB hard drive or a USB stick -- it just doesn't work).

Take care, and have a wonderful day. :)
 

NuLL3rr0r

Active Member

Thanks: 14
Messages: 167

#8
andersbo87 said:
In the last few days, I read a post somewhere that said that most Macs, especially those that came with a built-in DVD ROM, do not support USB booting at all (whether it is from a USB DBD/BluRay drive, a USB hard drive or a USB stick -- it just doesn't work).
I confirm it, I tried 1001 ways to boot other OSes other than OS X from a USB stick and unfortunately it is not supported on my 17" MBP 4.1 (intentionally). It has been a long time since the SuperDrive won't work. Anyway, booting from an internal DVD-Drive using an IDE/SATA to USB converter worked for me. It is far cheaper than replacing the SuperDrive with a new one. The only thing that hurts is, it is very slow compared to USB sticks. And, I hate the evil Apple for it.
 

kpa

Beastie's Twin

Thanks: 1,673
Messages: 6,084

#9
Are we talking about some older Macs or some newer ones? I'm pretty sure that every single Mac from the last 3-4 years does support booting from USB, in fact booting from USB is the preferred recovery method now with Macs.

Ps. There was a good number of PC machines (laptops included) sold around 2005-2006 that didn't yet support USB boot, you going to call those manufacturers "evil" as well?
 

NuLL3rr0r

Active Member

Thanks: 14
Messages: 167

#10
kpa said:
Are we talking about some older Macs or some newer ones? I'm pretty sure that every single Mac from the last 3-4 years does support booting from USB, in fact booting from USB is the preferred recovery method now with Macs.

Ps. There was a good number of PC machines (laptops included) sold around 2005-2006 that didn't yet support USB boot, you going to call those manufacturers "evil" as well?
No it's not about old Macs. This is Apple's restriction! Of course you can boot OS X installer from a USB stick but not any other OS on Macs with DVD-ROMs. Models such as MacBook Air does not affected by this issue, because they don't have DVD-ROMs so Apple didn't put that restriction on these models.

This is not hard to prove. It's just a matter of Google search. You will be able to find a lot of threads about this issue on Apple's own forum.

Mine is a 2008 model and will boot just fine with OS X on a USB stick. Also boots fine from a USB DVD-Drive. But it refuse to boot anything else from a USB stick (BootCamp ignores it / rEFIt recognizes the USB stick but it won't boot). I tried to boot other PCs with the same USB sticks and it worked just fine.
 

kpa

Beastie's Twin

Thanks: 1,673
Messages: 6,084

#11
Well that's not surprising. Apple does not advertise their computers to be 100% PC compatible, they are Macs after all and the only supported by Apple way to use a different OS on their machines is to use bootcamp. Just because some models happen to boot from USB when using a non-standard OS (I really mean non-standard from the point of the machines that we are talking about here) it doesn't follow that it should work on every model of Mac.

If Apple now suddenly disabled direct boot from non OS X CD/DVD/USB stick on their machines and forced the use of bootcamp trough the firmware of the machines that would still be perfectly within the specs of their machines.

There's something I don't get. Why get a Mac if you're not going to run OS X on it? There are far better laptops and desktops for running FreeBSD or Linux that are lot cheaper.
 

NuLL3rr0r

Active Member

Thanks: 14
Messages: 167

#12
@kpa,

Macs are just limited PCs. No single piece of hardware is different! Of course Power PCs were different because of just their CPU. Mac has EFI my PC has it too. They use Intel x86/x64 my PC has it too.

They just disabled the functionality. It's all about a devilish act they are practicing. And yeah, that's why I won't ever again buy an iProduct. It doesn't even have the quality you expected for the price you just paid. I repaired this Mac four times and still some parts aren't working! Also, this model was an early 2008 with a faulty GPU in the first place.

Anyway, I want to install a different OS, because I'm a developer who needs to write cross-platform code. At the time (2008) that I bought this Mac, I didn't know they are that much restricted. I thought Microsoft is evil, but Apple is way ahead of Microsoft. I can't recall when was the last time I booted into OS X. But, I paid very good money for the hardware, then I want to use it with different OS as I wish. Instead of their proprietary and limited OS in terms of functionality, with a stupid UI on top.

Anyway, these days FreeBSD is my favorite. And when I buy new hardware, the first thing that I'll keep in mind is FreeBSD compatibility, as I did with my latest one. I enjoy the freedom it offers.
 
Last edited by a moderator:

throAU

Aspiring Daemon

Thanks: 142
Messages: 912

#13
NuLL3rr0r said:
No it's not about old Macs.
Um, a Macbook Pro 4.1 is very old. I know that "very old" is a relative term, but 1.5x plus end of support years = "very old" in my book.

NuLL3rr0r said:
@kpa

Macs are just limited PCs. No single piece of hardware is different!
The EFI/partition layout is completely different, which is, I suspect, the source of your issue.

Apple doesn't sell PCs, however they do support running Windows. If you wanted a PC you probably should have bought one. This isn't a "good vs. evil" thing, it's buying the wrong tool for the job.

Your best bet is to install Virtualbox and run FreeBSD in there.
 

kpa

Beastie's Twin

Thanks: 1,673
Messages: 6,084

#14
Apple could have easily made their Intel Macs in such a way that they would be totally incompatible with other OSes that use the same hardware and nobody would have been able to do anything about, not legally or otherwise. They are offering the compatibility with other OSes partly out of goodwill and partly for selling a few more machines.
 

NuLL3rr0r

Active Member

Thanks: 14
Messages: 167

#15
As you mentioned, yes, they provided BootCamp to sell more. But I believe they've provided BootCamp especially for Windows compatibility in mind. Because they knew Windows is way more popular than OS X. So, they could attract even more users. I see lots of people that buy Macs and the first thing they do is installing Windows on it, because they are so much bound to it. Since in the past all OSes relied on BIOS, when they emulated it for Windows, naturally other OSes are capable of using it. I believe if Apple had such power to avoid it, they would put that restriction on their Macs. Apple is all about putting restriction on users and making more money, IMHO.
 

throAU

Aspiring Daemon

Thanks: 142
Messages: 912

#16
If Apple actually wanted to prevent you from running another OS they easily could have via code-signing requirements on the boot-loader, which has been commonplace in consoles since the 90s or earlier. They did not do that.

Apple is in the business of selling Macs to run OS X. Their hardware platform has a number of differences in the way it handles boot. Going out of their way to support every other OS on the planet for the 1% of users (or less!) who buy a Mac to NOT run OS X (who could do so via a free hypervisor anyway) is just a waste of resources.
 

NuLL3rr0r

Active Member

Thanks: 14
Messages: 167

#17
@throAU

Excuse me, but where did you got that "the 1% of users (or less!)"? Virtually every Mac user that I know, uses BootCamp to boot another OS beside OS X.

By the way, Macs are not that much different. It's always possible to boot OS X on your PC which is called Hackintosh. Another proof that Macs are just PCs.
 

sossego

Retired from the forums

Thanks: 142
Messages: 1,561

#18
@NuLL3rr0r is right in stating that the current Mac hardware is i386/AMD64/ "IBM PC" compatible. Try looking up "Arch" "MacBook" "installing" and other similar words on Google/Yahoo/Bing/DuckDuckGo for a solution.
http://en.wikipedia.org/wiki/Parallels_Desktop_for_Mac Parallels. I had a subscription for a free download or so but let it run past the date.
 
Last edited by a moderator:

throAU

Aspiring Daemon

Thanks: 142
Messages: 912

#19
NuLL3rr0r said:
@throAU

Excuse me, but where did you got that "the 1% of users (or less!)"? Virtually every Mac user that I know, uses BootCamp to boot another OS beside OS X.

By the way, Macs are not that much different. It's always possible to boot OS X on your PC which is called Hackintosh. Another proof that Macs are just PCs.
I was talking about Mac users trying to boot-camp something other than Windows, like FreeBSD, the OS you are complaining about. I run Boot Camp myself.

Windows is supported just fine. Yes, plenty of Mac users run Windows. How many try to run FreeBSD on their Mac? Like I said, I'd wager far less than 1 percent. For most Mac users it is pointless - you lose in terms of less complete hardware support, power consumption, application support, etc. If you want to run FreeBSD there are cheaper hardware options. Or just run in a hypervisor?

The only way a PC will boot OS X is by emulating the Mac EFI (which is likely the component causing your issue), so no, they're not the same.

And again, if Apple really wanted to lock you out, they would be doing a far better job of it than they have been. One issue with FreeBSD and other operating systems is that they don't properly support booting from Mac EFI, not that Apple has locked them out. To get Windows to work, Apple create a custom hybrid GPT/MBR disk layout. If Windows supported natively booting from the Mac EFI this would not be necessary. If FreeBSD supported booting natively from Mac EFI, this would not be necessary.

But they don't so (far from "locking other operating systems out") Apple has hacked the disk layout to make Windows work.

Now, I'm not saying that this exact case is the issue preventing you from booting another OS from USB - but to claim that Apple have locked their Macs down to screw their userbase is pretty out of line.
 

marian_cerny

New Member

Thanks: 2
Messages: 9

#20
This did not work for me. I had to change disk1s1 to disk1 in the Step 10:
Code:
sudo dd if=FreeBSD-10.0-RELEASE-amd64-memstick.img of=/dev/disk1 bs=10240
And I believe better way would be to use this steps:
Code:
diskutil unmountDisk /dev/disk2
sudo dd if=FreeBSD-10.0-RELEASE-amd64-memstick.img of=/dev/disk2 bs=1024000
diskutil eject /dev/disk2
 

kpa

Beastie's Twin

Thanks: 1,673
Messages: 6,084

#21
This did not work for me. I had to change disk1s1 to disk1 in the Step 10:
Code:
sudo dd if=FreeBSD-10.0-RELEASE-amd64-memstick.img of=/dev/disk1 bs=10240
And I believe better way would be to use this steps:
Code:
diskutil unmountDisk /dev/disk2
sudo dd if=FreeBSD-10.0-RELEASE-amd64-memstick.img of=/dev/disk2 bs=1024000
diskutil eject /dev/disk2
It depends on what was on the disk when it was inserted to the OS X system. If there was a partitioning and filesystems that OS X recognizes it will try to mount those filesystems automatically and that's why you have to do diskutil unmountDisk first before writing the image with dd(1).
 

iBookG4

New Member


Messages: 11

#22
throAU

Excuse me, but where did you got that "the 1% of users (or less!)"? Virtually every Mac user that I know, uses BootCamp to boot another OS beside OS X.

By the way, Macs are not that much different. It's always possible to boot OS X on your PC which is called Hackintosh. Another proof that Macs are just PCs.
I don't. Too much of a pain to reboot. I can use a virtual machine for random junk made Windows-only, and that's only if it won't work in Wine. Usually, it's just some software for a computerized thermostat or something small like that.
 

iBookG4

New Member


Messages: 11

#23
One issue with FreeBSD and other operating systems is that they don't properly support booting from Mac EFI, not that Apple has locked them out. To get Windows to work, Apple create a custom hybrid GPT/MBR disk layout. If Windows supported natively booting from the Mac EFI this would not be necessary. If FreeBSD supported booting natively from Mac EFI, this would not be necessary.
Intel Macs can boot FreeBSD just fine with Boot Camp, and my iBook G4 let me boot into it easily. But for whatever reason, it only works when I boot off the DVD. I've already wasted hours trying everything on a flash drive, and I've concluded that a DVD is the only way.

Also, yeah, it's kinda pointless unless you want to recycle an unused Mac as a server. OS X is way nicer for development, and if you need FreeBSD for whatever reason, run a VM.
 

Dave109

New Member


Messages: 8

#24
Works well.
Just make sure the memory stick is fat partitioned! and use a UEFI image!
Use diskutil to configure the stick as fat
Here is my terminal log to create the latest FreeBSD image:
Code:
~/Desktop: diskutil list
/dev/disk0 (internal, physical):
  #:  TYPE NAME  SIZE  IDENTIFIER
  0:  GUID_partition_scheme  *320.1 GB  disk0
  1:  EFI EFI  209.7 MB  disk0s1
  2:  Apple_CoreStorage Macintosh HD  319.2 GB  disk0s2
  3:  Apple_Boot Recovery HD  650.0 MB  disk0s3
/dev/disk1 (internal, virtual):
  #:  TYPE NAME  SIZE  IDENTIFIER
  0:  Apple_HFS Macintosh HD  +318.8 GB  disk1
  Logical Volume on disk0s2
  E7B9F3A8-3B64-45F9-AB2B-B4394D07A040
  Unencrypted
/dev/disk2 (external, physical):
  #:  TYPE NAME  SIZE  IDENTIFIER
  0:  GUID_partition_scheme  *500.1 GB  disk2
  1:  EFI EFI  209.7 MB  disk2s1
  2:  Apple_HFS bkup-boot-disk  249.9 GB  disk2s2
  3:  Apple_HFS unused  124.9 GB  disk2s3
  4:  Apple_HFS bsdfree  124.7 GB  disk2s4
/dev/disk3 (external, physical):
  #:  TYPE NAME  SIZE  IDENTIFIER
  0:  GUID_partition_scheme  *31.1 GB  disk3
  1:  EFI EFI  209.7 MB  disk3s1
  2:  Microsoft Basic Data USBFREEBSD  30.7 GB  disk3s2
~/Desktop: diskutil unmountDisk /dev/disk3
Unmount of all volumes on disk3 was successful
~/Desktop: ls
...
FreeBSD-10.3-RELEASE-amd64-uefi-memstick.img 
~/Desktop: sudo dd if=FreeBSD-10.3-RELEASE-amd64-uefi-memstick.img of=/dev/disk3 bs=1024000
Password:
763+1 records in
763+1 records out
781789696 bytes transferred in 345.599869 secs (2262124 bytes/sec)
~/Desktop: diskutil eject /dev/disk3
Disk /dev/disk3 ejected
At boot time hold down the alt/option key when the startup music starts and voila the memory stick v=created is listed!
Dave
 

Al Naqba

New Member


Messages: 2

#25
HOWTO: Create FreeBSD USB bootable disk from Mac
Purpose:
The purpose of this HOWTO is to teach inexperienced users on how to create a USB bootable disk from a Apple Macintosh computer.

Assumption:
You are running OSX Mountain Lion

Steps:
Step 1:
We must download the distro. we are looking to install. Go to the following link:
http://www.freebsd.org/where.html

Step 2:
Select 'i386' if the computer you are setting up FreeBSD on cannot support x64 bits, else it's recommended to select the 'amd64' distro. Once you have decided, select "ISO". If you don't know which one to choose, read up more here

Step 3:
Login in as 'Guest'

Step 4:
Copy the file with the 'memstick' keyword to your desktop. I will select the "FreeBSD-10.0-RELEASE-amd64-memstick.img" and will use it throughout this demonstration.

Step 5:
Load up your terminal. If you don't know where it is, go to:
Applications -> Utilities -> Terminal

Step 6:
Insert the USB stick that you want to use. Note: All data on the disk will be deleted!

Step 7:
Type in the following in the terminal and look for the name of the USB device:
Code:
df -h
Step 8:
Once you found the device in the list, make a note of it because the next step we are going to unmount it (note: disk1s1 is the id of my USB, yours will vary, so make a note of what yours is):
Code:
sudo diskutil umount /dev/disk1s1
Step 9:
Now, I'm assuming you copied your "FreeBSD-10.0-RELEASE-amd64-memstick.img" file to your desktop. In the terminal write the following:
Code:
/~Desktop
Step 10:
Now we will be mounting the bootable disk to our USB stick:
Code:
sudo dd if="FreeBSD"-10.0-RELEASE-amd64-memstick.img of="/dev/disk1s1" bs="10240"
You are now done! The terminal will look like it's hanged but don't worry! The USB is being written and will become available when the writing is done. If you have any questions, feel free to ask. Good luck and best wishes with your FreeBSD journey! :beer
HOWTO: Create FreeBSD USB bootable disk from Mac
Purpose:
The purpose of this HOWTO is to teach inexperienced users on how to create a USB bootable disk from a Apple Macintosh computer.

Assumption:
You are running OSX Mountain Lion

Steps:
Step 1:
We must download the distro. we are looking to install. Go to the following link:
http://www.freebsd.org/where.html

Step 2:
Select 'i386' if the computer you are setting up FreeBSD on cannot support x64 bits, else it's recommended to select the 'amd64' distro. Once you have decided, select "ISO". If you don't know which one to choose, read up more here

Step 3:
Login in as 'Guest'

Step 4:
Copy the file with the 'memstick' keyword to your desktop. I will select the "FreeBSD-10.0-RELEASE-amd64-memstick.img" and will use it throughout this demonstration.

Step 5:
Load up your terminal. If you don't know where it is, go to:
Applications -> Utilities -> Terminal

Step 6:
Insert the USB stick that you want to use. Note: All data on the disk will be deleted!

Step 7:
Type in the following in the terminal and look for the name of the USB device:
Code:
df -h
Step 8:
Once you found the device in the list, make a note of it because the next step we are going to unmount it (note: disk1s1 is the id of my USB, yours will vary, so make a note of what yours is):
Code:
sudo diskutil umount /dev/disk1s1
Step 9:
Now, I'm assuming you copied your "FreeBSD-10.0-RELEASE-amd64-memstick.img" file to your desktop. In the terminal write the following:
Code:
/~Desktop
Step 10:
Now we will be mounting the bootable disk to our USB stick:
Code:
sudo dd if="FreeBSD"-10.0-RELEASE-amd64-memstick.img of="/dev/disk1s1" bs="10240"
You are now done! The terminal will look like it's hanged but don't worry! The USB is being written and will become available when the writing is done. If you have any questions, feel free to ask. Good luck and best wishes with your FreeBSD journey! :beer