Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: El Cabron on July 11, 2012, 07:06:01 AM



Title: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: El Cabron on July 11, 2012, 07:06:01 AM
Well when I load up bitcoin wallet on windows 7 it never full loads and will freeze my whole computer (have to force reboot). I have had this for over a year and no issue. My wallet is backed up and running fine on a different computer so no worry there. I also updated to the newest version and still same issue.

It just says not responding and then has an "APP CRASH"

Any idea what I should do other than reload the OS?

Thanks.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Raoul Duke on July 11, 2012, 08:47:10 AM
Try and do a disk defrag.

When I switched to ubuntu completely was because Bitcoin killed my HDD on windows. The blockchain got fragmented because Bitcoin was always running and the auto-defrag wouldn't touch the blockchain.
When I recovered the blockchain from the damaged HDD it copied fast until it reached 500MB, which was the part that wasn't fragmented. The rest of it took almost 24hrs to copy, little piece by little piece.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: DeathAndTaxes on July 11, 2012, 01:57:25 PM
Sounds like a failing disk.  If you have a second drive on the system try
a) get zip not installer version of client.
b) unzip it to the second drive
c) run bitcoind with command line parameter pointing to a datadir on the second drive.

If your problem goes away then likely you have bad sectors on your primary drive.  I would plan to replace it soon.   You can also use a S.M.A.R.T. utility but watch out they often false negative.   If SMART reports drive errors/failures then you almost certainly have a bad drive but a clean bill of health from SMART is no guarantee.

Maybe I am just biased though.  We had 8 of 20 drives on our storage array fail in the last 3 months at my day job.  Fun times.  Note to IT people everywhere:  the reason enterprise grade drives have batch/lot numbers is so you DON'T use all drives from the same batch in an array. 


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 02:44:25 PM
I assume I should be checking for bad sectors right?
I don't know what software you downloaded. You should've gotten smartmontools. Then simply run info & capabilities; short and long tests. Edit: and display all.



C:\Program Files (x86)\smartmontools\bin>smartctl.exe -i -c /dev/sda
C:\Program Files (x86)\smartmontools\bin>smartctl.exe -t short /dev/sda
C:\Program Files (x86)\smartmontools\bin>smartctl.exe -t long /dev/sda
C:\Program Files (x86)\smartmontools\bin>smartctl.exe -x /dev/sda


Edit: once you boot Linux you can also fix/remap the bad blocks automatically using "/sbin/badblocks -nsv /dev/sda". But do it only after you've made a backup. Trying to remap bad blocks on a disk that run out of spare blocks typically ends in an even worse failure.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: unclemantis on July 11, 2012, 03:11:08 PM
I do hope you had a backup of your wallet.dat that contained your most recent private keys before this accident! :-(


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 03:34:45 PM
0% fragmented :/
Actually, you are probably quoting the average fragmentation of the whole disk.

If you had a tool that shows just the fragmentation of the Bitcoin files you would get astounded. They are nearly maximally fragmented.

To quickly defragment just the Bitcoin directory:

1) copy it to a backup disk
2) delete the original directory
3) copy back into the original place

If you really can't backup onto a separate disk do at least zip, delete, unzip.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 04:35:16 PM
I'm just going to format it and put on linux. However so far I have one bad sector. Something I should worry about?
Only worry about bad sectors if they can't be repaired. If you are going to do a complete reinstall then run "/sbin/badblocks -wsv /dev/sda" to completely rewrite and remap all possible bad blocks.

This is especially true in case of laptops, where bad blocks could be the result of an accidental jostle.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 04:56:58 PM
im a noob.. i copy paste that in the cmd line on windows 7?
I'm not sure what you are exactly doing.

"smartmontools" works the same under Windows and Linux.

"badblocks" runs only under Linux, and since it could be destructive you need to run it while Linux is booted from CD or USB in recovery mode.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: OgNasty on July 11, 2012, 05:57:30 PM
I've found that Windows machines always need 2 hard drives.  1 that is actually used, and the other to backup everything for a monthly reformat so that the first one works properly.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: dooglus on July 11, 2012, 08:42:40 PM
I had an issue with a 6 week old laptop a couple of days ago where it just hung while running Linux, and after rebooting it, the blockchain files were corrupted.

I asked for advice on the ##linux freenode IRC channel and got the following:

Quote
20:43 < dooglus> I bought a new laptop a few weeks ago, and the hard
    drive seems to be playing up already:
20:43 < dooglus> Jul 10 11:40:09 chris smartd[6083]: Device: /dev/sda
    [SAT], 16 Currently unreadable (pending) sectors
20:44 < dooglus> is that to be expected, and it will mark the bad
    sectors and work around them, or should I take it back for repair?
20:44 < bjonnh> dooglus: take it back now
20:44 < bjonnh> dooglus: a failing harddrive on its early life is
    always worse two month later
20:45 < dooglus> I see
20:45 < bjonnh> dooglus: most of the time dead
20:45 < MooingLemur> dooglus: currently pending sectors means it
    couldn't read them, but would remap them on the next write.  If
    they're happening now, exchange it.  Don't trust it at all.
20:46 < KsM> start backing up
20:46 < MooingLemur> dooglus: sometimes it's worth going directly to
    the HDD manufacturer and just getting an advance RMA rather than
    trying to deal with the laptop manufacturer
20:46 < dooglus> is there any way I can get an identifier for the hdd
    so I can see whether they really replace the hdd or just reformat
    it?
20:47 < MooingLemur> dooglus: smarctl -i /dev/sda
20:47 < MooingLemur> you'll get a serial from that

Is that reasonable advice?  I didn't know about the 'badblocks' command to remap bad blocks, but if it's the case that bad disks tend to get worse quickly perhaps I'm best off returning it for replacement.

I ran the 'short' SMART test mentioned above, and that passed:

Quote
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%       834         -

and the 'long' test is currently running.  I bought the laptop 5.5 weeks ago, and according to the test result above, it's been on for 834 hours (4.9 weeks).  So it does look like it was new when I got it, and it worked flawlessly until it didn't.

Comments?


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 08:50:38 PM
perhaps I'm best off returning it for replacement.

Comments?
If you like the laptop then keep it and use it. Repair the bad blocks, monitor for any new bad blocks and get the replacement drive under warranty if you get any more bad blocks without a reason, like jostling.

What is worth more: a spare hard drive lying on the shelf or your time wasted with no laptop?

Edit: According to the IT-man I know, the most common case of early laptop drive failure is when people shift the fresh laptop on a smooth desk. The clean rubber feet make the laptop jump a little and then visibly oscillate while being shifted. That doesn't happen once the rubber feet are somewhat dirtier and worn out.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 11, 2012, 09:00:30 PM
I assume I should be checking for bad sectors right?

Thanks.

- run "cmd" as Administrator
- run "chkdsk C: /f /v /x /r" and reboot
- take a look into the Windows eventlog under Application - wininnt

You can replace C: by every partition you have on that Laptob to check the filesystem intensively!

Dia


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 11, 2012, 09:01:20 PM
I'm just going to format it and put on linux. However so far I have one bad sector. Something I should worry about?



IMHO every bad sector on a drive is one too much ... I would replace that disk!

Dia


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 11, 2012, 09:02:37 PM
I've found that Windows machines always need 2 hard drives.  1 that is actually used, and the other to backup everything for a monthly reformat so that the first one works properly.

I read that you dislike Windows, which is of no help here ^^. You always should create a backup!

Dia


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: dooglus on July 11, 2012, 09:21:22 PM
perhaps I'm best off returning it for replacement.

Comments?
If you like the laptop then keep it and use it. Repair the bad blocks, monitor for any new bad blocks and get the replacement drive under warranty if you get any more bad blocks without a reason, like jostling.

What is worth more: a spare hard drive lying on the shelf or your time wasted with no laptop?

The laptop manufacturer seems to think that the warranty only lasts for 90 days.  I didn't buy an extended warranty.  I can manage without the laptop for the 7 to 10 days they claim the repair will take.

Thanks for your input though.  Maybe if I hadn't just spent 24 hours backing up the hard drive and arrange for a courier to pick it up I would consider just remapping the bad sectors.  :)


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 11, 2012, 09:25:50 PM
perhaps I'm best off returning it for replacement.

Comments?
If you like the laptop then keep it and use it. Repair the bad blocks, monitor for any new bad blocks and get the replacement drive under warranty if you get any more bad blocks without a reason, like jostling.

What is worth more: a spare hard drive lying on the shelf or your time wasted with no laptop?

The laptop manufacturer seems to think that the warranty only lasts for 90 days.  I didn't buy an extended warranty.  I can manage without the laptop for the 7 to 10 days they claim the repair will take.

Thanks for your input though.  Maybe if I hadn't just spent 24 hours backing up the hard drive and arrange for a courier to pick it up I would consider just remapping the bad sectors.  :)

I would never trust a disk with bad sectors, at least not with personal / important data on it.

Dia


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 09:31:04 PM
- run "cmd" as Administrator
- run "chkdsk C: /f /v /x /r" and reboot
- take a look into the Windows eventlog under Application - wininnt

You can replace C: by every partition you have on that Laptob to check the filesystem intensively!
This is a bad advice. It gives you false negatives: chkdsk only scans inside partitions, but doesn't scan partition headers and various boot and recovery files.

Also chkdsk will be fooled with extended retry algorithms that are used in modern drives (with the exception of the most expensive enterprise drives). It will be silent about all the marginal sectors that are barely readable after many seconds of trial reads. You especially want to know about those in advance.

smartmontools are the best friend of smart disk drive users.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: pekv2 on July 11, 2012, 09:44:54 PM
I'm just going to format it and put on linux. However so far I have one bad sector. Something I should worry about?



IMHO every bad sector on a drive is one too much ... I would replace that disk!

Dia

I would never trust a disk with bad sectors, at least not with personal / important data on it.

Dia

+2

imo, I would change out any hard drive with bad sectors, even if fixed/repaired in cmd line and/or terminal, it can come back 10x worse.  It just shows that this the beginning of your problems.

I just recently broke up my raid0 because of one hdd had 4 bad sectors. I would take no chances even with one bad sector repairable or not.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: dooglus on July 11, 2012, 10:41:04 PM
smartmontools are the best friend of smart disk drive users.

Do you think it's worth printing out some smartmontools output to put in the package with the laptop when I send it back?

What's a good smartctl command to get a reasonable amount of output for printing?

What I don't want is to wait 10 days and get the laptop back with a note saying "looks fine to us".

The 'long' test just finished:

Quote
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       00%       836         153439088
# 2  Short offline       Completed without error       00%       834         -

Edit: I notice that the '-H' (health) check tells me it 'passed':

Quote
$ sudo smartctl -H /dev/sda
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-25-generic-pae] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 11:01:27 PM
Do you think it's worth printing out some smartmontools output to put in the package with the laptop when I send it back?
I always did just that. But I never sent the whole computer back, only the disk.
What's a good smartctl command to get a reasonable amount of output for printing?
I always did "smartctl -a", but if you want to save space you can use "smartctl -A", "smartctl -l selftest" and "smartctl -l error". In would also print the results from the manufacturer's diagnostic: either OEM like Dell, IBM, HP or the actual drive manufacturer if this was a retail drive. I also have a duplex printer that I could configure to print 4 pages per one sheet of paper, so I couldn't claim saving the trees.

"-A" is the most interesting to look at. "-l error" looks the scariest if you suspect bad behavior from the service department.

"-A" could also give you away. E.g. you'll have "G-Sense Error Rate" high then its a proof of a dropped laptop. Same things with "Power On Hours", "Power Cycles" and "Temperature Celcius" if you were fiddling with the computer.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: dooglus on July 11, 2012, 11:12:25 PM
"-A" could also give you away. E.g. you'll have "G-Sense Error Rate" high then its a proof of a dropped laptop. Same things with "Power On Hours", "Power Cycles" and "Temperature Celcius" if you were fiddling with the computer.

I don't know how to read the information.  What does this tell you?  I really don't think the computer has ever been dropped or even bumped.

Quote
chris@chris:~$ sudo smartctl -A /dev/sda
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-25-generic-pae] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   050    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       1064
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       100
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   050    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   050    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       837
 10 Spin_Retry_Count        0x0033   102   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       94
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       15

192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       2
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       823
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       42 (Min/Max 20/51)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       16
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       2
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       0
222 Loaded_Hours            0x0032   099   099   000    Old_age   Always       -       625
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
224 Load_Friction           0x0022   100   100   000    Old_age   Always       -       0
226 Load-in_Time            0x0026   100   100   000    Old_age   Always       -       256
240 Head_Flying_Hours       0x0001   100   100   001    Pre-fail  Offline      -       0

If that's saying I've turned the computer on and off 94 times, then I find that hard to believe.  I would expect something less than 20 to be the true figure - possibly even less than 10.  Unless it's counting when I close the lid and it goes into a suspended state, in which case I can quite believe the number.  I often have uptimes of over a week, and never reboot into Windows.

Edit: weird how bold spaces are narrower than regular spaces, messing up the table layout


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 11, 2012, 11:51:46 PM
I don't know how to read the information.  What does this tell you?  I really don't think the computer has ever been dropped or even bumped.
The health is almost everywhere at 100%; 98% being the worst. If you really think that you haven't jostled the laptop itself, then continue to monitor the G-Sense counter every day or several times per day, until you'll identify the problem. Maybe its a window striking the table you keep the laptop on? Maybe you are slapping the lid shut sometimes?

You have 16 "Current Pending Sectors"; those are awaiting remapping/fixing.  This correlates with 15 "G-Sense" warnings: some vibration problem or unstable workspace.
 
If that's saying I've turned the computer on and off 94 times, then I find that hard to believe.  Unless it's counting when I close the lid and it goes into a suspended state, in which case I can quite believe the number.
Yeah, probably aggresive power saving. The Start-Stop count is at 100 with 94 power cycles.



Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: 2112 on July 12, 2012, 02:37:02 AM
What is going to last longer?
For current bitcoin{d,-qt} definitely spinning drive will last longer. As it is right now bitcoin{d,-qt} is a worst-case load for the solid-state drives:

1) it writes a lot of data that is never read: the database/log.* files
2) it has bad write amplification behavior: writes too small chunks of data that aren't properly aligned.

So you'll need either a spinning plater or a high-end SSD. Better ask your wife than me. ;)


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 12, 2012, 06:56:52 AM
- run "cmd" as Administrator
- run "chkdsk C: /f /v /x /r" and reboot
- take a look into the Windows eventlog under Application - wininnt

You can replace C: by every partition you have on that Laptob to check the filesystem intensively!
This is a bad advice. It gives you false negatives: chkdsk only scans inside partitions, but doesn't scan partition headers and various boot and recovery files.

Also chkdsk will be fooled with extended retry algorithms that are used in modern drives (with the exception of the most expensive enterprise drives). It will be silent about all the marginal sectors that are barely readable after many seconds of trial reads. You especially want to know about those in advance.

smartmontools are the best friend of smart disk drive users.

Sorry, but no ... on Windows this is the standard for checking filesystem problems. To diagnose further I would use a bootable tool from the HDD/SSD vendor. As SMART tools on Windows get often blocked or show wrong results due to IDE/SATA/AHCI drivers blocking the SMART commands. Also SSDs vendors use often non-standard fields in their SMART state, which are often not recognized by SMART tools.

Dia


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: dooglus on July 12, 2012, 06:59:56 AM
I wiped Linux off my laptop before returning it to the manufacturer and reinstalled the Windows 7 MBR so it would boot straight into Windows.  Before sending it off I installed smartmontools for Windows to check that it shows the same error as its Linux counterpart, and it did.

I've never tried smartmontools on Windows before.  I use Windows as little as possible generally, but this time it worked for me.


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 12, 2012, 07:01:08 AM
Okay, it seems I should replace the hard drive. Now should I get a HDD just like it or solid state? What is going to last longer?

I back up data that I find very important often.

In a mobile device, which will get shocked more during normal use, I would go SSD. Nowdays I would even got SSD with normals PCs, but perhaps add a normal spinning HDD here for data-storage.

Edit: The point with the Bitcoin client and many writes to the disk is true, which wears out a SSD faster. But really, a current SSD should do it's job at least for the warranty period, which is 3-5 years + Bitcoin is soooo much quicker with a SSD!

Dia


Title: Re: Bitcoin Wallet on Windows 7 fails hard after a year of no problems.
Post by: Diapolo on July 12, 2012, 07:05:08 AM
Okay, it seems I should replace the hard drive. Now should I get a HDD just like it or solid state? What is going to last longer?

I back up data that I find very important often.

In a mobile device, which will get shocked more during normal use, I would go SSD. Nowdays I would even got SSD with normals PCs, but perhaps add a normal spinning HDD here for data-storage.

Dia

most laptops do not have two hdds right, do any?

That's right, sometimes you can place a second disk where an optical drive resides, but I would not consider this standard. Get a decent external USB-HDD for backup and enjoy a SSD (that's what I do).

Dia