Tag Archive for 'RAID'

Linux: Move / to Software RAID 1

It’s a simple thought: build a software RAID 1 disk array with an empty hard disk, and copy data on / to it. After data copied, add the old disk to the array.

For example,

(sda is the old /, and sdb is the new disk)
# sfdisk -d /dev/sda | sfdisk /dev/sdb
# mdadm -C /dev/md0 –level=raid1 –raid-devices=2 /dev/sdb1 missing
# mkfs -t ext3 /dev/md0
# mount /dev/md0 /mnt
# rsync -ax / /mnt/
# vim /etc/fstab
# vim /boot/grub/menu.lst

Modify fstab and menu.lst, and make sure all /dev/sda is changed to /dev/md0.

# reboot

Make sure that md0 is mounted successfully.

# mdadm –manage /dev/md0 –add /dev/sda1

Now, we successfully moved / to software RAID 1 :)

FreeBSD: vfs.read_max for Hardware RAID

Tested with: bonnie -s 2048, FreeBSD 7.0 UFS2 , Hardware RAID 5 (6 PATA 7200rpm 250G disks)
vfs.read_max=8 (default)

-------Sequential Output--------
-Per Char- --Block--- -Rewrite--
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU
2048 25812 24.8 26483 6.6 13886 4.4
---Sequential Input-- --Random--
-Per Char- --Block--- --Seeks---
K/sec %CPU K/sec %CPU /sec %CPU
32162 32.5 33386 5.1 232.3 1.5

vfs.read_mas=128

-------Sequential Output--------
-Per Char- --Block--- -Rewrite--
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU
2048 25380 24.3 25949 6.5 13956 4.3
---Sequential Input-- --Random--
-Per Char- --Block--- --Seeks---
K/sec %CPU K/sec %CPU /sec %CPU
41060 43.4 42839 8.3 224.9 1.4

vfs.read_max=256

-------Sequential Output--------
-Per Char- --Block--- -Rewrite--
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU
2048 25714 24.3 25939 6.5 13966 4.3
---Sequential Input-- --Random--
-Per Char- --Block--- --Seeks---
K/sec %CPU K/sec %CPU /sec %CPU
41442 43.8 43737 8.6 225.2 1.5

Conclusion: No performance gain on random access, but about 25% better sequential read performance.