Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X 10.7 Lion

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 20, 2011, 11:28 AM   #1
levo
macrumors newbie
 
Join Date: Jul 2011
A better (and faster) way to make bootable Lion Disk

If you just restore the dmg to a flash drive, during installation of Lion, it creates a restore partition on your drive, reboots your mac, and installs from that partition. Thanks to hackint0shers, you can create a "classic" boot disk that just installs from your flash drive. Credit goes to original creator of the script, I've just made small edits..

download the script:
http://www.mediafire.com/?02i0a5tt0uu4o3q

you can check the bash script with textedit (to be safe)

- plug your flash drive, format/partition it with disk utility (guid/mac os extended)
- open terminal, type sudo
- drag the script to the terminal
- drag the Install Mac OS X Lion.app file to the terminal
- and drag your flash drive to the terminal

you will end up with something like
sudo /download/mkboot /download/Install\ Mac\ OS\ X\ Lion.app /Volumes/Flash

The script will mount the installer .dmg, restore it to the flash disk, copy packages to the disk, copy kernel to the disk and eject image&disk

Than you can plug the flash disk, power on your mac and hold alt key to select the flash disk and install Lion..

here is the mkboot, just in case...

Code:
#!/bin/bash -e

function usage() {
  echo "Usage: `basename $0` <Lion install app> <Target volume>" 1>&2
}

if [ $# -ne 2 ]; then
  usage
  exit 1
fi

LION_INSTALL_APP=$1
TARGET_VOLUME=$2
BASE_TARGET='/Volumes/Mac OS X Base System'
IN_APP_DMG='Contents/SharedSupport/InstallESD.dmg'
SCRIPT_DIR=`dirname $0`

if [ ! -d "$LION_INSTALL_APP" ]; then
  echo "$LION_INSTALL_APP: No such file" 1>&2
  usage
  exit 2
fi

if [ ! -d "$TARGET_VOLUME" ]; then
  echo "$TARGET_VOLUME: No such directory" 1>&2
  usage
  exit 3
fi

if [ $EUID -ne 0 ]; then
   echo "This script must be run as root" 1>&2
   exit 4
fi

function echob() {
  echo "`tput bold`$1`tput sgr0`"
}

echob "Attaching OS X Lion..."
hdiutil attach -mountpoint $SCRIPT_DIR/lioninst "$LION_INSTALL_APP/$IN_APP_DMG"

pushd `dirname $0` > /dev/null

echob "Restoring BaseSystem.dmg to $TARGET_VOLUME..."
asr --source lioninst/BaseSystem.dmg --target "$TARGET_VOLUME" --erase --noprompt

echob "Adopting on-disk ownership on $BASE_TARGET..."
vsdbutil -a "$BASE_TARGET"

echob "Copying Packages from OS X Lion main image..."
rm "$BASE_TARGET/System/Installation/Packages"
rsync -r --progress lioninst/Packages "$BASE_TARGET/System/Installation/"

echob "Copying mach_kernel from OS X Lion main image..."
cp -r lioninst/mach_kernel "$BASE_TARGET"

echob "Detaching OS X Lion main image..."
hdiutil detach lioninst

echob "Ejecting $BASE_TARGET..."
diskutil eject "$BASE_TARGET"

echob "All done."

popd > /dev/null
levo is offline   2 Reply With Quote
Old Jul 20, 2011, 11:40 AM   #2
Steve's Barber
Banned
 
Join Date: Jul 2011
Looks needlessly complicated to me. For a one time master boot copy, finding the dmg and using Disk Utility works just fine.
Steve's Barber is offline   2 Reply With Quote
Old Jul 20, 2011, 11:42 AM   #3
bozzykid
macrumors 68000
 
Join Date: Aug 2009
It took me longer to figure all that out than it did to just burn a dvd from the dmg file.
bozzykid is offline   1 Reply With Quote
Old Jul 20, 2011, 11:43 AM   #4
mrapplegate
macrumors 68030
 
Join Date: Feb 2011
Location: Cincinnati, OH
I have to agree with Steve's Barber, the average user is not going to want to do that. My Dad won't want to do that
mrapplegate is offline   0 Reply With Quote
Old Jul 23, 2011, 11:43 PM   #5
Kris404
macrumors newbie
 
Join Date: Jul 2010
Location: Los Angeles, CA
Thumbs up

Quote:
Originally Posted by levo View Post
If you just restore the dmg to a flash drive, during installation of Lion, it creates a restore partition on your drive, reboots your mac, and installs from that partition. Thanks to hackint0shers, you can create a "classic" boot disk that just installs from your flash drive. Credit goes to original creator of the script, I've just made small edits..

download the script:
http://www.mediafire.com/?02i0a5tt0uu4o3q

you can check the bash script with textedit (to be safe)

- plug your flash drive, format/partition it with disk utility (guid/mac os extended)
- open terminal, type sudo
- drag the script to the terminal
- drag the Install Mac OS X Lion.app file to the terminal
- and drag your flash drive to the terminal

you will end up with something like
sudo /download/mkboot /download/Install\ Mac\ OS\ X\ Lion.app /Volumes/Flash

The script will mount the installer .dmg, restore it to the flash disk, copy packages to the disk, copy kernel to the disk and eject image&disk

Than you can plug the flash disk, power on your mac and hold alt key to select the flash disk and install Lion..

here is the mkboot, just in case...

Code:
#!/bin/bash -e

function usage() {
  echo "Usage: `basename $0` <Lion install app> <Target volume>" 1>&2
}

if [ $# -ne 2 ]; then
  usage
  exit 1
fi

LION_INSTALL_APP=$1
TARGET_VOLUME=$2
BASE_TARGET='/Volumes/Mac OS X Base System'
IN_APP_DMG='Contents/SharedSupport/InstallESD.dmg'
SCRIPT_DIR=`dirname $0`

if [ ! -d "$LION_INSTALL_APP" ]; then
  echo "$LION_INSTALL_APP: No such file" 1>&2
  usage
  exit 2
fi

if [ ! -d "$TARGET_VOLUME" ]; then
  echo "$TARGET_VOLUME: No such directory" 1>&2
  usage
  exit 3
fi

if [ $EUID -ne 0 ]; then
   echo "This script must be run as root" 1>&2
   exit 4
fi

function echob() {
  echo "`tput bold`$1`tput sgr0`"
}

echob "Attaching OS X Lion..."
hdiutil attach -mountpoint $SCRIPT_DIR/lioninst "$LION_INSTALL_APP/$IN_APP_DMG"

pushd `dirname $0` > /dev/null

echob "Restoring BaseSystem.dmg to $TARGET_VOLUME..."
asr --source lioninst/BaseSystem.dmg --target "$TARGET_VOLUME" --erase --noprompt

echob "Adopting on-disk ownership on $BASE_TARGET..."
vsdbutil -a "$BASE_TARGET"

echob "Copying Packages from OS X Lion main image..."
rm "$BASE_TARGET/System/Installation/Packages"
rsync -r --progress lioninst/Packages "$BASE_TARGET/System/Installation/"

echob "Copying mach_kernel from OS X Lion main image..."
cp -r lioninst/mach_kernel "$BASE_TARGET"

echob "Detaching OS X Lion main image..."
hdiutil detach lioninst

echob "Ejecting $BASE_TARGET..."
diskutil eject "$BASE_TARGET"

echob "All done."

popd > /dev/null
Thanks for the script. Just perfect for a hackint0sh clean install.

Kris
Kris404 is offline   0 Reply With Quote
Old Jul 24, 2011, 12:06 AM   #6
VTECaddict
macrumors 6502
 
Join Date: Sep 2008
Why so complicated? Just do it in Disk Utility.

Plug in flash drive (or external hard drive. I made a 5gb partition on my external)
Open Disk Utility
Drag InstallESD.dmg to the list of drives/images
Select InstallESD.dmg
Drag destination drive to destination box
Restore

Note that this will automatically reformat the destination drive, so make sure its empty or back it up if its not.

And yes, it's bootable.
VTECaddict is offline   1 Reply With Quote
Old Jul 24, 2011, 07:46 PM   #7
levo
Thread Starter
macrumors newbie
 
Join Date: Jul 2011
Quote:
Originally Posted by VTECaddict View Post
Why so complicated? Just do it in Disk Utility.

Plug in flash drive (or external hard drive. I made a 5gb partition on my external)
Open Disk Utility
Drag InstallESD.dmg to the list of drives/images
Select InstallESD.dmg
Drag destination drive to destination box
Restore

Note that this will automatically reformat the destination drive, so make sure its empty or back it up if its not.

And yes, it's bootable.
Well, I've already explained the difference, if you just restore, that disk creates a restore partition on your mac, copies required files to the disk, reboots, and installs from the harddisk. And installing from and to the same disk is relatively slow.

With this script, you just boot from the flash drive and install.. Both ways work.. result is the same..
levo is offline   1 Reply With Quote
Old Aug 6, 2011, 08:25 PM   #8
Daytona 360
macrumors member
 
Join Date: Apr 2010
Will this script still create a recovery partition on the Mac?
Daytona 360 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X 10.7 Lion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
possible to make bootable disk with external HD? ghostmeat MacBook Pro 2 Nov 13, 2013 03:21 PM
How to make bootable windows USB disk on MAC? tamaramarrero Windows, Linux & Others on the Mac 3 May 21, 2013 12:01 PM
Make bootable floppy disk for a Macintosh SE? wickedking94 Mac Basics and Help 2 Nov 1, 2012 08:22 PM
Bootable USB : lion disk maker app vs disk utility solsearchin OS X 10.8 Mountain Lion 1 Sep 22, 2012 08:18 PM
Make Mountain Lion Bootable USB Flash Drive with Lion DiskMaker (Free) App dfine1966 OS X 10.8 Mountain Lion 12 Jul 25, 2012 12:29 PM

Forum Jump

All times are GMT -5. The time now is 12:25 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC