13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 5 ■ WORKING WITH FILESYSTEMSIf you get a notification of a problem, it’s straightforward to remove the disk and rebuild the array.To check which disk has failed and what the problem is, use this:mdadm --query --detail /dev/md0Remove the faulty disk with the following:mdadm --remove /dev/md0 /dev/sda1/Run fsck on the disk:fsck /dev/sda1Once the problem is fixed, add the disk back into the array:mdadm --add /dev/md0 /dev/sda1/The array will automatically rebuild after the disk has been added back in.It’s usually worth trying fsck once to see whether this fixes the problem; disks do sometimes haveminor corruptions that aren’t indicative of serious hardware problems. If you have this problemrepeatedly and, in particular, if it’s the same disk repeatedly, it’s best to replace the disk altogether.■ Note To trigger a scan information e-mail, use mdadm --monitor --scan -1.5-7. Using rsnapshotSnapshot filesystems, which offer instant-availability backups from multiple time points, are a greatidea. But migrating to a new filesystem is a major deal. rsnapshot works on an ext3 filesystem; it usesrsync and hard links to create something that looks and works like multiple instant-availability fullbackups (as with a snapshot system) but that takes up the space of only one full backup plus incrementalchanges.That “full backup space” is of course still the gotcha—basically, you’ll need a spare disk. However,external disks are increasingly cheap, and rsnapshot can be used remotely with ssh. So, you could useone large central disk to keep snapshots of your most important data from multiple clients. (See recipe4-6 for another discussion of doing this without snapshots.)rsnapshot is relatively easy to configure. Install the rsnapshot Debian/Ubuntu package, and thencheck /etc/rsnapshot.conf for the minor edits needed, making sure to uncomment the interval lines.■ Note Directory names in /etc/rsnapshot.conf require a trailing slash, so it’s /local/, not /local. Also, youneed tabs (not spaces) between elements.130Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!