[GLLUG] How to repair an unallocated hard drive?

Mark Preston mark at markpreston.co.uk
Sat Apr 10 11:54:37 UTC 2021


On 01/01/2021 16:14, Chris Bell via GLLUG wrote:
> Hello Mark
> Knoppix appears to show sda as a 2TB disk partitioned using GPT which will
> install a GPT partition immediately after the space normally used by the DOS
> MBR to provide more space for information about multiple main partitions, not
> just the maximum of 4 physical partitions in the old MS-DOS. Most computers
> search for the MBR, so it is used to re-direct the BIOS to the GPT partition.
> The main boot sequence is then controlled from the GPT partition, and none of
> the other partitions will be labelled as bootable.
>   I often see some unallocated space at either end of the disc space, usually
> less than 1 sector, but most of sda appears to be a single partition, possibly
> using a swap file instead of a swap partition.
> Perhaps the disc was re-partitioned as a GPT disc, which would overwrite the
> original MS-DOS system, but then just left not further partitioned or
> formatted.
> There appears to be more information about sdb and its partitions without
> mention of corruption.
> If sda is corrupted do not try to alter it. There was a package "photorec"
> designed to recover deleted photos which was later enhanced to recover almost
> anything and may be re-named "testdisk". It is not a quick and easy recovery,
> but can examine, list, recover, and copy as many directories and files as
> possible to another formatted disc.
>
Hi all,

Just an update to this thread.

I found the information posted by Chris above and John Edwards 
previously very useful. I also found the web-page 
https://help.ubuntu.com/community/DataRecovery helpful. I took my time 
to back up the unallocated hard drive in various ways using two 4TB 
external hard drives, before using scalpel to obtain the spreadsheet 
files I was really interested in (see 
https://stackoverflow.com/questions/22542527/recovering-odt-file-using-scalpel 
for an example of how to do this). Then I used gparted to restore the 
partition table on the actual hard drive itself.

  I tried to reboot the hard drive but this failed due, I think, to the 
lack of a /boot/EFI. I could see all the files on the various other 
partitions though using Knoppix. So, I resorted to trying various Linux 
distributions such as Debian, Mint, and eventually Red Hat. All from 
various Linux Magazine or Linut Format CDs. The Red Hat CD was useful in 
that it appeared to put the EFI file in a 130GB partition that I had 
created for a new "home" directory. Nevertheless it still wouldn't boot 
for some reason. However, after that I was able to use Linux Mint (which 
hadn't worked previously) to get a bootable system. Eventually I was 
able to transfer the EFI directory to a much smaller partition, and use 
the 130GB partition as a new home partition.

Currently the disk looks like this:

root at mark-H97-HD3:/home/mark# parted -l
Model: ATA ST2000DX001-1CM1 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
  2      1049kB  538MB   537MB   primary   fat32
  1      539MB   149GB   149GB   extended
  8      539MB   12.0GB  11.5GB  logical   ext4
  5      12.0GB  13.0GB  1023MB  logical   linux-swap(v1)
  6      13.0GB  130GB   117GB   logical   ext4
  7      130GB   149GB   18.8GB  logical   linux-swap(v1)  boot
  3      149GB   2000GB  1851GB  primary   ext4

Number 8 is /dev/sda8 the / directory, and number 3 is /dev/sda3 which 
is now my "backup" partition and holds all the files that were in my 
previous home directory. The /dev/sda6 partition contains the new home 
directory. I'm not too sure what number 1 (/dev/sda1) is doing at the 
moment. My guess is not a lot, or why the linux-swap(v1) has the boot 
label, but at least the system is up and running, and the HMRC basic 
tools is also working. Anyway, thank you GLLUG.

--

Regards,

Mark Preston





More information about the GLLUG mailing list