[mythtvnz] Dying OS HDD - What would others do?

Stephen Worthington stephen_agent at jsw.gen.nz
Sun Jul 1 12:14:58 BST 2012


On Sun, 01 Jul 2012 20:52:02 +1200, you wrote:

>Hi
>I've got mythbuntu 10.04 LTS running on a backend with 3 x 2TB drives, a 
>4th 2TB drive connected over eSATA (for media copies and now OS 
>backups!) and the OS on an oldish 120G SATA HDD that is failing and I 
>assume is the one making noise....
>
>The reallocated sector count has risen I think with a crash this evening 
>that required a reboot from 6 to 21 sectors.  SMART status has gone from 
>healthy to unknown.
>
>I've got a 60G SSD that was intended for a new frontend however it seems 
>I need to use this as a replacement for the OS drive.
>
>The options I see are to
>1 run up a new copy of 10.04 and try to copy back stuff
>2 try to copy the file system to the new SSD
>3 run up a later version.
>
>Starting with 3 I don't want to do this, I think I need to recreate a 
>working system before I upgrade from:
>
>mythtv0:/usr/share/mythtv$ mythfrontend --version
>xprop:  unable to open display ''
>Please attach all output as a file in bug reports.
>MythTV Version   : 26863
>MythTV Branch    : branches/release-0-23-fixes
>Network Protocol : 23056
>Library API      : 0.23.1.201000710-1
>QT Version       : 4.6.2
>Options compiled in:
>  linux debug using_oss using_alsa using_pulse using_jack 
>using_pulseoutput using_backend using_dvb using_firewire using_frontend 
>using_glx_proc_addr_arb using_hdhomerun using_hdpvr using_iptv 
>using_ivtv using_joystick_menu using_libudev using_lirc using_mheg 
>using_opengl_video using_opengl_vsync using_qtdbus using_qtwebkit 
>using_v4l using_x11 using_xrandr using_xv using_xvmc using_xvmc_vld 
>using_xvmcw using_bindings_perl using_bindings_python using_opengl 
>using_vdpau using_ffmpeg_threads using_libavc_5_3 using_live using_mheg
>
>to 0.25.  Aside from the HDD issues 0.23 is still (largely) meeting our 
>needs.  When I have some time I'll run up 0.25 on a new machine and try 
>to copy across or start again...  For now I need the system to continue 
>as is.
>
>Option 2 I'm not sure where to start to do it this way however I expect 
>it could be done, can anyone give me a starting pointer? Or should I do 
>option 1?
>
>Option 1 seems the most robust - and ? the longest way to do it.
>
>I've been copying stuff off the dying drive.
>
>So far I've copied:
>/var/log/
>/var/lib/
>/var/www/
>/home/
>/etc/
>The database backup is writing to one of the 2T drives so those are also 
>safe.
>I've copied my repo URL's also.
>Anything else I need?  Any suggestions?

The database is the big thing.  With that, you can install the same
version of Mythbuntu and then install your database and it should
work.  If you have any custom scripts, you will need them too.  It
also works to install the database onto a newer MythTV version.  On
startup, MythTV will check the database version and upgrade it to the
version it needs.  I have done this several times when updating to new
Ubuntu versions.

The procedure for installing an existing database on a new system is
here:

  http://www.mythtv.org/wiki/Database_Backup_and_Restore


But what I would do in your situation is Option 2 - just copy the
existing system to a new disk.  That is because that should not take
too long unless the failing drive has uncopyable sectors.  With
MythTV, I rarely have more than a few hours between recordings when I
can do something like that.  So quickest is best for me.  What I would
probably do is boot a CD with Clonezilla on it, and use Clonezilla to
make a copy of the partitions on the failing disk.  That could be
directly to your new drive, or to image files on another hard disk and
then from there to the new disk.  That should take no more than an
hour to do, if it is going to work at all.  It should work if SMART
says you do not have any "current pending" sectors (attribute 197), or
"offline uncorrectable" sectors (attribute 198).  And it may work even
if you do, as long as those sectors are not currently in use in a
file.  Bad sectors that the drive has already managed to remap
(attribute 5) will not cause any problems.

Here is the Clonezilla Live CD:

  http://clonezilla.org/clonezilla-live.php

If the backup worked, then you can try booting from the new disk.  Due
to the change of disk type, you may need to use the procedure to
install grub onto the new disk from a booted Mythbuntu live CD - there
are web pages to tell you how, but hopefully you will not need to do
that.

If the backup did not work due to damage to the failing disk, then
using Gnu ddrescue to make a copy might still work, but that can take
quite a while due to the massive number of retries that may be needed
to read failing sectors.

I would have a little concern as to whether an SSD drive is properly
supported by 10.04 - I would want to check that first before choosing
it as my new system drive.

As a precaution, I normally have bootable partitions available on at
least two of my data drives, so I can just copy to there and start
running again if I am having problems with my system drive.  My system
disk is also a recording drive anyway (3 Tbyte Hitachi - very fast). I
have never had any problems with having my system on a recording
drive, but I have always used a fast disk.  I would be wary of doing
it with a "green" type drive.



More information about the mythtvnz mailing list