Burning Linux ISO to USB Using a Mac

My main computer is an old MacBook Pro. I often download Linux ISOs to install on other computers. In recent Debian-esque releases this is actually really simple.

1. I find it quicker and easier to install from USB so first insert a USB pen / stick of some sort.

Note: This USB stick will be erased, so don’t use one with data that you need to keep!

2. Next we need to find out which number has been assigned to the USB stick. If you only have one disk in your Mac then the USB will usually be disk1, but always check first. (Note: Disks are numbered from zero, so your internal drive should be disk0) On your Mac open Disk Utility, which is located within Applications / Utilities. (See Image)

Disk Utility
Disk Utility

Select the USB stick from the lefthand window and then click the Info button which is on the toolbar. (See Image)

USB Info
USB Info

You will get a pop up window with loads of information about the device. We only need the Disk Identifier. Make a note of this for later.

Disk Identifier
Disk Identifier

3. To allow us to write data to the USB stick we need to unmount any volumes currently on there. (see image)

Unmount USB
Unmount USB

4. Now comes the actual writing. First locate the Terminal application, again within Applications / Utilities. (see image)

Mac Terminal
Mac Terminal

5. Remember to change the code to match your Disk Identifier from earlier. There are a few things to note about the following command.

  • sudo – allows you to run dangerous commands, so will require an administrator password
  • Instead of typing the location of the ISO file you can just drag the ISO onto the terminal when required.
  • “if” means input file (in this case the ISO file), “of” means output file (the USB stick)
  • When we found out the Disk Identifier, it was disk1. That will work in the command, but we use rdisk1 instead, which gives us raw access to the disk. This may not be necessary, but it works for me.

There is a lot of discussion about block sizes, but I find 4MB is reasonable for writing ISOs to USB. In Linux we often type bs=4M, however the Mac prefers it like bs=4096 instead. It’s the same thing, just expressed differently.

The command:

sudo dd if=[drag iso here] of=/dev/r[disk number] bs=4096; sync

Example:

sudo dd if=/Users/dan/Desktop/linux.iso of=/dev/rdisk1 bs=4096; sync

If you’ve got it right, you shouldn’t get any feedback until it finishes. Your USB stick may have a blinking LED whilst the data is being written. For reference the 200MB debian-netinst ISO took just over a minute to write.

Once complete you should get something like:

48896+0 records in
48896+0 records out
200278016 bytes transferred in 95.151719 secs (2104828 bytes/sec)

This means you’re finished. Now eject the USB and try to boot your PC with it. The Mac may complain that the disk is not readable but just ignore that and try it on a PC.

Debian Boot
Debian Boot

Help! My PC Won’t Start

Here are some common troubleshooting tips to use if your PC won’t start. This will help determine if your hard drive is having problems, and therefore if you need data recovery.

There are two main types of hard drive failure: Hard drives that are still recognised in the BIOS and hard drives that are no longer recognised.

You may also like to read 5 DIY Data Recovery Tips

Hard drives that are still recognised

Some common error messages:

  • 1st / 2nd /3rd Master Hard Disk S.M.A.R.T. Status BAD, Backup and Replace
    Press F1 to Resume
  • WARNING: Immediate back-up your data and replace your hard disk drive. A failure may be imminent.
  • Windows logo, with a progress bar underneath that just keeps whizzing round and round.

These hard drives are partly functional. They are communicating back to the PC, but may not work well enough to boot up. It is important at this stage to asses the value of the data on the drive. If it is absolutely crucial then don’t mess around with it. Our success from this type of drive is very high. On the other hand, if the data is of little or no value then you could try getting the drive to boot again, but beware: anything that runs for hours on a failing drive could be destroying the data instead of repairing it. You could end up in the category below.

Hard drives that are no longer recognised

Some common error messages:

  • Error loading system disk
  • Reboot and select proper Boot device
    or Insert Boot Media in selected Boot device and press a key_
  • DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

These drives are completely unable to communicate with the PC at all (or they are not connected properly – check the cables). In this case, you will not be able to run recovery software on the drives as the software won’t be able to identify the drive.

These drives require a proper diagnosis to find out the cause of failure. This could be anything from an electronic fault, firmware fault or physical damage to the internal parts.

We can recover data from all sorts of hard drive failures. If the data is important, don’t risk losing it. Get it straight to us.

Apple Mac Time Machine Back Up

I have lost count on the amount of times we have received hard drives for data recovery from Mac customers, who are not aware of the Time Machine back software. Time Machine has been preinstalled in every version of OS X since 10.5. This software is easy to setup, and once the first backup of the internal hard drive is complete, it will then carry on backing up as you create new data.

As a small business or personal user it is ideal for your everyday backup needs.

 

Finding Mac Version The Easy Way

If you want to find out which version of Mac OS X is installed on a drive, but cannot boot into it, there is a plist file that holds the version number.

The file can be found at:
Macintosh HD > System > Library > CoreServices > SystemVersion.plist

Mac OS X System Version
Mac OS X System Version

 

 

 

The SystemVersion.plist file should look a bit like the picture below. I have outlined the relevant part in red:

System Version Plist
System Version Plist

 

 

 

 

 

 

 

 

 

Update.

Alternatively you could paste the following command into terminal:

defaults read defaults read /System/Library/CoreServices/SystemVersion.plist | grep "ProductVersion"

This will show you the version of the currently booted system. You would need to change the first bit if you wanted to find out from another mounted drive.

The output will be:

    ProductVersion = "10.7.2";

In my limited testing, this seems to have an error when run from 10.5. It says the file doesn’t exist. I will look into this some more.

Dual boot Ubuntu & Windows

We needed a dual boot Ubuntu and Windows 7 setup today, which had a few stumbling blocks.

Problem 1. – GPT Partition

Installed Windows 7 on half a 500GB drive and left 250GB free for Ubuntu. When booting to install Linux, it didn’t see Windows 7 due to the GPT partition that Windows 7 uses by default.

Solution 1.

Used Gparted from the Linux live cd to format the drive with an MBR partition layout. (Note:- This destroyed the original Windows installation.) Then installed Windows back to the drive. This time, Ubuntu saw Windows 7 during installation and was happy to install alongside it.

Problem 2. – Default Windows Dual Boot

Although the machine was now happily dual booting, it would default to Ubuntu, regardless of which changes i made to the grub config. Startup manager would make changes to grub, but it would still default to Ubuntu.

Solution 2.

Nariub on the Ubuntu forums suggested changing the os-prober number, so it loads that first. This puts Windows at the top, making it the default. Perfect for what we needed.

The command for this, which worked for us on Ubuntu 11.10 & Windows 7:

mv /etc/grub.d/30_os-prober /etc/grub.d/09_os-prober
update-grub

So now we have the machine booting as we want, with each operating system happily taking up half of the 500GB drive.

Stop Password Expiration In Windows 7

My brother has just brought me his laptop to look at after forgetting the login password. It was frequently asking him to change the password, and one day he changed it and then forgot it. I found a simple command to stop the password from expiring:

First run Cmd (Command Line) as Administrator (click Start -> and type cmd. Right click on Cmd and choose “Run As Administrator”). If you followed correctly this should give you a black command line window with white text.

Then type:

net accounts /maxpwage:unlimited

And press return or enter.

It should congratulate you, or say successful (can’t remember the exact wording).

The password should then last forever, or until it is changed manually.

Note: It is good practice to change passwords regularly, however outside of corporate IT land can be a huge hassle. Just ask my brother 🙂 

MacBook Pro Glitching Fix

Just fixed an annoying problem that started when I upgraded to Lion. When dragging something to the dock from finder, or from a stack to Finder there would be a flash of strange coloured graphics at random points around the screen. It’s gone too fast for me to do a screenshot but I may try to get a small video of it.

Anyway, the fix is easy and involves turning the dock from 3D to 2D mode.

The Terminal commands are as follows:

defaults write com.apple.dock no-glass -boolean YES
killall Dock

The first command sets the Dock into 2D mode, the second command resets the Dock to allow the changes to be seen.

Below is the About This Mac screen. It’s an old (Powerbook G4 Style) MacBook Pro, Core 2 Duo.

Now I just need to find out why it takes so long to boot up.

MacBook Pro - About This Mac

Make a file or folder hidden in Finder

Sometimes when we clone a Mac drive using unconventional methods, it works fine, but has an annoying side effect; Files that are usually hidden in the Finder are instead displayed and accessible to users. These files are hidden for a reason, and contain things like the UNIX system files and some Mac system files which you probably shouldn’t mess with.

Luckily there is a simple terminal command to make these files hidden again. It doesn’t delete them, just changes their file attributes.

sudo chflags hidden filename

sudo allows you to run commands as Super User so be careful! It will ask for a password (but not display it as you type…)

Where it says filename you can either replace it with a file or folder name, or drag a load of folders onto the terminal window and it will fill out the names for you.

An example below:

sudo chflags hidden /var

That would hide the var folder on the root of the boot drive.

I found this really helpful but as usual use it at your own risk…

Mac Data Migration

Portsmouth Data Recovery

If we recover a good amount of your data, the easiest way to get your Mac running again is using the Migration Assistant – a standard Apple utility included with all modern versions of Mac OS X.

The process for restoration varies a little bit depending upon how your Mac is currently set up.

Best Case Scenario:

If you have a new hard drive with a fresh system installed, and have not yet clicked through the Setup Assistant screens follow this guide. >>>

2nd Best Case Scenario:

If you have a new hard drive and have set it up with a username you will need to follow this slightly more complicated guide. >>>