New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Running Windows (or anything else) on your Mac Discussion of Classic or running Windows, Linux and other OSes on the Mac.

Method for making a Linux USB flash drive with persistence which is bootable on a Mac


Post Reply New Thread Subscribe

 
Thread Tools
MacDuck

 
MacDuck's Avatar
 
Member Since: Dec 29, 2012
Location: Manchester, UK
Posts: 155
MacDuck is on a distinguished road
Mac Specs: rMBP 15"

MacDuck is offline
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!

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
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
Code:
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
Code:
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
Code:
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
Code:
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
Code:
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 here 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

Code:
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
UNetbootin on Mac OS X # fix to create a BackTrack5 USB stick to boot elsewhere | dropsafe
and
The Perpetual Notion: UNetbootin on Mac OS X
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!

Good luck!

15" MacBook Pro retina 10,1
QUOTE Thanks

Post Reply New Thread Subscribe


« increasing space on boot camp drive | My Mac thinks it's a Windows machine »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Snow Leopard onto USB flash drive boot problem dtevevaiamd OS X - Operating System 21 07-03-2013 05:20 AM
I created a bootable Tiger USB arc07693 OS X - Operating System 0 10-12-2011 03:16 AM
May run Linux from the CDROM or USB flash drive on as iMac ? lse123 Running Windows (or anything else) on your Mac 0 12-13-2008 02:49 AM
My USB flash drive won't connect to my Mac charliebrown Other Hardware and Peripherals 4 10-16-2008 06:28 PM
need help with Mac OS drive backup imaging vois2 OS X - Operating System 2 09-22-2007 11:16 AM

All times are GMT -4. The time now is 03:52 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?