# The Ubuntu Forum Community > Ubuntu Specialised Support > Apple Hardware Users >  Fix for making bootable Ubuntu Live USB with persistence using Unetbootin on a Mac

## Quackers

************
Please see the addendum at the bottom of this post if you're having problems not achieving persistence with a recent version of Ubuntu.


I have been spending a lot of time recently trying to make an Ubuntu Live USB with persistence that will boot on a Mac. 
Persistence is worthwhile having, at least in my case as my wifi does not work "out of the box" so without persistence any driver and firmware that I install once booted to the live desktop would become lost once the system is rebooted. I can obviously have things like Bookmarks for important sites retained too.

I would make the USB with Unetbootin but at the end of the process it would report that this USB would not boot on a Mac. On trying to boot it it would always give either a "Boot error" message or "this is not a bootable disc..........." error.

Most of the information I needed was already available (thanks to Christopher Friedt and others) but it just wouldn't quite work for me. It seemed I was missing a step or something. It seems I was.

Apparently Unetbootin fails to write Syslinux to the MBR of the flash drive (or not correctly, if at all). This could possibly be a licensing kind of thing. It also seems to misread or misinterpret the boot flag or the active partition in some way. If Syslinux is not in the MBR there's nothing to point to where to go to boot anything. 

Anyway, I have just made a 2GB Ubuntu Live USB with persistence following the method below and not only does it boot on a Mac but the persistence actually works!  :LOL: 

What you'll need:-
A Mac which is capable of booting from a USB flash drive
A USB stick (2GB upwards in size if you want persistence)
An Ubuntu .iso file - I had Ubuntu 13-04 amd64 for mac - **** if you want EFI boot on a Mac use a non-mac version of the Ubuntu iso
Syslinux (a small downloaded file)
Unetbootin for Mac

OK, here we go:

Plug your USB flash drive into your Mac.

Open a terminal and run


```
diskutil list
```

and in its output note carefully the drive designation of your USB (the size will probably be the giveaway) mine for instance was /dev/disk1 but yours may be something else depending on what else is plugged in to your Mac.

Open Disk Utility and select your USB drive and delete any current partitions. That is click on any partitions in the left pane and in the right pane click erase.
Then click on your USB drive in the left pane and the partition tab in the right pane and create one partition of MS-DOS FAT type naming it anything you want. It's probably wise to click on the options tab and make sure that MBR is ticked. Click on apply.
Ok, once that's run we're finished with Disk Utility.

In the terminal unmount the USB with 

```
diskutil unmountDisk /dev/diskX
```

  -  changing the X to your drive's number

Now we'll mark the partition as active (even though some programs will already think so, like gparted, for instance)

Open a terminal and run 

```
sudo fdisk -e /dev/rdiskX
```

  (yes, the extra r is advisable (quicker) and change the X to the number of your USB disc that diskutil gave you earlier)
at this point your prompt will become an fdisk prompt and I got the following message 

```
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
```

 which I ignored.

now enter these 3 commands 

```
f 1
write
exit
```

Please note that you should be able to see your desktop (the area where discs mount) and if at any time during the above the disk appears and stays there run the unmount command again.

Ok, so far so good. 
Now download syslinux

Now it can get a bit messy. In the terminal you need to cd to the folder which has the mbr.bin. 

In syslinux version 6.01 the mbr.bin is in the syslinux-6/bios/mbr folder so that's where you'd need to cd to. 
My (older) version was different (syslinux/mbr) and I've also seen it elsewhere too so you need to have a look where this file is first. If you've extracted the zip file you can have a look in these places for it in the Finder before cd'ing.

Now we can write the much needed code to the MBR of the USB drive



```
sudo dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/diskX
```

  -  again change the X to your drive's number

After a second or two it should report bytes written count which should be 440.

If this gives an error about not getting access run the unmount command again for your USB (above)

If it gives an error about no mbr.bin then you've cd'd to the wrong part of syslinux folder - possibly!

It may report that the changes won't be made unless you reboot. If it does just type y and enter, then reboot.

Ok now download and install Unetbootin for Macs and use it in the normal way to make the Live USB choosing if you wish to make the persistence file by entering a size in the appropriate field.
It will give the usual guff about what it's doing and may even appear to hang for a while, even give the spinning coloured wheel - just leave it running. It could take about 20 minutes or so, maybe a touch more but leave it anyway.

It will finish and report that the USB will not be bootable on a Mac.  Bah, humbug! 

Reboot leaving your USB flash drive inserted and if you don't have rEFInd installed hold the Option (ALT) key after the chime until the appropriate menu choices appear. 
If you have rEFInd installed you'll see a nice penguin at the end - choose that
If no rEFInd choose the one that wasn't there before (can't remember as I use rEFInd).

You should be greeted by a Unetbootin menu with Default as the top option. You only have a few seconds to choose but my menu included an option to "try Ubuntu without installing" (3rd item down) and I chose that one. Others have reported no such menu item and have used Default, but that doesn't boot for me.

Ubuntu should start loading. Enjoy!

I loaded Ubuntu desktop and changed some wifi setting as my wifi doesn't work out of the box and installed one or two things in the sidebar.
I then rebooted and those changes were still there! Wifi worked without any changes. 
ie persistence now works!! Something I have never got to work before.


As stated above this is what worked for me. It is not guaranteed and if you break something it's on your head!
For instance if you make a mistake entering any of these commands you WILL VERY POSSIBLY destroy data on another drive!!!!!!! Be very careful!!!

This information has been gathered from many sources including the syslinux.wiki, Christopher Friedt's sites 
http://dropsafe.crypticide.com/article/8368
and
http://perpetual-notion.blogspot.co....-mac-os-x.html
and much trawling through the Net.

Having said all that if you come across any problems I will try to help - though I am no coder!

****** ADDENDUM********
It seems in more recent versions of Ubuntu that the persistence can fail (particularly if booted in EFI).
I've had a mooch around and thanks to others there may be a fix. At least it's currently working for me and one other  :Smile: 

I plugged the newly made USB in to my Mac and opened the drive then navigated to /boot/grub then opened grub.cfg with textedit
In the newly opened file go to this menu entry 


```
menuentry "Try Ubuntu without installing" {
```

 which is the first one in the file.
Just further down the file is the line below to which I've added the word "persistent"


```
linux	/casper/vmlinuz.efi  file=/cdrom/preseed/ubuntu.seed boot=casper persistent quiet splash --
```

Once added you can save the file and then boot from it and hopefully have persistence.

Good luck!

----------


## Quackers

By way of addition there is a recent innovation called Mac-Linux-USB-Loader which I have tried. It actually gets to booting the linux kernel but then fails as it doesn't seem to have support for Nvidia chips. It also uses EFI to boot.
There is currently no persistence option but it is a possible future enhancement.

----------


## pindar

I just wanted to thank you for your detailed explanations, your efforts are highly appreciated. I followed your instructions, and for the first time, unetbottin created a USB stick that would boot both my MBA and my iMac. Given that more recent macs come without an optical drive, this is important knowledge. May I suggest you write them down somewhere which is less volatile and more visible than a forum post?

----------


## sudodus

Threads in the Ubuntu Forums are persistent. And I have linked to this thread from an Ubuntu wiki page

https://help.ubuntu.com/community/Installation/FromUSBStick#From_Mac_OSX

Of course, more links are welcome  :Smile:

----------


## Quackers

pindar 
I'm glad it worked for you.  :Very Happy:  and thanks for your comments.
I'm looking for other places to post this information but would appreciate confirmation of the guide's validity first. ie different versions of Ubuntu and Syslinux etc.

For my own information could you please give me the following details? 
The size and make of your USB stick
Which exact version of Ubuntu/Linux iso file you used
Which version of Syslinux you downloaded and which of its directories the mbr.bin was in
Were there any problems for you or was there anything I have missed from the guide?

Many thanks and enjoy your new Live USB   :Very Happy:

----------


## pindar

> pindar 
> For my own information could you please give me the following details? 
> The size and make of your USB stick
> Which exact version of Ubuntu/Linux iso file you used
> Which version of Syslinux you downloaded and which of its directories the mbr.bin was in
> Were there any problems for you or was there anything I have missed from the guide?
> 
> Many thanks and enjoy your new Live USB


Sure, glad to be of help:

USB stick: SanDisk Cruzer, 8GB

I used linuxmint xfce edition, 64bit (but will happily try other ubuntu editions)

syslinux: version 6.01

mbr.bin was in syslinux-6.01/bios/mbr

Problems: one small glitch was that your command


```
sudo dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/rdiskX
```

wouldn't work for me, I always got an error message dd: /dev/rdisk1: Invalid argument." When I replaced /dev/rdiskX with /dev/diskX, the command completed successfully.

----------


## Quackers

Great, thanks for the details.
I'll make another USB shortly and check that out - maybe the r is confusing things and it doesn't really need to be there as it isn't writing much anyway.

Edit in fact I've removed it and will test shortly.
Edit2  yep works fine without the r

----------


## sudodus

Could this be a clue to why it is difficult to make USB flash drive that can boot on Macs? See this link

https://help.ubuntu.com/community/In...k#Known_Issues




> You need Mac OS X to create a USB flash drive that can boot on Macs.  Even so, the process is less reliable than using a CD, as the USB flash  drive is not always recognized on boot. Reversely, you can't create  bootable USB flash drives for other platforms than Macs from within Mac  OS X. This is because Macs use a custom EFI bios with a custom  boot-loader and need a special filesystem layout to boot correctly.

----------


## Quackers

I don't know tbh. 
Mine recognised the Live USB every time and it recognised that it should have been bootable but could not find the bootable elements on that drive. I suspect this is closer to the truth.
Macs don't have a bios as such. They have a kind of bios emulation, as I understand it, which is a not accessible as far as I'm aware.
The U3 problem as mentioned in that article seems to be solved with regard to the Sandisk Cruzers at least as I have successfully created a bootable Ubuntu Live USB on one, as did pindar.

----------


## sudodus

This is old stuff from the days of Ubuntu 11.04, and if you think it is not relevant, I can wipe it from the wiki page.

----------


## turbolego

Hm... i did the same procedure on my 500 gb firewire-disk, but unetbootin doesn't do anything when i click "OK" after selecting the drive and preserved space...

any tips?

*[EDIT:]*

would this work?

1. boot up ubuntu from usb
2. select the "install ubuntu" app
3. install ubuntu from within the ubuntu usb on to the firewire disk
4. <something about persistence here>

*[EDIT2:]*

I`m stuck at "erase and install ubuntu"
the cursor still has the "loading" idicator symbol rolling, but i`m not sure how long it should stay on this screen...

picture:

----------


## turbolego

Ok... so i tried the same procedure that worked on my usb-stick on my firewire disk.

The only way to make the firewire-disk boot, is if i DON'T edit the grub.cfg file and leave the usb (with persistence) connected!
I think the usb has some files or whatever that the firewire needs to have in order to boot...

This is what shows up if i try to boot the firewire, without persistence, and without the usb:



This is what happens if i try to boot the firewire, WITH persistence and WITH the usb:



What's going on?

----------


## Quackers

This is a whole different subject than what this thread is about   :Smile: 

I would have thought that installing Ubuntu on to the firewire disc would be better (as it would automatically be persistent), however, I think there are problems installing it on firewire.
Try googling around as I think I read about possible workarounds.
Sorry but that's all I can offer.

----------


## curious3

This is excellent...it works exactly as described. The instructions are excellent.

Do you or anyone else have any information on how to make an encrypted install on a USB. I have not been able to make that work.




> ************
> Please see the addendum at the bottom of this post if you're having problems not achieving persistence with a recent version of Ubuntu.
> 
> 
> I have been spending a lot of time recently trying to make an Ubuntu Live USB with persistence that will boot on a Mac. 
> Persistence is worthwhile having, at least in my case as my wifi does not work "out of the box" so without persistence any driver and firmware that I install once booted to the live desktop would become lost once the system is rebooted. I can obviously have things like Bookmarks for important sites retained too.
> 
> I would make the USB with Unetbootin but at the end of the process it would report that this USB would not boot on a Mac. On trying to boot it it would always give either a "Boot error" message or "this is not a bootable disc..........." error.
> 
> ...

----------


## Quackers

Thank you for your comments and I'm happy to hear that all went well  :Smile: 
Sadly encryption is a layer of complexity too far for me. I have no need for encryption so it's not something I've ever tried.
I try to keep installations as simple as possible (so there's less to go wrong!) so can't help you there other than to say that I'm sure there will be guides around here or on the net for what you want to do.

----------


## k4ranger2

Worked!

USB-stick: Kingston 16.06GB

I used backbox-4.0-amd64.iso (persistance didn't work, I booted in EFI. Will try to edit grub.cfg later.)

syslinux: version 6.03

mbr.bin was in syslinux-6/bios/mbr

MacBook Air mid 2012
OS X 10.9.5 (Mavericks)

Backbox worked out of the box, no extra driver needed.

EDIT 1: Adding persistance to grub.cfg didn't work. Any ideas?
EDIT 2: My bad! I put persistent in the right line and it worked!
EDIT 3: After updating Backbox I got the same error turbolego got.

----------


## raj12

Hi Quackers,
Thank you so much for the instructions and the help you provided to all over the years!  After following your instructions, now I can reboot my mac by holding alt option.  I see three boot options.  one for my mac HD, one called windows, and one called EFI boot.  mac HD takes me to my mac.  Windows option flashes and the system quickly reboots to my default mach HD.  The EFI boot option gives a screen that has few options to select from.
1. Try without installing UBUNTU
2. Install UBUNTU
and 1 or 2 more options that I cannot recall exactly.

I can use option 1 (Try without install) and login to Ubuntu just fine.  But I want to install UBUNTU and run from the same USB stick.  I am assuming that when I choose the install UBUNT​U option (option # 2) it will give me an option to install the OS to this USB drive.  Is that possible or do I need to have a fresh and additional USB drive to install the UBUNTU OS into?

I am installing Ubuntu 14.04 LTS
Syslinunx version 6.03
Persistance size of 2 GB entered for unetbootin options.
I am running 10.10 Yosemite on Mackbook Air
USB stick size: 8GB

Thank you in advance for your help.

Regards,
Raj

----------


## Quackers

You would need another USB stick or drive to install Ubuntu on to.
You currently have an Ubuntu system on your current USB stick which you can use as is. You should also have persistence, i.e. you can change things and store things and it will remember those changes.
By selecting the "try Ubuntu without installing" option you will boot into that system.

Beware! If you install Ubuntu from this USB to another USB or drive you need to be sure of that drive's designation (i.e. /dev/sdb, /dev/sdc etc) and be sure to install to that drive. Otherwise you could erase a system you currently use (like your Yosemite, for instance!)

----------


## jwgsub

Hi, I first attempted to do this a few years ago probably 2012, but can't get it to work. I tried using syslunix 6.03, Ubuntu 14.04 desktop for Mac, used the terminal commands without a problem, selected 2 gigs for the persistent space, and tried to boot it.  In the past it has booted, but not saved to the persistence file and after searching the internet I finally gave up.  Today, I plugged it in, restarted my computer and held option, but only my MacintoshHD drive came up.  

I would appreciate any help on this subject as well as other ways to make it persistent.  I have tried just about every solution on the internet and am counting on the masters to help me out.



Thank you

-Jeremy :Confused:

----------


## raj12

Hi 
Thank you for the help.  I understand now.  Couple quick questions
1.  I created a text file on the file system after logging into 'try ubuntu without installing".  But that file did not persist when I rebooted into the OS again.  I thought it should.
2.  It does not recognize my wireless network. 

Again, I appreciate your help.
Raj

----------


## Quackers

Yes it should have remembered that text file. It seems that persistence is not working there.

Jwgsub
See your private message inbox regarding your earlier questions.
Not much help I'm afraid for you.

----------


## asim3

> ************
> Good luck!


Hi Quackers,

Thank you very much for such a detailed tutorial. You're indeed such a wonderful and humble human being. I don't know if you're still maintaining this thread or not, but i'm giving it a try here while quoting your original post.

I'm new to this forum (even to Linux OS), and I followed your tutorial bit-by-bit to install Ubuntu 14.10 on MBP 5,2 (Mid 2009 Model). Everything goes okay, but as soon as I select ''Try Ubuntu without Installing", I got the following error,



I force Shut Down MBP, and went for a second try... now this time it went past the first error, and end up with the following,



Could you please tell me what I'm doing wrong, or is it that my machine is not compatible?

Regards
Asim

----------


## Quackers

Hi Asim, it maybe that the hardware you're using is too old for that version of Ubuntu.
The second screenshot shows a kernel panic, probably due to the nouveau video driver.
When you get to that stage next time try using a boot prompt. Sadly I work away all week and have no links with me. Perhaps you could google the boot prompts available for video problems and see if you can get it to boot that way.
Sorry I can't be more helpful.

You could possibly try an older version of Ubuntu, say a. Erosion issued a year or so after your hardware was new.

----------


## jwgsub

I finally got the drive working all the way! Thanks so much for all the instructions!

-Jeremy

----------

