dev-os

[Ubuntu] Installing Ubuntu 12.04LTS Server from USB using Mac OS X

검은바람 2013. 6. 26. 11:51
반응형

So, I mainly use Ubuntu Server as my main development OS – it’s unix, it’s free, it’s fast, it’s easy to install, and most importantly, its package-management utility apt makes it extremely easy to install software.

Whenever I need to get a physical server up and running, I just download the latest LTS (long-term support) distro .iso file from Ubuntu, and put it on a USB drive, and do a USB install. It avoids having to find a blank CD/DVD, deal with any related CD/DVD drive issues, and (depending on your USB drive), it’s *fast*. Of course, your computer’s BIOS has to support USB drives for boot, but most computers made in the last 7 years that I’ve run into do support this.

Note – the instructions below will completely delete anything from the USB drive you use in these instructions; make sure you’ve backed up any important files from your USB Drive before beginning. And when you’re all done, to use your USB drive again, you’ll need to reformat it for whatever filesystem you need to use with your OS to remove the OS install image.

Here’s what I usually do:

1. On my Mac, I download the Ubuntu install .iso file from here; by default in Safari, it went into my Downloads directory
2. Open up a terminal window and change to your Downloads directory and list the directory contents:
cd ~/Downloads
ls

In my case, the name of the file in my downloads directory was: ubuntu-12.04-server-amd64.iso

4. Convert the .iso file into an .img file:
hdiutil convert -format UDRW -o ./ubuntu-12.04-server-amd64.img ./ubuntu-12.04-server-amd64.iso
5. Rename the Ubuntu image to get rid of the .dmg extension:
mv ./ubuntu-12.04-server-amd64.img.dmg ./ubuntu-12.04-server-amd64.img
6. Insert your USB drive, and found what official device it was in OS X by typing:
diskutil list
This displayed a bunch of stuff:
.
.
.
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *32.1 GB disk3
1: DOS_FAT_32 MY_USB_DRIVE 32.1 GB disk3s1

So, my USB key is /dev/disk3; keep this in mind – yours may be different.

7. Unmount (but don’t ‘eject’) the USB Stick with:
diskutil unmountDisk /dev/diskN
(where diskN is what appeared in ‘diskutil list’ for your drive, e.g. in this case it is /dev/disk3)

8. Write the file to the USB key:
sudo dd if=/Users/username/Downloads/ubuntu-12.04-server-amd64.img of=/dev/disk3 bs=1m
Because you ran the above ‘dd’ command as superuser (you started the line with ‘sudo’), before it runs the command, OS X will come up asking you for your password for the privileges to run the file as root. This is OK – just type in your password. Note in the line above that ‘username’ is my username (yours will be different, use it instead), and /dev/disk3 is the device that step 8 showed it to me; yours may be different.

9. Once this is done, OS X will ‘eject’ and ‘reinsert’ the USB key, causing an error to pop up, something about not being able to read the disk. Ignore this and just click ‘eject’ and you’re done. You now have a bootable USB stick/key with the Ubuntu installer on it.

10. Plug it into your computer, and configure your BIOS boot menu to ensure that the BIOS is configured to boot from your USB stick, and you should be good to go.

출처 : http://www.resolveradiologic.com/blog/2013/01/28/installing-ubuntu-12-04lts-server-from-usb-using-mac-os-x/

서버버전은 기존에 나와있는 USB인스톨러와 궁합이 안맞아서 찾아봤더니 이런 방법이...

반응형