All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Dining | Diving | Electronics | Exercising | Flying | Hiking | Linux | Linuxha | Monuments | Museums | Public | Rc | Sciencemuseums | Snow | Solar | Trips

>>> Back to post index <<<

2009/11/22 Drive Migrations and Fixes
π 2009-11-22 01:01 in Public
My thinkpad 500GB hard drive had been slowly failing (which I knew courtesy smartd, and , so I got an advanced replacement from Hitachi and copied the failing drive minus its two already failed sectors (courtesy of GNU dd_rescue).

While we're at it, I recommend that people run smartd with the following in their smartd.conf:
DEVICESCAN -R 194 -R 231 -I 9 -W 5 -a -o on -S on -s (S/../.././02|L/../../6/03) -m root -M exec /usr/share/smartmontools/smartd-runner

and that you put this in your crontab for later analysis and figuring out what's being going on with your drives, even after the fact:
2 1 * * * root DIR=/var/log/smart; mkdir -p $DIR ; FILE=$DIR/`date '+\%F'`.log; for i in /dev/sd?; do echo $i; smartctl -a $i; echo; echo; done > $FILE

The harder part was figuring out which files were going to be partially lost due to those sectors. After racking my brain on how I could convert those sectors into filenames and getting nowhere, I realized that was a very simple way of finding out: just read all the files and log the errors.
A day or so later I had read the entire filesystem and narrowed it down to the two files that were damaged. Sometimes the low tech option is the best.

While I was doing that, I was trying some new tools and two new boot CDs I had built, something any self respecting system should carry: UBCD and/or UBCD4Win. UBCD4Win is basically a windows live CD you build from your windows install media, and UBCD has a lot of dos boot floppies (disk check, bios, rescue and more), and a nice version of parted magic, recovery linux live distro that runs from RAM.
The only small downside is where gparted, at least on one occasion, has a small bug that kind of shredded an ext3 partition of mine, but it worked fine the rest of the time, even for resizing ntfs partitions.

The cool part was when I tried to rescue to the ext3 partition for practise (I had backups), and saw Ted Tso online in my gtalk friend list (I'm trying to remember when I added him, maybe when I helped him out with his G1 at a linux conference), and he nicely helped me out trying to fake out resize2fs and then debugfs but in the end, the filesystem was kind of mangled though.

Anyway, gnu ddrescue, ubcd and ubcd4win rule (and mine now contain extra tools, including image for linux and image for windows).

More pages: June 2019 May 2019 April 2019 March 2019 November 2018 July 2018 January 2018 May 2017 April 2017 December 2016 November 2016 September 2016 June 2016 May 2016 September 2015 May 2015 April 2015 December 2014 October 2014 September 2014 July 2014 April 2014 March 2014 October 2013 May 2013 April 2013 January 2013 October 2012 September 2012 August 2012 July 2012 May 2012 April 2012 December 2011 November 2011 July 2011 April 2011 March 2011 December 2010 November 2010 October 2010 August 2010 July 2010 June 2010 April 2010 March 2010 February 2010 December 2009 November 2009 October 2009 September 2009 August 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 October 2008 June 2008 May 2008 April 2008 March 2008 November 2007 October 2007 September 2007 May 2007 March 2007 December 2006 November 2006 October 2006 September 2006 August 2006 June 2006 May 2006 February 2006 January 2006 December 2005 November 2005 October 2005 October 2004 August 2004 June 2004 May 2004 March 2004 September 1997 July 1996 September 1993 July 1991 December 1988 December 1985 January 1980

>>> Back to post index <<<