LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   dual boot laptop can't boot windows, possibly damaged hard disk (http://www.linuxquestions.org/questions/showthread.php?t=4175462588)

vtbludgeon 05-19-2013 11:52 AM

dual boot laptop can't boot windows, possibly damaged hard disk
 
Apologies in advance for my verbosity.

This old HP G61 laptop has been dual-booting Ubuntu 12.04 and Windows 7 until Windows suddenly could not boot and prompts us for a system rescue CD. Having no such thing -- this computer was a refurb came with nothing but itself -- and not wanting to confront endless voicemail menus and hold times with HP Support, I have been trying to fix it myself.

Ubuntu is still doing fine, but could no longer mount the windows partition. GParted says:
Code:

check file system on /dev/sda2 for errors and (if possible) fix them  00:00:52    ( ERROR )
           
ntfsresize -P -i -f -v /dev/sda2
           
ntfsresize v2012.1.15AR.1 (libntfs-3g)
Device name : /dev/sda2
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 145019531776 bytes (145020 MB)
Current device size: 145019537408 bytes (145020 MB)
Checking for bad sectors ...
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Checking filesystem consistency ...
Accounting clusters ...
ERROR(5): Couldn't get $Bitmap $DATA: Input/output error

I was able to make images of the two Windows ntfs partitions (one of them is apparently the boot partition, the other has data and programs) with ddrescue, storing them on a removable USB drive. I then tried deleting the afflicted partition sda2 and re-creating it. So far so good. I was also able under Linux to mount the newly created partition.

Next I tried restoring the disk image back onto the partition using dd, and got a vague "dd: writing to `/dev/sda2': Input/output error." I attempted this without mounting /dev/sda2, thinking that was probably the way to go. When I do try to mount it now:

Code:

mount -t ntfs /dev/sda2/ /media/windows
Failed to read last sector (283241272): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
  or it was not setup correctly (e.g. by not using mdadm --build ...),
  or a wrong device is tried to be mounted,
  or the partition table is corrupt (partition is smaller than NTFS),
  or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/sda2': Invalid argument
The device '/dev/sda2' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

Incidentally, the image file of the Windows partition looks good. I was able to mount it to the loop device and navigate around the directories. But I did notice what seems to be a great deal of extraneous crap: folders named with random-looking strings, and many copies of MRT.exe scattered all over.

I have googled and read a good deal but I am hitting the limits of my skills and knowledge. I have no further clue how to diagnose this problem -- if it's a corrupt NTFS boot sector I don't know how to repair it.

One hypothesis is a physically damaged drive that needs replacing. I could replace the drive and try to restore the Windows with my disk images.

But I am not sure that's the case and I wonder what I should next try to do. The weird stuff all over the Windows partition suggests some kind of malware. Could it have trashed my partition table or something?

Note that re-installing Windows from an installation disk is not really an option because this thing came with no installation media. It had some kind of backup partition with an copy of the original windows install but I got rid of that to make room for Linux.

So: what do you think the problem may be and what should I try next?

In deepest gratitude,

David

TobiSGD 05-19-2013 12:36 PM

The problem here seems to be that when you have re-created the partition you created a smaller partition than initially was the case, so that the file-system doesn't fit anymore into it. The best thing would have been if you had made a backup copy of the partition table before messing with partitions. But your real problem is that the file-system was corrupted, so your backup copy of the partition is good for nothing else than maybe copy over some files that you still need, and that you have removed the recovery partition, so that you now are unable to install a fresh copy of Windows. I would recommend to contact the vendor and ask for an installation medium, but it may be possible that you have to pay a fee for that.

Apart from that, if you want to test the harddisk for failure you can use the command
Code:

smartctl -a /dev/sda
as root or download the disk manufacturer's diagnosis tool.

Lennie 05-19-2013 01:36 PM

You can download an installation-iso from anywhere. As long as it is the exact same version as you have a license for, it is legal.

TobiSGD 05-19-2013 01:50 PM

Be careful with such advices, LQ is an international forum and in many jurisdictions it is not legal to download an illegal copy of Windows and use it. Besides that you can never know if an ISO you get from third parties is possibly infected with malware of any kind.
The security paradigm "Never install software from sources that you can't trust!" is also valid for operating systems.
In any case you should get an official and legal ISO to make sure that you get what you want, not some backdoor on your system.

vtbludgeon 05-19-2013 02:57 PM

Quote:

Originally Posted by TobiSGD (Post 4954354)
The problem here seems to be that when you have re-created the partition you created a smaller partition than initially was the case, so that the file-system doesn't fit anymore into it.

I understood that the partition has to be large enough to accomodate the partition image from which you want to restore, and thought I was re-creating a partition identical in size to the one I deleted. I am unpleasantly surprised to see

Code:

Filesystem    1K-blocks      Used Available Use% Mounted on
/dev/sda6      96839396  18473568  73446636  21% /
udev            1399096        4  1399092  1% /dev
tmpfs            564452      864    563588  1% /run
none                5120        0      5120  0% /run/lock
none            1411124      156  1410968  1% /run/shm
/dev/sdb1      390710268 141891112 248819156  37% /media/3554EAA47E444F2B
/dev/sr0          513724    513724        0 100% /media/UBCD523
/dev/sda2      141620220    70308 141549912  1% /media/windows
root@bubba:/media/3554EAA47E444F2B# ls -l disk.2013-05-05.img
-rw------- 1 david david 145019537408 May  5 20:49 disk.2013-05-05.img

So before I go on hands and knees to HP support, let me ask you: do you think replacing the hard drive and re-installing windows from my disk images would work?

And: do you think it is not a case of physical hard disk damage? How did could my partitions have spontaneously gone bad?

Thanks again.

TobiSGD 05-19-2013 03:21 PM

Without further diagnostics it is impossible to say if a failing harddisk is the cause for your problems. But there can be other reasons for the corruption, from a bug in drivers over a power-outage to faulty RAM. Since your image is already corrupted no one can say if the OS on that image is able to boot or work correctly, that is why I recommended a fresh install.

vtbludgeon 05-19-2013 05:19 PM

Quote:

Originally Posted by TobiSGD (Post 4954436)
Since your image is already corrupted no one can say if the OS on that image is able to boot or work correctly, that is why I recommended a fresh install.

How do we know the image is corrupted?

btw I ran a smartctl short test and got the following. It says the overalled health "passed" but then reports a number of errors. Somewhere I read that if the number of errors is "large," that's a problem. I don't know whether 1106 is considered large -- especially when you're a physicist who studies inflationary cosmology and gravitational waves.

Code:

smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-35-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:    Seagate Momentus 5400.6
Device Model:    ST9250315AS
Serial Number:    6VC1AXEQ
LU WWN Device Id: 5 000c50 01b9a6fdc
Firmware Version: 0005HPM1
User Capacity:    250,059,350,016 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:  8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Sun May 19 17:03:59 2013 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x82)        Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 121)        The previous self-test completed having
                                        the read element of the test failed.
Total time to complete Offline
data collection:                (    0) seconds.
Offline data collection
capabilities:                          (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003)        Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01)        Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:          (  2) minutes.
Extended self-test routine
recommended polling time:          (  70) minutes.
SCT capabilities:                (0x103f)        SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG    VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate    0x000f  096  085  006    Pre-fail  Always      -      75479629
  3 Spin_Up_Time            0x0002  099  099  000    Old_age  Always      -      0
  4 Start_Stop_Count        0x0033  098  098  000    Pre-fail  Always      -      2444
  5 Reallocated_Sector_Ct  0x0033  100  100  036    Pre-fail  Always      -      0
  7 Seek_Error_Rate        0x000f  078  060  030    Pre-fail  Always      -      78868810
  9 Power_On_Hours          0x0032  093  093  000    Old_age  Always      -      6954
 10 Spin_Retry_Count        0x0013  100  100  097    Pre-fail  Always      -      0
 12 Power_Cycle_Count      0x0033  098  098  020    Pre-fail  Always      -      2379
183 Runtime_Bad_Block      0x0032  100  253  000    Old_age  Always      -      0
184 End-to-End_Error        0x0033  100  100  097    Pre-fail  Always      -      0
187 Reported_Uncorrect      0x0032  001  001  000    Old_age  Always      -      1116
188 Command_Timeout        0x0032  100  095  000    Old_age  Always      -      1484
189 High_Fly_Writes        0x003a  100  100  000    Old_age  Always      -      0
190 Airflow_Temperature_Cel 0x0022  045  036  045    Old_age  Always  FAILING_NOW 55 (5 197 57 50)
191 G-Sense_Error_Rate      0x0032  100  100  000    Old_age  Always      -      204
192 Power-Off_Retract_Count 0x0032  100  100  000    Old_age  Always      -      397
193 Load_Cycle_Count        0x0032  087  087  000    Old_age  Always      -      26896
194 Temperature_Celsius    0x0022  055  064  000    Old_age  Always      -      55 (0 10 0 0)
195 Hardware_ECC_Recovered  0x001a  051  043  000    Old_age  Always      -      75479629
196 Reallocated_Event_Count 0x0033  100  100  036    Pre-fail  Always      -      0
197 Current_Pending_Sector  0x0012  100  100  000    Old_age  Always      -      7
198 Offline_Uncorrectable  0x0010  100  100  000    Old_age  Offline      -      0
199 UDMA_CRC_Error_Count    0x003e  200  200  000    Old_age  Always      -      0

SMART Error Log Version: 1
ATA Error Count: 1106 (device log contains only the most recent five errors)
        CR = Command Register [HEX]
        FR = Features Register [HEX]
        SC = Sector Count Register [HEX]
        SN = Sector Number Register [HEX]
        CL = Cylinder Low Register [HEX]
        CH = Cylinder High Register [HEX]
        DH = Device/Head Register [HEX]
        DC = Device Command Register [HEX]
        ER = Error register [HEX]
        ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 1106 occurred at disk power-on lifetime: 6947 hours (289 days + 11 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 7a e8 50 00  Error: UNC at LBA = 0x0050e87a = 5302394

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 02 79 e8 50 40 00      00:13:25.360  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      00:13:25.350  SET FEATURES [Reserved for Serial ATA]
  ec 00 00 00 00 00 a0 00      00:13:25.349  IDENTIFY DEVICE
  ef 03 45 00 00 00 a0 00      00:13:25.336  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 00      00:13:25.326  SET FEATURES [Reserved for Serial ATA]

Error 1105 occurred at disk power-on lifetime: 6947 hours (289 days + 11 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 7a e8 50 00  Error: UNC at LBA = 0x0050e87a = 5302394

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 02 79 e8 50 40 00      00:13:22.665  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      00:13:22.656  SET FEATURES [Reserved for Serial ATA]
  ec 00 00 00 00 00 a0 00      00:13:22.654  IDENTIFY DEVICE
  ef 03 45 00 00 00 a0 00      00:13:22.641  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 00      00:13:22.632  SET FEATURES [Reserved for Serial ATA]

Error 1104 occurred at disk power-on lifetime: 6947 hours (289 days + 11 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 7a e8 50 00  Error: WP at LBA = 0x0050e87a = 5302394

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  61 00 08 ff ff ff 4f 00      00:13:19.991  WRITE FPDMA QUEUED
  60 00 02 79 e8 50 40 00      00:13:19.990  READ FPDMA QUEUED
  61 00 08 ff ff ff 4f 00      00:13:19.989  WRITE FPDMA QUEUED
  61 00 18 ff ff ff 4f 00      00:13:19.989  WRITE FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      00:13:19.979  SET FEATURES [Reserved for Serial ATA]

Error 1103 occurred at disk power-on lifetime: 6947 hours (289 days + 11 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 7a e8 50 00  Error: UNC at LBA = 0x0050e87a = 5302394

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 02 79 e8 50 40 00      00:13:17.173  READ FPDMA QUEUED
  60 00 08 ff ff ff 4f 00      00:13:17.172  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      00:13:17.163  SET FEATURES [Reserved for Serial ATA]
  ec 00 00 00 00 00 a0 00      00:13:17.161  IDENTIFY DEVICE
  ef 03 45 00 00 00 a0 00      00:13:17.148  SET FEATURES [Set transfer mode]

Error 1102 occurred at disk power-on lifetime: 6947 hours (289 days + 11 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 7a e8 50 00  Error: UNC at LBA = 0x0050e87a = 5302394

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      00:13:14.509  READ FPDMA QUEUED
  60 00 02 79 e8 50 40 00      00:13:14.508  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      00:13:14.499  SET FEATURES [Reserved for Serial ATA]
  ec 00 00 00 00 00 a0 00      00:13:14.497  IDENTIFY DEVICE
  ef 03 45 00 00 00 a0 00      00:13:14.484  SET FEATURES [Set transfer mode]

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline      Completed: read failure      90%      6954        5302394
# 2  Short offline      Completed: read failure      90%      6938        5302400

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


TobiSGD 05-19-2013 05:58 PM

Quote:

Originally Posted by vtbludgeon (Post 4954485)
How do we know the image is corrupted?

You stated it:
Quote:

But I did notice what seems to be a great deal of extraneous crap: folders named with random-looking strings, and many copies of MRT.exe scattered all over.
But anyways, this indeed looks like a dying drive, so it should be replaced. Looking at the temperatures that drive reached in the past you should also work on better airflow in that machine, if possible, or maybe use a laptop stand with fans.

vtbludgeon 05-19-2013 07:55 PM

OK. Thanks for your help. I think I see a new drive and a call to HP in my future.

EDDY1 05-19-2013 08:51 PM

Quote:

Originally Posted by TobiSGD (Post 4954391)
Be careful with such advices, LQ is an international forum and in many jurisdictions it is not legal to download an illegal copy of Windows and use it. Besides that you can never know if an ISO you get from third parties is possibly infected with malware of any kind.
The security paradigm "Never install software from sources that you can't trust!" is also valid for operating systems.
In any case you should get an official and legal ISO to make sure that you get what you want, not some backdoor on your system.

There are legal copies downloadable from digital river, that are meant for reinstalling using your own wins key, or for using as a repair disk.
http://www.mytechguide.org/10042/win...iver-download/

vtbludgeon 05-20-2013 08:29 AM

Wow, that is extremely interesting. But it gives rise to another question. I don't think I have any means of knowing the exact version of the Windows 7 that this laptop came with, other than my memory -- hence no certainty as to which image I should download. I ~believe~ it came with Windows 7 Home, 32-bit but can't say as to whether it had SP1. Since I can mount the partition images and look at everything, I wonder if there's a way to ease out the version information.

I know we're getting a bit far afield of official forum topic. Thanks for your indulgence and thanks again for all the help.

yancek 05-20-2013 09:33 AM

Find the windows version:

http://windows.microsoft.com/en-us/w...erating-system

More detailed info on the computer: Click the windows Menu button, mouse up to Computer, right click and select Properties.

EDDY1 05-20-2013 10:42 AM

The sticker underneath the machine also says what os & should have your wins product key

Peverel 06-01-2013 04:25 PM

Are you sure that what you call the boot partition is not in fact a recovery partition, to reset Windows to its factory condition? If it is and is undamaged, you could try putting it back in its original position and try to boot it (F8 during startup, I believe). Obviously you need the Windows partition back in place. This will overwrite GRUB, of course.

syg00 06-01-2013 06:11 PM

Having just been through something similar (re-furbed HP Ultrabook), some comments:
- Win7 ships with 2 partitions (boot and system) and HP has a recovery and (in my case) "HP tools" partitions.
- documentation is shipped "on disk", and includes a procedure to create a recovery DVD/USB so the recovery partition can be safely deleted. Needed just over 11 Gig on a 16 Gig USB for me (Win7 Pro). Note this recovery is a HP tool, not a copy of the M$oft disc.
- looking online I'd say you had Win7 Home Premium.

Given you can mount the disk image, but not copy it back to the original disk, I'd have to agree the disk is on its way out. Worry about your data first - get it copied off to some other media (from the image).
HP should be willing to help - if the disk is dead, the recovery partition would be no good anyway; no need for them to be told you deleted it.

Edit: didn't realise this was a 2 week old thread that had been re-opened. Hopefully helps anyway.


All times are GMT -5. The time now is 03:47 PM.