Saturday, December 6, 2008

How reliable is my NAS ?

If you remembered, I built a RAID5 NAS using Slackware Linux 9 to store my photos online at home. I use JAlbum now to create online albums with resampled photos, but the original images stay on my NAS.

Today, I wanted to expand the storage. I had initially allocated 300GB to the logical volume. I have used over 50% of the storage volume already and before I dump anymore on it, I thought I'd expand the volume.

First some background: I have 4 x 320GB SATA drives. I use software RAID to create a RAID-5 partition and used Linux's Logical Volume Manager (LVM) to manage my volumes within the partition. I use the ext3 filesystem to store my files.

To expand the ext3 filesystem, there are three steps:
  1. Make sure you have space in the RAID Volume Group (VG).
  2. Use lvextend to extend the logical volume to whatever size that is available from the VG.
  3. Use resize2fs to resize the ext3 filesystem.
The steps are quite simple and easy, but what if during one of these steps something happens? Well, the lvextend command executed quickly and smoothly. The resize2fs was another matter. First, the resize2fs requires that the volume you are trying to resize has been fsck'ed. So, you run fsck -f on the volume. fsck was running along fine until all of a sudden I got booted out. I tried it over and over many times. Same result. That was strange I thought. As it turned out, after visiting the console, fsck requires some significant amount of memory to run. With the OS running off my RAM, there was merely 40-50MB left for any process. As fsck grows bigger and bigger during execution, the OS started to kill other processes, including the ssh instance I was logged into. Well, I decided to run fsck from the console then and it finished smoothly.

On to resize2fs. This command is a bit of a memory hog too. It was running for a while from the console until it gobbled up all memory and caused the kernel to panic and hang. Well, that could not be good. Here I had 150GB worth of files and was I about to lose all of it?

I knew I had more RAM somewhere at home so I went to an old machine and yanked out a bar of RAM. With an additional 256MB, my NAS was restarted. I re-executed resize2fs. It took its time ... did not crash ... it took more time ... still not crashing. The signs were good. It completed without any errors. It expanded the 300GB volume to about 600GB.

The ext3 filesystem has shown to me to be quite resilient to operational failure.

No comments:

Post a Comment

Invasion of What?

What are these bugs? I've never seen them before. I saw them at my parents' place the other day. Lots of them in soil or grassy areas.