How to recover ext4 from GPT partitioned disk

Hard drive sizes had increased dramatically in last several years, but block device drivers are still outdated. For hard drives more than 1TB currently seems to be an advantage to use GPT instead of legacy MBR partition table. You can see more details at .

One of the inevitable disadvantage of GPT is the possibility of corruption by using outdated partition editor like cfdisk, or other disk tools, even without any intention to modify the partition.

It happened recently on one 1.5TB WD Caviar Green with GPT and one ext4 partition full of data.

I tried to repair the superblock using tools like:

  • For partition listing:

fdisk -l

  • To check the filesystem:

fsck.ext4 -v /dev/xxx

  • To list where the superblock backups are stored:

mke2fs -n /dev/xxx

  • To restore superblock from backup:

e2fsck -b block_number /dev/xxx

My story was completly different. It does not work this time. Could work fine if you have a traditional MBR partition table. In case of GPT, TestDisk was the magic software that saved my disk. Read documentation first, think carefully what do you want to do and you have a chance to recover 100% your disk. One note here. TestDisk has an “invasive mode” and a “recovery mode”. In recovery mode you can save a specific file or a disk image. This is not distructive. But you must have a spare disk to save the data. In my case I simply fixed the GPT table and I was lucky. That is why I recommend you to fully read the documentation from TestDisk.


Speed up file tranfer between MAC OS X and Linux Samba Server

After scratching my head few weeks, tweaking a lot smb.conf on my linux box, I found a Finder workaround, based on turning off display of server in sidebar.

Symptom: Slow file transfer over the network, between a MAC OS X Lion machine and a Linux machine (archlinux, currnet version). Also slow transfer between MAC and a PC based file server. How slow, let say finder reports about 1 hour for a CD size .iso file.

How to do it:

  1. Open Finder Preferences
  2. On Sidebar tab, disable Connected Servers
  3. On General tab, check Connected Servers

As a result, the mounted volume will appear on the desktop instead of sidebar.

In my case, this Finder workaround helped me to increase the speed more than 20x.

Please let me know if this has improved the share browsing and the file transfer speed in your case.Thanks.