A few observations on a failing hard drive and fitting a replacement

MartinLiddle

Super Moderator
Staff member
For a while now I have been aware of an occasional stutter in play back and thought the most likely explanation was that hard drive was starting to fail (1TB drive in HDR-FOX T2 purchased December 2010). I started monitoring the reallocated sector count in late May when it was 1106. For the next 8 weeks it was increasing at a rate of about 4 sectors a day reaching 1355 on the 25th July. Since then the rate has increased dramatically and the play back problems have become much more obvious and today the count stands at 1743. I have had a new 2TB Seagate 2TB drive (ST2000VM003) waiting for a few weeks and made the replacement this afternoon. I used the excellent aft123 instructions at http://wiki.hummy.tv/wiki/2TB_Disk_Installation_Blog and the physical replacement was very straight forward taking less than half an hour to remove the old drive and install the new drive. I used the partitioning and file system creation instructions in the af123 article and they worked exactly as described. I then connected the old drive to a USB to SATA converter and then had to think as af123's instructions stop at that point. My method for copying content from the old drive to the new was as follows:

Code:
cd /tmp
mkdir mynew
mkdir myold
#Mount new drive partition 1 temporarily on /tmp/mynew
mount -t ext3 /dev/sda1 mynew
#Mount old drive partition 1 temporarily on /tmp/myold
mount -t ext3 /dev/sdb1 myold
#Copy data across; very quick for EPG partition (less than 10 seconds)
cp -afv myold/* mynew
umount myold
umount mynew
#Mount new drive partition 2 temporarily on /tmp/mynew
mount -t ext3 /dev/sda2 mynew
#Mount old drive partition 2 temporarily on /tmp/myold
mount -t ext3 /dev/sdb2 myold
#Copy data across; time will depend on volume of data; 560GB took a bit over 10 hours to transfer
cp -afv myold/* mynew
umount myold
umount mynew
#Mount new drive partition 3 temporarily on /tmp/mynew
mount -t ext3 /dev/sda3 mynew
#Mount old drive partition 1 temporarily on /tmp/myold
mount -t ext3 /dev/sdb3 myold
#Copy data across; took 40 seconds.
cp -afv myold/* mynew
umount myold
umount mynew
Put the HDR into standby and then restart.

Based on a single data point and our tolerance to stutter in playback, I would suggest a tentative initial conclusion that a 1TB hard drive with less than 1000 reallocated sectors is usable (I guess this would suggest 500 sectors as a tolerance for a 500MB drive?). Beyond this point it should be monitored carefully and replaced when the daily rate of sector reallocations starts to increase rapidly. If a few other people post observations then these guide lines could be refined.

All in all I found the process very straight forward. The only minor surprise was that the copy of data for partition 2 took so long but doubtless there is a quicker way.
 
I lost faith in my 1TB drive with the count at 270. It was increasing by one or two sectors a couple of times a week and I was getting the same symptoms as those you describe. I also had to run fix-disk a couple of time - which is a good utility to have available, but not something you want to become routine. I replaced like-for-like, formatted in the Hummy and the machine has been flawless since the replacement. I keep all content backed up to a USB drive, so relocating content was not a problem.
 
Thanks for this.
The only minor surprise was that the copy of data for partition 2 took so long but doubtless there is a quicker way.
560MB in 10 hours works out at about 120kbps. That does seem rather slow, even for USB2 - which ought to be faster by a factor of 100. Could the caddy have fallen back to USB1 speed?
 
Thanks for that and glad it worked for you.

When I replaced my factory fitted 500GB for a WD 1TB model I did things slightly differently.

1) Running a Windows 7 [64bit] PC I installed EXT2IFS to enable my PC to read and write to the ext3 disk.

2) I removed the 'old' HDD from the Hummy. Inserted it into my HDD Caddy which is eSATA and copied over the contents of the MyVideo directory to my PC.​

3) I installed, temporarily, the new 1TB HDD in the Hummy and formatted it. As it was 1TB it was no problem.

4) Removed the freshly formatted drive and connected it to my HDD caddy which is eSATA.

5) Then I copied back the contents previously saved on my PC.

6) Fitted the new HDD back, closed up, and the patient was happy to be breathing again.

Job done. I didn't want to go down the 2TB route as it would simply mean that SWMBO would have even more cr@p to catch up with!
 
I lost faith in my 1TB drive with the count at 270.
I think each user will have a different tolerance to the play back glitches. When it was two or three a day that was very acceptable for us. As as it got above 10 per day it was beginning to irritate and at the end it was 50 a day which was definitely not acceptable. I kept it going for as long as possible mainly for research purposes to get a feel for how things progressed. We were lucky and never had a need to run fix-disk.
 
560MB in 10 hours works out at about 120kbps. That does seem rather slow, even for USB2 - which ought to be faster by a factor of 100. Could the caddy have fallen back to USB1 speed?
I agree it is very slow but I just left it going overnight so for something done only once in a while I can live with it. I was actually using a USB to IDE/SATA converter rather than a cradle but the packaging says that it is USB 2.0 capable but I agree that the speeds seem much more like USB 1. Is there a way to see from the command line whether a USB storage device is connected as USB 1 or 2?
 
3) I installed, temporarily, the new 1TB HDD in the Hummy and formatted it. As it was 1TB it was no problem.

Was the new drive a 4K sector size advanced format drive? My concern would be that formatting it on the Humax will not align the partitions with the 4K sectors and will impact performance. I went through this when upgrading the drive in my notebook to a 500MB SSD drive.

I didn't want to go down the 2TB route as it would simply mean that SWMBO would have even more cr@p to catch up with!

Yes but the problem was that SWMBO was in danger of filling the 1 TB drive with her dubious stuff leaving no room for my treasure.
 
. I then connected the old drive to a USB to SATA converter and then had to think as af123's instructions stop at that point. My method for copying content from the old drive to the new was as follows:

Mine was similar but I used rsync rather than cp. Left it overnight.
 
Well, I did buy a brand new WD10EURX HDD with the intention of using that. However, it is an Advance Format drive. I found the instructions to correctly format it and align the sectors rather complicated and gave up.
Instead I used my older WD10EVDS. Whilst it is 1TB and AV/CE rated, it is not an Advanced Format drive. This was the one I previously had in my Toppy.
How to align sectors etc. was as clear as mud to me. I needed an idiots guide, step by step. Didn't have one so I have a brand new 1TB Advanced Format HDD not being used! Yet. I will have a play if someone would 'hold my hand' through the process.

I have my own Hummy to play with. I refuse to use it for her stuff! When her Hummy's disk is full, something will have to be deleted. I just hope it isn't me!
 
560MB in 10 hours works out at about 120kbps.
Sorry just realised that there was an error in the comment in my script; for 560MB read 560GB which is a more reasonable 15MB/s. I have tried connecting the USB to IDE/SATA converter and old drive from the HDR to one of my Linux servers and copying off a 10GB file which took 5 minutes 24 seconds which gives about 30MB/s so I think the converter is fine and the limitation is perhaps the CPU in the HDR. Copying on my server (dual core 2GHz processor) top shows the copy process taking about 17% CPU time.
 
Well, I did buy a brand new WD10EURX HDD with the intention of using that. However, it is an Advance Format drive. I found the instructions to correctly format it and align the sectors rather complicated and gave up.
It really isn't that difficult. Using the custom firmware on the HDR, telnet in, type cli to get to the command line and then type the following commands:

Code:
gfdisk -u /dev/sda

Try typing m and Enter at this point to see the options. If the disk is already incorrectly partitioned then you need (I think) to delete the partitions and start again so use the d (delete a partition) option to delete each of partitions 1, 2, and 3.
Then create the new partitions using the n (new partition option). Start with partition 1 and use the numbers from af123's blog so for partition 1 enter the start sector as 64 and the end sector as 2104575. The magic is that 64 is exactly divisible by 8 and 2104575-64+1 is also exactly divisible by 8. For partition 2 again use the af123 numbers (start 2104576 and end 3886043175). For partition 3 use the start sector of 3886043176 but you may need to adjust the end sector if the WD drive is slightly small than the Seagate. Use the p option to print out the partition table and check that it matches then use the w option to write the partition table to the disk and exit. Then put the Humax into standby and then bring it out of standby to cause the new partition table to be read.

All that remains is to create the file systems on the partitions and you can use the mkfs.ext3 commands provided by af123 to do this.

The whole process done slowly and carefully shouldn't take more than 15 minutes as all the commands other than creating the second partition return almost immediately. Reboot the Humax again and you are ready to copy files by whatever method you prefer.
 
I will give it a go when I have chance.

I suppose what is baffling me is that I am used to a format WIPING a disk. I suppose I need to understand that the sector alignment is something done after a format? Confused.com.
 
Formatting does erase content but you actually format a partition (logical 'bit' of a drive) and not a drive itself.
Most windows type computers traditionally just used a single partition which spanned the entire drive, and they also call partitions drives which adds to the confusion. For example, if you partition a disk into two on a Windows machine, one partition will be 'drive' C and the second will be 'drive' D...

The Humax divides the hard disk into three sections - three partitions - and uses them for different purposes. Each of those partitions needs to be aligned with the actual sectors on the disk otherwise performance (and noise and heat output) will be affected.

Once you have created the three partitions, each is formatted in turn.
 
I suppose what is baffling me is that I am used to a format WIPING a disk. I suppose I need to understand that the sector alignment is something done after a format?
Format does different things depending on the underlying media. On a floppy disk it writes the pattern of sectors and tracks. On a modern hard drive the pattern of sectors and tracks is generated as part of the production process so the format command is only generating a file system (the way that the operating system knows where to find a particular item of data). The sector alignment is done at the partitioning stage where the drive may optionally be divided into a number of independent regions called partitions. On the Humax there are three partitions; the first one holds EPG data; the biggest partition is used for recorded programs and other media and the third partition is used for streamed data eg iPlayer.

In my explanation above the gfdisk command is doing the partitioning and the mkfs.ext3 commands are creating the file system which is what I think equates to your notion of formatting. So the sector alignment is done before the format.
 
Thanks all for the very informative advice. I have learnt something, never a bad thing.

I will play as soon as I have the time.


Sent from my iPad using Tapatalk HD
 
It really isn't that difficult. Using the custom firmware on the HDR, telnet in, type cli to get to the command line and then type the following commands:

Code:
gfdisk -u /dev/sda

Try typing m and Enter at this point to see the options. If the disk is already incorrectly partitioned then you need (I think) to delete the partitions and start again so use the d (delete a partition) option to delete each of partitions 1, 2, and 3.
Then create the new partitions using the n (new partition option). Start with partition 1 and use the numbers from af123's blog so for partition 1 enter the start sector as 64 and the end sector as 2104575. The magic is that 64 is exactly divisible by 8 and 2104575-64+1 is also exactly divisible by 8. For partition 2 again use the af123 numbers (start 2104576 and end 3886043175). For partition 3 use the start sector of 3886043176 but you may need to adjust the end sector if the WD drive is slightly small than the Seagate. Use the p option to print out the partition table and check that it matches then use the w option to write the partition table to the disk and exit. Then put the Humax into standby and then bring it out of standby to cause the new partition table to be read.

All that remains is to create the file systems on the partitions and you can use the mkfs.ext3 commands provided by af123 to do this.

The whole process done slowly and carefully shouldn't take more than 15 minutes as all the commands other than creating the second partition return almost immediately. Reboot the Humax again and you are ready to copy files by whatever method you prefer.


I have just got round to trying to align the partitions in my new Advanced Format HDD but have fallen at the first hurdle.

My HDR had the vanilla original FW, 1.02.32 installed. I fitted the new unformatted HDD into the machine and allowed the HDR to format it.

I then installed the CF v2.18 and Telnet into the box OK. At the cli command prompt I entered gfdisk -u /dev/sda. As I formatted the HDD by the Hummy I assumed it would be incorrectly aligned and proceeded to delete the partitions, starting at 1. This is were I crashed and burned. I got an onscreen message:

Command (m for help): d
Partition number (1-3): 1
Error: Partition /dev/sda1 is being used. You must unmount it before you modify it.

I get the same message for the remaining two partitions.

Could a kind sole tell me in easy to understand language and step-by-step, how to do all this? Including what start/end sectors etc I need to enter for my 1TB disk as the instructions I have read thus far seem to relate to a 2TB HDD.

Thanks.
 
First off, run the 4kalign diagnostic to see if they're already aligned.. You may be lucky! If you post the output I can give you instructions to align it if not.


Posted on the move; please excuse any brevity.
 
OK. Here you go:

Code:
>>> Beginning diagnostic 4kalign
Running: 4kalign
    Logical  Sector size:                  512 bytes
    Physical Sector size:                  4096 bytes
    Logical Sector-0 offset:                  0 bytes
 
Disk /dev/sda: 1000 GB, 1000202273280 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953520065 sectors
Units = sectors of 1 * 512 = 512 bytes
 
  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              8    2104510    1052226  83  Linux
Warning: Partition 1 does not end on cylinder boundary.
/dev/sda2        2104512  1932539166  965217330  83  Linux
Warning: Partition 2 does not end on cylinder boundary.
/dev/sda3      1932539168  1953520062    10490445  83  Linux
Warning: Partition 3 does not end on cylinder boundary.
 
*  OK  * - partiton /dev/sda1 is properly aligned.
*  OK  * - partiton /dev/sda2 is properly aligned.
*  OK  * - partiton /dev/sda3 is properly aligned.
 
>>> Ending diagnostic 4kalign

I guess I got lucky. They seem properly aligned, don't they? Or have I read it wrong?
 
Yes, they're aligned. The key thing to check is that the start sector of each partition is a multiple of 8.


Posted on the move; please excuse any brevity.
 
Back
Top