Hard Drive Data Recovery

November 13th, 2014

This article discusses hard disk data recovery on Linux using dd and fdisk.

I recently left for a trip to South America, and took my trusty Intenso 320GB external drive with. Well aware that I’ve dropped it a couple too many times and that it was beginning to click more and more often during regular usage, I took a full backup before leaving. There’s nothing critical on the drive that I don’t have additional copies of elsewhere, however losing it would be a pain.

Having reached Madrid airport, I plugged the drive in and was about to pull some documents off it when disaster struck. The drive just clicked for about 30 seconds before Windows prompted me to format it. I tried removing it and reinserting it a couple of times but no luck – the drive had failed. I went to the duty free store in the airport and picked up a 1Tb WD Elements drive for 99 Euros, and planned to attempt data recovery when I arrived in South America.

I’m keen to get the data recovery started – it’s going to take a while on my USB 2.0 laptop and the more bad sectors, the longer it will take.

Read the rest of this entry »

Shrinking/Resizing ext3 Partitions

September 26th, 2009

Shrinking or expanding an ext3 partition is easy but is not without it’s risks. Before starting, you NEED to take a backup of your data. There’s a strong possibility that it will all disappear and your filesystem will become permenantly broken, as with any disk or filesystem procedure.

Please note:

  1. The steps below are the RAW STEPS required to resize your partition. This is a potentially dangerous procedure that could easily destroy/ruin/damage your partition, data, filesystem or other partitions on the same disk.
  2. DO NOT perform these steps on a live/production machine
  3. DO NOT perform these steps unless you have a full backup of your data/disk
  4. These steps are really for theoretical purposes only. They should work just fine, but tools such as gparted will do this for you.
ns3:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.4G  6.8G  2.2G  77% /
tmpfs                 443M     0  443M   0% /lib/init/rw
udev                   10M   92K   10M   1% /dev
tmpfs                 443M     0  443M   0% /dev/shm
/dev/sdb1              20G  9.8G  9.0G  52% /email

In my example, I’m going to resize /dev/sdb1 which is my /email partition. /dev/sdb1 is a partition residing on device /dev/sdb

ns3:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.4G  6.8G  2.2G  77% /
tmpfs                 443M     0  443M   0% /lib/init/rw
udev                   10M   92K   10M   1% /dev
tmpfs                 443M     0  443M   0% /dev/shm
/dev/sdb1              20G  9.8G  9.0G  52% /email
217.10.156.195:/email
31G  3.5G   26G  12% /email/carolesobell.com
ns3:~#

Read the rest of this entry »