Rebuilding a RAID1 mirror with Truecrypt container

Background

Rebuilding a RAID1 mirror with a Truecrypt container on it may require some additional steps. I guess that since no filesystem is visible on the disk, the RAID array is having trouble determining which disk to rebuild from. If your neighbourhood have had a blackout, the filesystem in the container is probably dirty anyway. This is how I take care of the matter on my external ICY Box IB-RD4320 USB chassi.

The manual for ICY Box IB-RD4320 USB chassi have this table regarding the meaning of the LED lamps on the unit:

Symptoms

When you boot up from the blackout and connect the disks with the RAID array, the LED is glowing red instead if the expected blue, which according to the manual means Rebuild Error / HDD Capacity Insufficient. I know the HDD capacity haven’t changed, so Rebuild Error seems more likely…

Solution

Fixing the dirty filesystem

In other cases than a blackout, the filesystem may have to be unmounted manually. Check the status of the filesystem:

cryptsetup status /dev/mapper/truecrypt1

If active, it has to be removed:

cryptsetup remove /dev/mapper/truecrypt1

To fix the dirty filesystem, do the following:

  • Disconnect the USB cable
  • Use the power switch on the ICY Box to shut it down
  • Take off the front on the ICY Box and disconnect one of the disks
  • Use the power switch on the ICY Box to turn it on
  • Connect the USB cable
  • The device /dev/sdb (or similar) should become available. If it doesn’t, redo everything from the first bullet but disconnect the other disk instead.
  • When the device becomes available, open up the Truecrypt container but do NOT mount the filesystem:
truecrypt --filesystem=none /dev/sdb
  • Enter your passphrase
  • Check the filesystem:
fsck /dev/mapper/truecrypt1
  • If the previous command generates any errors, these need to handled before you can continue. Otherwise proceed by closing the Truecrypt container:
cryptsetup remove /dev/mapper/truecrypt1

Rebuilding the RAID array

  • When we can access a single disk from the RAID array, we can proceed with the array
  • Disconnect the USB cable
  • Use the power switch on the ICY Box to shut it down
  • Reconnect the disk we removed earlier
  • Use the power switch on the ICY Box to turn it on
  • Connect the USB cable
  • The LED on the ICY Box should now glow green, which according to the manual means Rebuilding Data. This will probably take a few hours, or substantially more depending on the disk size and performance of your computer.
  • When the array is rebuilt, the LED should turn from green to blue.
  • Mount your Truecrypt container to access your files:
truecrypt /dev/sdb /media/seagate
  • Bring out the crackers and cheese!

 

 

 

This entry was posted in Linux and tagged , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *