Tag Archives: linux

This post will tell you how to repair / fix Mac HFS+ partition using Ubuntu CD (Live CD or Install CD).

What do you need to do this?
Ubuntu CD (I used Ubuntu 8.10 Desktop Edition Install/Live CD)
Mac
Internet Connection (Wired)

Few days back I had installed Debian 5.0 lenny on my MacBook. Because, I don’t have much hard disk capacity (only 80 GB), I had to delete the Linux partition (waiting for Ubuntu 9.04).  I used BootCamp Utility (in Mac) to delete the Linux partition. It wipes off all the linux data & restores Mac partition (ex: I had 60GB Mac + 20GB Linux, After restore 80GB* Mac).
I was happy that it was restored. But, the partition had errors after restores. I was not able to copy/store the any data if it exceeds 60GB on Mac, it says the Mac startup disk is full. Then I realized that the Mac file system (i.e., HFS+) had errors. Yes, the Ubuntu CD is there to rescue me. Enough story… follow this to proceed…

1. Disable journaling on Mac parition before booting into Ubuntu CD
Use this command on your Mac terminal

  • sudo diskutil disableJournal /dev/disk0s2

where disk0s2 is your Mac partition (use ‘df’ command to find out the root disk name, it should be mounted on ‘/’)

2. Boot from Ubuntu CD
Insert the Ubuntu CD, press ‘C’ on startup to boot from CD.

3. Connect to Internet & Install HFSprogs
After Boot connect to Internet, Yeah! I know the wireless won’t work now. I suggest you to connect from Wired.
I assume that you are connected to Internet now.
Then enable Universe packages using ‘Software Sources’.
Then, Install hfsprogs package

  • sudo apt-get install hfsprogs

    This will enable you to check & repair the HFS+ paritions.

    4. Check & Repair

    You need to do fsck check on your Mac partition. Use fdisk command to find the Mac device.

    abhinay@ubuntu:~$ fdisk -l
    WARNING: GPT (GUID Partition Table) detected on ‘/dev/sda’! The util fdisk doesn’t support GPT. Use GNU Parted.

    Disk /dev/sda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0×00000000
    Device Boot Start End Blocks Id System
    /dev/sda1 1 9730 78150743+ ee GPT

    using fdisk didn’t show the Main Partition of mac, It shows only one partition. The above partition sda1 is the EFI partition (boot partition).
    That means, /dev/sda2 is your Mac partition.

    Perform fsck on sda2

    abhinay@ubuntu:~$ sudo fsck.hfsplus /dev/sda2
    ** /dev/sda2
    ** Checking HFS Plus volume.
    ** Checking Extents Overflow file.
    ** Checking Catalog file.
    ** Checking multi-linked files.
    ** Checking Catalog hierarchy.
    ** Checking Extended Attributes file.
    ** Checking volume bitmap.
    Volume Bit Map needs minor repair
    ** Checking volume information.
    ** Repairing volume.
    ** Rechecking volume.
    ** Checking HFS Plus volume.
    ** Checking Extents Overflow file.
    ** Checking Catalog file.
    ** Checking multi-linked files.
    ** Checking Catalog hierarchy.
    ** Checking Extended Attributes file.
    ** Checking volume bitmap.
    ** Checking volume information.
    ** The volume Macintosh HD was repaired successfully.

    Hurray! It is repaired now…!

    One more last thing you ‘ll have to do.

    5. Enable the journaling on Mac Partition
    use this command on Mac to enable the journal back.

    sudo diskutil enableJournal /dev/disk0s2

    You are done! :)

    **This worked for me!

    Comment me if you have any troubles or suggestions. Thanks for reading my blog!

    It was too annoying that i was not getting Deja Vu Sans Condensed font for firefox itself, whereas this font is working with other applications in Gnome. I was getting Sans font instead in Firefox. After gooooogling (too long) i got a workaround for this.

    Just add this lines to userChrome.css (create a new file if it is not there), create this file in ~/.mozilla/firefox/(profile)/chrome folder.

    * {

    font-family: “Deja Vu Sans Condensed”;

    }

    Before:

    firefox sans screenshot

    Firefox with Sans Font - Looks Ugly

    After:

    firefox deja vu font bug fixed

    Firefox with Deja Vu Font Working - Looks Good

    I love this font :)

    For storyline please read this : http://www.jasonlefkowitz.net/blog1archive/2007/02/howto_pretty_up.html

    Openbox is lightweight window manager. I installed it on my gentoo, i really liked it. Openbox starts in blink of an eye my gentoo.Openbox just takes seconds to install in any distro. It comes around 500 Kb download size. I have been using GNOME environment in Ubuntu. I feel like GNOME is too slow in my system. I installed openbox and used with gnome session. It is really faster than complete GNOME session. You can change the session from the GDM option menu. Select, Openbox with GNOME session. You’ll get gnome panel, nautilus and other gnome apps with faster openbox window manager without losing the most of the gnome look & features. Openbox rocks !!!

    I did,
    sudo aptitude install openbox

    and here is the screenshot for you ;)

    Openbox in Gnome Screenshot - Openbox Rox

    Openbox in Gnome Screenshot - Openbox Rox | Running Urxvt, Scrot, Gnome-panel, Conky, Nautilus, Xcompmgr and some applets