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!

Sunday, 8 December 2013

Apple's Airport Series: A Router Worth Having

In my opinion, having one of these routers in your home is pretty much, if not definitely a necessary requirement. They make things oh-so-easy, and in true Apple style, clean, easy to use and wildly efficient.
airport family
Part of my job is to provide advice or make recommendations to my clients on new hardware or software to purchase when faced with a problem  that needs resolving, and usually needs resolving fast and permanent. I don't believe in a bandaid fix in my work, as it usually results in repeat work, and generally an unhappy customer.
Today I had a customer who was in dire need of a new internal network for his office. His modem/router/gateway device, whilst performing efficiently for at least the modem component is very dated and aged, and was starting to have DHCP and routing issues, as well as the wireless signal kept dropping out and was weak rendering it basically unusable. However, having had some experience with the AirPort line of products, I recommended he invest $119 in a small, simple and non-obtrusive device into his network, which would solve a lot of the routing issues, as well as enable easy shared printing.
I gotta tell you, it was great. Not only is the range on this little tiny device excellent, but the built in bonjour services as well as the static allocations for the various devices works excellently. I set the router up to be the PPP dialler also, meaning it handles the internet connection, all the modem needs to do now is keep doing what it does best, handle the data link between it and the DSLAM in the telephone exchange. The best part about this entire setup is that I configured the whole thing (except for the static allocations) without having to plug in a cable.
The AirPort family come in three different flavours currently. The baby of the group (the one I set up today) is the express model, which has a gateway ethernet port (to connect your modem to) and one ethernet port. You can either plug one device into this, such as a network printer, or computer that doesn't have a wireless connection. It has one USB port for either attaching a printer or a storage device, and apart from having the inbuilt wireless, it also has a jack to connect speakers to. Whilst the speaker jack is probably not so effective in an office environment, and probably aimed at the home user, it is great to have. Any Apple device can play music wirelessly through AirPlay to the speakers attached to the AirPort.
The bigger brothers of the AirPort express are the "extreme" models. You can either get one with a hard drive built into it for storing data or making easy backups, or you can get one without the internal storage. The extreme models also have a new technology built into them referred to wireless beaming as well as supporting the 802.11ac wireless standard. If you're streaming HD content, or need the extra range on wireless, this would be a better option over the express version. There are two extra ethernet ports (bringing the total to four, including one gateway port), and the speed of these ports on the extreme models is bumped up to 1gigabit up from 100megabit in the express model).

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.

Wednesday, 25 September 2013

"Documents.library-ms" is no longer working, error in Windows 8

"Documents.library-ms" is no longer working. This library can be safely deleted from your computer. Folders that have been included will not be affected.
I've you've got this error, it just means that the link to the folders that Windows is currently using broke, and just needs to be repaired.

Most users won't create new libraries and will just use the default ones included in the system. If this is you, all you need to do is delete them and re-add them.

To do this, open any explorer window, and go to the Libraries option just underneath your favourite links.
Open the Libraries folder and delete the files. Then in the left hand column right click the Libraries and choose restore defaults.

Fixed!

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.

Sunday, 15 September 2013

iOS 7: Coming next week. Why should you update.

Apple's new mobile operating system, iOS is coming next week, and is set to bring about the biggest facelift and change to the operating system since it's introduction back in 2007. As with most updates to the iOS system, Apple has promised over 200 features and new additions to the system.

Many of the applications have been given a flatter perspective and the overall skeuomorphic designs from all of the inbuilt applications has been removed. A whole new pallet of colours have been introduced as well as the obvious facelift throughout the entire system.
From the lock screen there are a number of things that can be done, you can see your notifications, your view of "Today" which is a summary of things that might be relevant to you and your day (more on this in a moment).

There is a new control centre which is also accessible from this screen. The control centre provides you quick access to change some system settings, such as turning off or on:
  • Airplane mode
  • Bluetooth
  • WiFi
  • Do Not Disturb mode
  • Screen rotation lock
In addition, you can also reach other features such as screen brightness, music controls, the all new AirDrop feature, airplay, as well as the camera, calculator, torch (turn the LED flash on), and compass.

Control centre is available from any screen you are viewing as well as the lock screen. Given that control centre links to applications which are not personally identifiable, this option is available from the lock screen and is on by default. However, you can remove it from the lock screen if you don't wish to have it left there for any reason.




The Today section of notification centre gives you a heads up on what's on your day. It gives you a quick overview of the weather - eg, showers with a high of 18, or sunny with a high of 30. Depending on the time of day it might give you the overnight low. In addition it will let you know if it's anyone's birthday, how long it will take for you to get to common destinations that you travel to such as work, gym, friends house, pub... Below this information will show you your calendar for the next few hours of the day, any stocks your following, and how they've changed throughout the day, and if you get right to the bottom it will even give you a heads up on the next day. Such as, you have an early start tomorrow with your first appointment at 6am.

Multitasking has been given a number of really excellent updates too, and not only aesthetically. For starters switching between apps is simple, easy and straight forward. In a similar fashion to what is currently the process, double clicking the home button will show your open apps, with a screen preview of what it looks like. You can then tap that screen preview to go straight back to where you were or you can swipe the screen away to close the application. There's also a number of stuff going on behind the scenes too for multitasking. From Apple's website:

Multitasking has always been a smart way to switch between apps. Now it’s even smarter. Because iOS 7 learns when you like to use your apps and can update your content before you launch them. So if you tend to check your favourite social app at 9:00 am every day, your feed will be ready and waiting for you. That’s multitasking in iOS 7. It knows what you want to do before you do.
Photos have also been improved, with a number of live filters you can set when taking a shot, and the way that the photos you have in your library are organised. iOS 7 automatically sorts your pictures into events or collections related to a holiday or a day trip you took somewhere. You can zoom all the way out too to get a year's glance at all your photos you have taken.



The last feature I'll mention here is the Air Drop feature. If you want to send a file or link or picture, or.. pretty much anything, you can with Air Drop. iOS 7 recognizes other devices around you and shows that persons face or name as a person you can send a file to. According to Apple:
Sending a photo or a document to someone via text or email is fine. But if that someone is right next to you, a text or an email suddenly feels like too many steps. Enter AirDrop for iOS. It lets you quickly and easily share photos, videos, contacts — and anything else from any app with a Share button. Just tap Share, then select the person you want to share with. AirDrop does the rest using Wi-Fi and Bluetooth. No setup required. And transfers are encrypted, so what you share is highly secure.
There are many, many more features coming with iOS 7 next week, and these are just a few. If you want to see more, check out Apple's website which will have more info on iOS and you can see all the features there too.
http://www.apple.com/au/ios/ios7/



iOS 7 Promo video, from Apple:

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.