hard drive - Laptop doesn't boot up (not even to bios settings) and has corrupted partition table
2014-04
My laptop fails to boot up. Since it fails even before I could enter bios settings, I thought it has to be a hardware failure. To rescue my data, I removed the hard disk and plugged it to another PC. There I noticed that the partition table is incorrect, but I was able to rescue my data using the testdisk tool. Is it possible, that it is indeed a software error (meaning I could repair my laptop by repairing the partition table), although it even fails to enter bios?
The laptop is a Samsung Series7 700Z3C. It doesn't boot up, whether there is a bootable CD in the drive or not and whether the internal hard drive is removed or plugged in. When pressing the power button, it just shows a black screen and nothing else. I can hear the cd drive running, but the CPU fan isn't moving.
It fails before I could enter bios, so I couldn't change boot priority which is set to hard drive first (I think). I tried to repair the partition table of the hard disk(see below), but the laptop has a second hard drive (a small SSD) which is soldered, so I can't do anything here.
Repairing partition table
The testdisk utility could recognize the correct partition table, but when I tried to write it to the hard disk, I got a "Partition: Write error". Here the testdisk.log (I didn't log it the first time I ran it, so this probably isn't the log of the correct repair process, but the log of testdisk running later on the already repaired disk)
Fri Jan 4 16:17:33 2013
Command line: TestDisk
TestDisk 6.13, Data Recovery Utility, November 2011
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org
OS: Linux, kernel 3.5.0-21-generic (#32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012) x86_64
Compiler: GCC 4.7
Compilation date: 2012-10-01T13:00:04
ext2fs lib: 1.42.5, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none
/dev/sda: LBA, HPA, LBA48, DCO support
/dev/sda: size 625142448 sectors
/dev/sda: user_max 625142448 sectors
/dev/sda: native_max 625142448 sectors
/dev/sda: dco 625142448 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - CHS 1 1 1, sector size=512
Hard disk list
Disk /dev/sda - 320 GB / 298 GiB - CHS 38913 255 63, sector size=512 - TOSHIBA MK3233GSG, S/N:8027W1BQW, FW:QS002A
Disk /dev/sdb - 750 GB / 698 GiB - CHS 11400 255 63, sector size=4096 - Hitachi HTS727575A9E364
Disk /dev/mapper/crypt - 287 GB / 267 GiB - CHS 561721336 1 1, sector size=512
Disk /dev/mapper/system-HOME - 263 GB / 245 GiB - CHS 514850816 1 1, sector size=512
Disk /dev/mapper/system-ROOT - 19 GB / 18 GiB - CHS 39059456 1 1, sector size=512
Disk /dev/mapper/system-SWAP - 3997 MB / 3812 MiB - CHS 7806976 1 1, sector size=512
Disk /dev/dm-0 - 287 GB / 267 GiB - CHS 561721336 1 1, sector size=512
Disk /dev/dm-1 - 19 GB / 18 GiB - CHS 39059456 1 1, sector size=512
Disk /dev/dm-2 - 3997 MB / 3812 MiB - CHS 7806976 1 1, sector size=512
Disk /dev/dm-4 - 263 GB / 245 GiB - CHS 514850816 1 1, sector size=512
Partition table type (auto): Intel
Disk /dev/sdb - 750 GB / 698 GiB - Hitachi HTS727575A9E364
Partition table type: Intel
Analyse Disk /dev/sdb - 750 GB / 698 GiB - CHS 11400 255 63
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 07
check_part_i386 failed for partition type 07
check_part_i386 failed for partition type 07
get_geometry_from_list_part_aux head=255 nbr=1
get_geometry_from_list_part_aux head=255 nbr=1
Current partition structure:
Invalid NTFS or EXFAT boot
1 P HPFS - NTFS 0 32 33 12 223 19 204800
1 P HPFS - NTFS 0 32 33 12 223 19 204800
Invalid NTFS or EXFAT boot
2 P HPFS - NTFS 12 223 20 8802 254 53 141213337
2 P HPFS - NTFS 12 223 20 8802 254 53 141213337
3 E extended LBA 8803 0 1 87913 48 7 1270905181
Invalid NTFS or EXFAT boot
4 P HPFS - NTFS 87913 48 8 91201 52 51 52822016
4 P HPFS - NTFS 87913 48 8 91201 52 51 52822016
No partition is bootable
test_logical:
Partition sector doesn't have the endmark 0xAA55
Computes LBA from CHS for Disk /dev/sdb - 750 GB / 698 GiB - CHS 11401 255 63
Allow partial last cylinder : Yes
search_vista_part: 1
search_part()
Disk /dev/sdb - 750 GB / 698 GiB - CHS 11401 255 63
NTFS at 0/4/5
filesystem size 25600
sectors_per_cluster 1
mft_lcn 8533
mftmirr_lcn 2
clusters_per_mft_record -10
clusters_per_index_record 1
HPFS - NTFS 0 4 5 1 155 26 25600 [SYSTEM]
NTFS, 104 MB / 100 MiB
NTFS at 1/155/27
Warning: Incorrect number of bytes per sector 512 (NTFS) != 4096 (HD)
filesystem size 141213337
sectors_per_cluster 8
mft_lcn 786432
mftmirr_lcn 2
clusters_per_mft_record -10
clusters_per_index_record 1
HPFS - NTFS 1 155 27 1100 95 39 17651667
NTFS, 72 GB / 67 GiB
recover_EXT2: s_block_group_nr=0/111, s_mnt_count=72/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8176
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 3662080
recover_EXT2: part_size 3662080
Linux 1100 96 21 1328 84 36 3662080
EXT4 Large file Sparse superblock, 14 GB / 13 GiB
Linux Swap 1328 88 41 1510 177 9 2929406
SWAP2 version 1, 11 GB / 11 GiB
recover_EXT2: s_block_group_nr=0/4646, s_mnt_count=71/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 152271104
recover_EXT2: part_size 152271104
Linux 1510 181 16 10989 37 56 152271104
EXT4 Large file Sparse superblock, 623 GB / 580 GiB
NTFS at 10989/37/57
Warning: Incorrect number of bytes per sector 512 (NTFS) != 4096 (HD)
filesystem size 52822016
sectors_per_cluster 8
mft_lcn 786432
mftmirr_lcn 2
clusters_per_mft_record -10
clusters_per_index_record 1
HPFS - NTFS 10989 37 57 11400 38 30 6602752 [SAMSUNG_REC]
NTFS, 27 GB / 25 GiB
Results
HPFS - NTFS 0 4 5 1 155 26 25600 [SYSTEM]
NTFS, 104 MB / 100 MiB
HPFS - NTFS 1 155 27 1100 95 39 17651668
NTFS, 72 GB / 67 GiB
Linux 1100 96 21 1328 84 36 3662080
EXT4 Large file Sparse superblock, 14 GB / 13 GiB
Linux Swap 1328 88 41 1510 177 9 2929406
SWAP2 version 1, 11 GB / 11 GiB
Linux 1510 181 16 10989 37 56 152271104
EXT4 Large file Sparse superblock, 623 GB / 580 GiB
HPFS - NTFS 10989 37 57 11400 38 30 6602752 [SAMSUNG_REC]
NTFS, 27 GB / 25 GiB
interface_write()
1 P HPFS - NTFS 0 4 5 1 155 26 25600 [SYSTEM]
2 P HPFS - NTFS 1 155 27 1100 95 39 17651668
3 E extended LBA 1100 96 1 10989 37 57 158863124
4 P HPFS - NTFS 10989 37 57 11400 38 30 6602752 [SAMSUNG_REC]
5 L Linux 1100 96 21 1328 84 36 3662080
6 L Linux Swap 1328 88 41 1510 177 9 2929406
7 L Linux 1510 181 16 10989 37 56 152271104
write!
write_mbr_i386: starting...
write_all_log_i386: starting...
write_all_log_i386: CHS: 1100/96/1,lba=17677548
write_all_log_i386: CHS: 1328/87/1,lba=21339801
write_all_log_i386: CHS: 1510/180/1,lba=24269490
Partition: Write error
TestDisk exited normally.
But although it always reports this error, I noticed after a few runs, that the partition table now seems to be correct. But the laptop still doesn't boot up.
I ran fdisk and noticed that it reports a wrong logical sector size. I can check that, because I have a second laptop that has exactly the same hardware, which should also have exactly the same partition table. This second laptop is still working perfectly well. Here the fdisk output of the harddisk of the first (broken) laptop:
Hinweis: Die Sektorgröße ist 4096 (nicht 512)
Befehl (m für Hilfe): p
Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 Köpfe, 63 Sektoren/Spur, 11400 Zylinder, zusammen 183143646 Sektoren
Einheiten = Sektoren von 1 × 4096 = 4096 Bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Festplattenidentifikation: 0xfabded4a
Gerät boot. Anfang Ende Blöcke Id System
/dev/sdb1 256 25855 102400 7 HPFS/NTFS/exFAT
/dev/sdb2 25856 17677523 70606672 7 HPFS/NTFS/exFAT
/dev/sdb3 17677548 176540671 635452496 f W95 Erw. (LBA)
/dev/sdb4 176540672 183143423 26411008 7 HPFS/NTFS/exFAT
/dev/sdb5 17677568 21339647 14648320 83 Linux
/dev/sdb6 21339904 24269309 11717624 82 Linux Swap / Solaris
/dev/sdb7 24269568 176540671 609084416 83 Linux
If you're not familiar with german, the first line says "Notice: Sector size is 4096 (not 512)". Another noteable thing is, the line
Sector size (logical/physical): 4096 bytes / 4096 bytes
Here the fdisk output of the correctly working laptop:
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Befehl (m für Hilfe): p
Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 Köpfe, 63 Sektoren/Spur, 91201 Zylinder, zusammen 1465149168 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Festplattenidentifikation: 0xfabded4a
Gerät boot. Anfang Ende Blöcke Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 707418111 353605632 7 HPFS/NTFS/exFAT
/dev/sda3 1412325376 1465147391 26411008 27 Hidden NTFS WinRE
/dev/sda4 707420158 1412323327 352451585 5 Erweiterte
Partition 4 does not start on physical sector boundary.
/dev/sda5 736716800 760152063 11717632 82 Linux Swap / Solaris
/dev/sda6 760154112 1412323327 326084608 83 Linux
/dev/sda7 707420160 736716799 14648320 83 Linux
Partitionstabelleneinträge sind nicht in Platten-Reihenfolge
The last line says "Partition table entries are not in the order of the hard drive". As you can see, the logical sector size here is different. Is this important?
What could be the reasons the laptop doesn't boot up? What would be the next steps to solve the problem?
edit:
First occurrence of the problem
The laptop has installed the original Windows and an additional Ubuntu. I tried to upgrade Ubuntu 12.04 to 12.10.
After upgrading it, grub reported an error. So I booted it up from a live cd, entered the ubuntu system via chroot and then reinstalled grub. I installed it to both the installed hard drives - /dev/sda (the hdd) and /dev/sdb (the SSD).
After that, I rebooted the laptop without the live cd and it started up. Everything seemed to work well, but then I tried to reboot it again and the error was there. From then on up to now I wasn't even able to enter the bios settings.
Have you tried resetting the BIOS ? If altering partition table of hard drives didn't work then the problem may not be with hard drives. BIOS contains initial instructions for the system, so this might indicate that the laptop failed to initialize in the first place. here is a link. You can skip to step 3 because getting into BIOS is not available.
Is it a fairly newer laptop? Do you maybe get a blank screen with a blinking curser? I hope this isn't your problem, but in some newer laptops the GPU screws up.... and will do everything from tell you the harddrive isn't connected right, to not booting at all... on acers you test by pressing below the windows key while you boot to put pressure on the gpu and if it's the GPU it will boot.... the problem is caused by the switch to lead free solder... it looks different when it's gotten hot enough so they aren't getting it hot enough, which leads to a bad connection... as the solder heats and cools over time the connection is damaged... If you google you might be able to find the location of the gpu in that model and put pressure (lots of it) over the gpu while you attempt to boot the computer, or just open it up and put pressure on the gpu while booting if you aren't afraid of getting electrocuted.
I found that problem when I was working on a laptop I bought from craigslist that supposedly just had a failed harddrive, but it wouldn't even boot from cd to install windows on a drive I had. I closed it and set my hot gateway laptop on top of it to look up some stuff. When I was finished I tried booting the bad one and it booted (probably the heat and weight of the other laptop)... unfortunately it only booted from cd and couldn't install windows... then stopped working again... still haven't gotten around to taking a heat gun to the gpu (and got a second laptop with the same problem!)
The other possibility is that the cpu or memory got bumped... remove the memory and put it back in... if that doesn't fix it do the same with the cpu... laptops - like desktops - usually have 3 reasons to not at least boot to bios: Video, CPU, Memory (otherwise it's probably the motherboard)
I've just backed up two partitions with dd under linux, so I have raw partitions images: part1.img and part2.img. Additionally I've backed up the disk's MBR (first 512 sectors of the disk) and some text info ('fdisk -l' /dev/sdb).
fdisk -l /dev/sdb said before I did dd:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7d22da32
Device Boot Start End Blocks Id System
/dev/sda1 * 1 196 1574338+ 27 Unknown
/dev/sda2 197 19457 154713982+ 7 HPFS/NTFS
It's a standard laptop disk so part1 is a system recover partition. Part2 is the Windows Vista bootable partition.
I've then converted part2.img to part2.vdi (VirtualBox disk format). I've attached part2.vdi to an existing virtual XP machine and I can browse it and delete what I want (part2.vdi being second partition, not booting from it).
However the problem is when I want to attach the part2.vdi to the virtualized Linux system and want to mount it.
now fdisk -l /dev/sdb says (sdb being part2.vdi here, so not whole disk as before):
Disk /dev/sdb: 158.4 GB, 158427250688 bytes
255 heads, 63 sectors/track, 19261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2052474d
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/sdb1 ? 410 119791 958924038+ 70 DiskSecure Multi-Boot
Partition 1 does not end on cylinder boundary.
/dev/sdb2 ? 121585 234786 909287957+ 43 Unknown
Partition 2 does not end on cylinder boundary.
/dev/sdb3 ? 14052 14052 5 72 Unknown
Partition 3 does not end on cylinder boundary.
/dev/sdb4 164483 164486 25945 0 Empty
Partition 4 does not end on cylinder boundary.
Partition table entries are not in disk order
Where's the catch? Why does Windows "mount" partition automatically (don't see weird entries) and I can access data but under Linux I have problems with partition table entries? How can I solve it without losing data/partition integrity?
fdisk
is only applicable to a whole disk. part2.vdi is just one partition.
The disk format is roughly:
<MBR><Part Table><Part 1><Part 2>
You only have <Part 2>
- there is no <Part Table>
included in it.
Windows recognises the filesystem on it as NTFS and handles it as such.
You may be able to just mount it in Linux with:
# mount -t ntfs /dev/sdb /path/to/mount
without worrying about partition tables etc.