Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Tuesday, 11 February 2014

Restore a deleted Mac partition table

Last Friday, I was attempting to install Windows on my partners iMac without a DVD/CD drive, and I had set up the drive in bootcamp, and committed the system to reboot. The Windows setup started, however when selecting the installation directory, Windows did not like the formatting that Bootcamp had setup, so it offered to delete the partition and recreate it's own NTFS partition - which I opted to do.

Still, Windows setup didn't like something about the disk - spitting out and error and not being able to proceed. A bit of (in hindsight amateurish) Google'ing and I found a solution to "clean the disk" which I accidentally interpreted as cleaning the partition. This was my downfall. What made the situation worse is that the TimeMachine backup which I thought was complete was in fact not complete, and hadn't been backing up for some time.

Crisis!

Having had a little experience with data recovery in the past, I straight away jumped on the data recovery search train and started my search for software which I could use to rebuild the partition table. The problem I found was that many sites and software packages were offering solutions based on disks which were either external drives or secondary to the operating system, which were useless to me, as the entire boot drive's partition table had been deleted.

Many hours of searching and looking at possible solutions included a number of data recovery programs which promised to recover partition tables or extract files from the hard disk but none prevailed. All I could do is boot from a USB stick or use the inbuilt Internet Recovery feature which comes with all Macs. This was dangerous as I didn't want to write to the hard disk, and I wanted maximise my recovery chances by avoiding any writing at all.

The hardest part was finding software which could look at HFS+ data recovery, or rebuilding partitions. Many programs promised the world, but even the trial versions did not deliver. In the end I found a completely free solution which I am happy to share with you now, so you can enjoy my happiness at being able to recover all that data by rebuilding the partition table.

In order to follow my guide, this only applies to Macs which don't have an optical drive.

You'll need:
  • Another computer to download install and use some software to help with this recovery.
  • A USB stick/thumb drive of at least 1gb in size (I used a 4gb stick)
  • A copy of an Ubuntu iso file (I used ubuntu-13.10-desktop-amd64+mac.iso - note the amd64+mac component of this file)
  • Download a copy of the freeware software "unetbootin"
  • A (relatively) fast internet connection with an ethernet connect to your modem - wifi won't work.
  • A USB keyboard and mouse - any should do. The bluetooth wireless mouse and keyboard that comes with most macs won't work throughout the whole process.
The guide:
  1. Once you've downloaded Ubuntu and unetbootin, insert your USB stick and burn a copy of Ubuntu to the USB stick so that you can boot from the USB stick (you can browse to the .iso file you downloaded which I would recommend instead of downloading on the fly).
  2. Plug the USB stick, keyboard and mouse into the damaged Mac and hold the option key when powering up. If you're using a non-mac keyboard, hold ALT on the left.
  3. Choose the USB icon to boot from and the unetbootin menu should appear, follow the menu to boot into Ubuntu which is the live version of ubuntu which you can use to test the OS, rather than install it.
  4. Within a few minutes you should be in the ubuntu desktop environment. Once there, go into the settings (cog icon on the left menu bar)
  5. Open software settings and enable all software from all repositories.
  6. Open a terminal window (click the ubuntu menu, then type terminal) and type "sudo apt-get update". This will update your software repositories which is necessary for the next step.
  7. Install a software program called TestDisk by typing: "sudo apt-get install testdisk". This will download and install testdisk on your system which we will use to interpret the damaged hard drive.
  8. Once complete, type sudo testdisk to open the program.
  9. The next few parts will be a bunch of questions asked by the software before it can begin scanning.
    • Decide if you want a log created (I didn't care)
    • Select the disk which relates to your Mac's Drive
    • Then it asks about the partition type - select Mac
    • The next choice should be analyse
    • And then quick search.
    • It will start scanning with items in green lines indicating partitions the software has found.
  10. After it has finished you should get some results showing the missing partitions!!
  11. At this screen, do not touch the keyboard yet. Grab the mouse and select the results and copy them. Then either write them down (not recommended as you could make a mistake which could cause SERIOUS problems later) or email them to yourself.
  12. My results looked like this: 
  13. You can now reboot your Mac.
  14. Once it restarts take out the Ubuntu USB stick and hold down command (or the windows key if a non-mac keyboard) and R
  15. This will start Internet recovery. Once at the Internet recovery menu, you can open a terminal window using the utilities menu.
  16. With the terminal window type ls (to LiSt the files of the directory you're in)
  17. Type "cd .." to navigate up one level in the folder structure.
  18. Type ls again
  19. Continue to do this until you reach the root directory, which will show "dev" when you do a ls command. Then type cd /dev/
  20. This will move you to the dev directory. At this point ensure your terminal window is as big as possible, use full screen if you can. Type ls again
  21. This will list all the devices on the mac. This is also where it becomes a bit difficult, so it's important to focus on what you are doing otherwise you could damage your disk even more.
  22. Type pdisk - this opens the pdisk program within terminal which allows you to make changes to your computers hard disk.
  23. Type L (note the capital) and hit enter - this will list the disks attached to your computer and should indicate which disk is required - this will be the disk we are looking for. For me, it was rdisk0 or rdisk1 (I can't remember which).
  24. Quit the program, by typing q, and then reopen the program by typing "pdisk /dev/rdisk0" (CAREFUL: your rdisk number could be different based on your result in step 23)
  25. Type c (lowercase). It should tell you that no partition map exists - which is correct - it doesn't yet, but we are about to recreate it.
  26. Type i (also lowercase). It will tell you some stuff about block sizes and the size of your hard disk in blocks.
  27. Type c again. Before anything else - get your info from step 12 above.
  28. In my example the first block was 409640 and the length was the "size in sectors" part, which for me was 1756533456. So type your first block part, hit enter then type your length. Then hit enter again and name it anything just don't use spaces - I just typed the word: one 
  29. Repeat this process for as many partitions that you had - I had 2. So I then typed c again to tell the program I had another partition to create, then 1756943096 and 1269536 and named it: two
  30. Then once you've typed in all your partitions, instead of typing c again, type w
  31. It might prompt you to confirm you want to write the changes, say that you do (y)
  32. Then type q to quit the program. Now restart your mac, holding down the option key.
  33. Your hard drive should appear. And you can boot back into OSX.
  34. First thing you should do now is setup a Time Machine Backup
I hope this has saved you from a sticky situation like it did for me. If you want to share the incredible moment I had yelling like Boris did in James Bond's Goldeneye feel free to buy me a drink:


If you liked this post, or found it useful, please feel free to share with your friends to pass the info on using the buttons below. Alternatively, if you're stuck, feel free to post your comments - chances are you are not the only one who got stuck at some point!

Wednesday, 22 August 2012

Adding a table of contents to your report

Writing a report whether for school, for university or for a job is something most people will come across at least once in their life. One of the key features of a report is a table of contents. But instead of entering all the page numbers manually, and spending hours formatting it, most word processor applications such as Microsoft Word for Windows and Mac, and the Pages application from the iWork suite for Mac have a the table of contents feature built in.


This post is separated into three parts depending which software/system you are using.

  1. First is Pages for Mac, 
  2. Second is Word for Mac, 
  3. Third is Word for Windows

Please scroll down to find the section relevant for you!


Thursday, 16 August 2012

New MacBook Air 13" Reviewed

My old laptop was getting a little slow for my personal use, and so I donated it to my better half for her use. And I got myself a new MacBook Air for Uni/Blogging/Photo editing purposes.

First off the bat, let me say that this is a great machine. The slim design, the battery life and the display are all fantastic, and I am really happy with it.

The thing that impressed me the most was the resolution on the 13" display. My previous laptop was a 15" MacBook Pro, with the same resolution. 1440x900. However having the same resolution on a smaller screen makes everything seem so much crisper than before. I did consider for a brief moment the MacBook Pro with the retina display but the price tag was a little too high given the specification it came with. I felt I just couldn't justify purchasing it. Having a resolution like this on a small screen is kinda like the improvement noticed between a using an iPhone 3G (and 3GS) then using an iPhone 4. Everything is sharper. And when it comes to reading text, or editing photos, you can really see the difference. But enough about the display, what else?

The size is perfect. 11", the model below the 13" felt too small when I picked it up in the shop. And the display did feel a little cramped when opening a webpage or a document. It's lightweight, unlike it's brothers in the "Pro" side, and the battery life is really good. Lasts just long enough for a day at uni, without the need to bring a charger.

The SSD (solid state drive) which is the internal storage for the laptop makes accessing files instant, and the power on time is much faster. There is virtually no lag at all on the machine when in use, however I have noticed that when resuming from standby, i.e. opening the laptop from closed position, that there is a bit of a delay before the input is recognised. Although the display does light up and show instantly, mouse movements and keyboard inputs are not recognised for approx 3-5 seconds, sometimes up to 10 seconds. However when in use, everything is a snap, and multi tasking is a breeze. The laptop can quite easily handle multiple applications open at the same time. For example, I have at least 10 apps open at the moment (in addition to the other system applications) and switching between them is instantaneous and responsive, this is because of the SSD and the 4GB of ram that the computer has, allowing multiple processes to easily be handled.

I am very thankful that Apple has decided to include a backlit keyboard with the Macbook Air's as it makes working in low light conditions, like on an Airplane, or in a dimly lit coffee shop (like where I am posting this right now) great, without having to strain your eyes to see where all the keys are.

One noticeable change with the move the ultrabook computing (MacBook Air falling into this catagory) is that there is an absolute minimum on external connections and ports. The most obvious example is the omission of a CD/DVD drive. Most Apple software that previously came on discs is available through their new "App Store


This store sells a lot of software made by Apple and other developers, and even includes entire Operating System upgrades - which is a huge change in the way that users upgrade their operating system. Normally this would involve buying a disk with a unique code that would assign itself to your computer. However with the introduction of the App store, software is now sold and assigned to your AppleID, or email address which is used to identify yourself with Apple. This means that if your computer get's stolen or damaged and is no longer useable, once you get a replacement computer all the previously paid for applications can be re-downloaded to your computer at no cost, as you have already paid for them. All you need to do is sign into the store with your Apple ID (or email address) and you can view your purchases. When I was at the Apple store, I signed in to the App Store on my new laptop and I was instantly able to download all of my applications! This was a huge bonus for me. So the omission of the CD drive is significant, but much of the content from discs is now available online, movies and music included. In the rare case you do need to use a CD drive you can "borrow" the drive from a nearby Mac via wireless, or you can purchase a USB drive which attaches itself to your computer.

Finally the exterior. This was another reason I picked the 13" over the 11". The additional port for the SD card slot made the 13" a clear winner for me. Having a hobby in photography, being able to shove my SD card into the side of the laptop without the need to actually get the camera, and a cable plugged into the laptop is a huge help and saves time and effort in getting my pictures onto my computer for editing as quick as possible.



There is not a lot wrong with this laptop. At all. Apart from setting up bootcamp (read: installing windows) on to this computer which I could see to be a problem this laptop has it all. For the amount of power packed into this very lightweight machine, the two USB3 ports, the thunderbolt port and the SD port this machine is very reasonably priced especially with the latest 3rd generation ivy bridge processor.

For an everyday laptop with punch, battery life, and speed, this is an excellent buy and I have yet to complain about anything. 5 out of 5 stars from me.


If you liked this post, or found it useful, please feel free to share with your friends to pass the info on using the buttons below.

Tuesday, 8 May 2012

Wrong Date/Time on Mac after shutdown?

Your computer's clock is set to a date before Jan 1, 2008. This may cause some applications to behave erratically.

This happened to me about 15 minutes ago after my laptop ran out of battery last night whilst I was using my computer, and the power cut out.

The error on the screen looked like this:
When I clicked on to my time in the top right hand corner of the screen, I noticed that the clock's time had returned to normal.

However, this can cause problems for you if it's not automatically set back, so here's how you can fix it.

Click the system preferences icon in the dock, as shown below, or click the Apple Icon at the top left hand corner of the screen, and choose system preferences from the drop-down box.
In the system preferences pane, choose Date & Time, then tick the box to automatically update if it isn't already, and that should connect to the Apple servers to update the time.

That said, you can always leave it un-ticked, and set the time manually yourself if you like, and that will resolve the problem.

If you liked this post, or found it useful, please feel free to share with your friends to pass the info on using the sharing buttons below.

Tuesday, 24 April 2012

Keeping your Mac up-to-date

Since the recent news of a Mac malware that was brought to light, a few friends have asked me - how do I know if my Mac is secure and if it is up-to-date? Well this post will explain how to keep your Mac up-to-date, and ensure you have the latest patches and software updates.

The first step is to open software update. If you look at the top right hand side of the screen, it will have an Apple icon. Clicking it will give you this menu. Choose software update.


Clicking software update will present you with this box:
Once that progress bar reaches the end, you'll get one of two boxes.
If there is a software update for your computer, you'll be able to install the updates by clicking install, and if you have the latest software, you'll get a box saying your system is up-to-date, such as below:
That's it. Easy done!

If you liked this post, or found it useful, please feel free to share with your friends to pass the info on using the buttons below.