Hard drives: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
This article discusses the monitoring of hard drives and the best way to deal with hard drive failures. It explains how to make a complete backup of your Gentoo system into another hard drive. | This article discusses the monitoring of hard drives and the best way to deal with hard drive failures. It explains how to make a complete backup of your Gentoo system into another hard drive. | ||
= Monitoring your hard drives using SMART = | |||
Modern hard drives come with a self monitoring system called SMART. This system will apparently report problems and can detect in advance about 2/3 of hard drive failures. Under Linux, a set of tools, smartmontools, may be used to diagnose your hard drives. You can use the program '''smartctl''' manually, or install a daemon that will always run on your system and report failures. | Modern hard drives come with a self monitoring system called SMART. This system will apparently report problems and can detect in advance about 2/3 of hard drive failures. Under Linux, a set of tools, smartmontools, may be used to diagnose your hard drives. You can use the program '''smartctl''' manually, or install a daemon that will always run on your system and report failures. | ||
= Backing up your data and system = | |||
= Making a stage4 = | |||
Under Linux everything is a file so it is easy to create a complete backup of your system. With Gentoo the best way is to generate a personal "stage4" file. Follow [http://gentoo-wiki.com/HOWTO_Custom_Stage4 this guide] on the Gentoo Wiki to do just that. | Under Linux everything is a file so it is easy to create a complete backup of your system. With Gentoo the best way is to generate a personal "stage4" file. Follow [http://gentoo-wiki.com/HOWTO_Custom_Stage4 this guide] on the Gentoo Wiki to do just that. | ||
Line 13: | Line 15: | ||
* Be very careful about the /dev/null and /dev/console nodes. They are indeed needed to boot currently, even with udev. So it is mandatory to create these nodes statically, in the "real" /dev of the new hard drive. If you just follow the guide's instructions, you'll create the nodes after /dev points to something, so they won't reside on the real /dev directory of the hard drive. I advise to create them before chrooting and binding the /dev of the LiveCD. | * Be very careful about the /dev/null and /dev/console nodes. They are indeed needed to boot currently, even with udev. So it is mandatory to create these nodes statically, in the "real" /dev of the new hard drive. If you just follow the guide's instructions, you'll create the nodes after /dev points to something, so they won't reside on the real /dev directory of the hard drive. I advise to create them before chrooting and binding the /dev of the LiveCD. | ||
== Useful Links | = Just copying everything = | ||
* Copying everything using cp -ar will result in a working system. Just exclude dev, proc, sys directories. Even with a recent udev, you still need to create the /dev/null and/dev/console nodes in /dev. This is because they are needed *before* udev is started. | |||
= Useful Links = | |||
* [http://smartmontools.sourceforge.net/ smartmontools Home Page] | * [http://smartmontools.sourceforge.net/ smartmontools Home Page] |
Revision as of 09:44, 12 October 2009
This article discusses the monitoring of hard drives and the best way to deal with hard drive failures. It explains how to make a complete backup of your Gentoo system into another hard drive.
Monitoring your hard drives using SMART
Modern hard drives come with a self monitoring system called SMART. This system will apparently report problems and can detect in advance about 2/3 of hard drive failures. Under Linux, a set of tools, smartmontools, may be used to diagnose your hard drives. You can use the program smartctl manually, or install a daemon that will always run on your system and report failures.
Backing up your data and system
Making a stage4
Under Linux everything is a file so it is easy to create a complete backup of your system. With Gentoo the best way is to generate a personal "stage4" file. Follow this guide on the Gentoo Wiki to do just that.
- Warning: don't exclude "/usr/src/*" from the stage 4 as stated by the guide! /usr/src contains the kernel source, used by several packages, and more importantly, it also contains the kernel's .config file. If you exclude /usr/src in your stage4, you'll have to reedit your kernel configuration.
- Be very careful about the /dev/null and /dev/console nodes. They are indeed needed to boot currently, even with udev. So it is mandatory to create these nodes statically, in the "real" /dev of the new hard drive. If you just follow the guide's instructions, you'll create the nodes after /dev points to something, so they won't reside on the real /dev directory of the hard drive. I advise to create them before chrooting and binding the /dev of the LiveCD.
Just copying everything
- Copying everything using cp -ar will result in a working system. Just exclude dev, proc, sys directories. Even with a recent udev, you still need to create the /dev/null and/dev/console nodes in /dev. This is because they are needed *before* udev is started.