Jan. 21, 2009
I recieved my bubba two storage solution from Excito today! I must say that I was both surprised and impressed once I unwrapped and pluged it in to my network. It was both smaller and quiter than I expected!
I also purchased an additional 1TB eSata drive, also from Excito, which looks almost the same as the server. Knowing from their specs that the device did not yet support raid-1 I was nevertheless hoping to get this running with the additional disk I bought. So far I have synced 39.2% of the new raid array I created and things are looking very promising. For anyone intrested, these are the steps I took:
First of all I setup a new account through which I could access the server through SSH. I then connected to the system over SSH to look at the partition table. Fortunately the layout was quite good and required only little work to adapt it for mirroring. The bubba two server I bought came with a 1TB disk partitioned like this:
/dev/sda1 0+ 1216 1217- 9775521 83 Linux
/dev/sda2 1217 121456 120240 965827800 8E Linux LVM
/dev/sda3 121457 121600 144 1156680 82 Linux swap / Solaris
My concern was to mirror the “storage” partition (sda2) where I will be keeping my data. This partition was currently mounted as /home which was in use as it contained my home directory. So in order to start building the RAID array I had to do some small preparations. All of the commands should be executed as root.
To be able to unmount the partition I first created a new “home” directory
mkdir /home2
I then copied all of the contents from /home to /home2
cp -a /home/* /home2/
With the home contents in the new directory I opened the passwd file and changed my home-directory from home to home2
nano -w /etc/passwd
In order to minimize the chance of screw-up I opened a new terminal window after saving the passwd file to verify that I could still SSH to the box. Once this was done I unmounted the old /home partition, which should no longer be busy.
umount /home
Now we’re ready to start removing volume-groups, logical volumes and other disk mappings I did this by executing the following commands:
lvremove bubba/storage
vgremove bubba
pvremove /dev/sda2
Once this was done I needed to change the partition type for the second partition from LVM to RAID. I did this by starting cfdisk, selecting the second partition and then chose types. The type needs to be changed from 8E to FD. After this I simply copied the partition table from /dev/sda to /dev/sdb using sfdisk using:
sfdisk -d /dev/sda | sfdisk /dev/sdb
With the partitions in place I created the raid-1 mirror array by issuing:
mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sda2 /dev/sdb2
In order to minimize the changes needed in the bubba configuration I simply created the same volume group and logical volume as before.
pvcreate /dev/md0
vgcreate bubba /dev/md0
In order to determine the size of the logical volume group I did
vgdisplay | grep 'Total PE'
In my case this value was 235797, so this gives us:
lvcreate -l 235797 -n storage bubba
I then created an ext3 file system by issuing the following command:
mkfs.ext3 /dev/mapper/bubba-storage
When this finnished, I was ready to mount the home partition back, but this time as a raid-1 mirror:
mount /home
Now I copied all file from /home2 back to /home
cp -a /home2/* /home/
I started nano again to edit /etc/passwd to change home2 back to home
nano -w /etc/passwd
Again, tried to ssh from a new terminal window in order to verify that it worked. Once I verified that it did, I issued a reboot just to see that it was all working. Which it did once the server was back on line. To check the state of the re-sync of the array I issued the following command:
cat /proc/mdstat
Now, it’s at 58.6% and will hopefully finish soon….
4 Responses to “bubba two and raid-1”
And? How did it turn out?
This looks really promising!
By J. on Jan 24, 2009
Well it turned out well. I have been running it for a few days now and it seems to work just fine.
However, the speed of copying files locally and over the network is not great. I have done some experimenting with copying files on the non-raided partitions as well but with the same results. So I guess it does not have anything to do with the raid mirror. I migrated my 500gig old disk using rsync with an average speed of 3MB/s ….
If anyone has any insights, suggestions or can simply confirm the results on a non-raided device please let me know.
By Patrik on Jan 24, 2009
Patrik,
Can you give me an update how the raid1 is working with the bubba 2?
I want raid1 as well (for safety not for backup)
Or should I buy an external raid1 drive??
puma
By puma on May 6, 2009
Hi Puma,
I am happy, it works great. Like I mentioned earlier the speed could be better, but I don’t know if it would be without raid.
Now when all is migrated and I am using the device mainly for storage and server for my SqueezeBox the speed is not that big of a problem anymore.
/Patrik
By Patrik on May 9, 2009