Posted by: Ian | May 19, 2008

Ubuntu Software RAID5 – JFS filesystem

After migrating from Openfiler to Ubuntu Server for my NAS/Storage setup and losing all of my data (About 500GB worth grrr) I’m glad i did my research this time around.

Currently my Ubuntu Server is running software Raid5 with a hot spare and has around 1TB of storage. Whilst this isn’t much considering their are 1TB drives out it’s more than enough for my requirements. The benefits of using Linux Raid5 are that it can grow very easily. Just add bigger drives and hey presto more storage.

One thing I wanted to achieve was reliable storage. I get power outages every so often and whilst I’m not running a UPS (Next few months I will have one) I really wanted a resilient file system. After doing some research I found that JFS suited my needs perfectly.

After a few unclean shutdowns (Power cuts) I’ve finally had my first issue. Upon reboot the /dev/md0 Raid5 array wouldn’t mount, complaining about a bad Superblock. Last time this happened i couldn’t recover it. This time however a few simple commands and i was back up and running.


Lets check the Raid array:

/sbin/fsck.jfs -n /dev/md0

Came back and said the filesystem was dirty oooer.

Next lets fix it:

/sbin/fsck.jfs -a -f /dev/md0

The -a is for Auto Fix and -f is Fix it even it’s clean.

All came back fine so i just remounted it:

mount -t jfs /dev/md0 /media/storage

Everything back to normal and no data lost weeeee.


  1. I’m glad I googled “migrating from openfiler” and found your blog. Did you lose data from using openfiler, or in actually migrating to ubuntu? I want to move my openfiler raid1 to ubuntu 7.10, and I’d rather not move my data off of the drives if I don’t have to.

  2. It wasn’t from actually using Openfiler I lost data. I was running OF virtually and didn’t shut it down properly which corrupted the filesystem. When I put the disks into the Ubuntu system it found the RAID array but couldn’t recover the FS corruption.

    As long as you shutdown Openfiler properly before moving disks around you shouldn’t have any issues. Just remember to do a “sudo apt-get install mdadm” on your Ubuntu system as it isn’t installed by default.

    In any case I’d still recommend backing up your really important files JIC.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: