close

[轉載請註明出處] http://kezeodsnx.pixnet.net/blog

作者: kezeodsnx

 

MD

LVM

Target

Software RAID

Volume management

Feature

Raid fault tolerance

Logical volume, dynamic expand, data migrating for broken disk, snapshot

適用

需要performance (Raid0)

需要data security (Raid1以上)

File sharing (strip mode), cache server (squid)

Partition per device

1

n

Effort

Medium

High

similarity

  1. 對使用者來說是一顆硬碟

  2. Lvm linear mode like JBOD

之前有玩了一下MD/LVM的東西,是在EPC 901上。901上有兩顆SSD,當時的SSD很貴又很小,901預載的SSD是所謂的4+8G,第一顆4G是拿來裝應用程式的,第二顆對使用者來說才是可用的,因此就很想把第一顆沒用完的部份拿來使用,過程記錄如下:

1. 下載mdadm,但要build成static,因為這是在initramfs.img裡會用到。另外一個地方就是xandros的installation CD也會用到。( <!-- @page { size: 21cm 29.7cm; margin: 2cm } P { margin-bottom: 0.21cm } --Uncomment LDFLAGS = -static in Makefile)

2. installation CD:複製所有CD內容,把mdadm放到boot/initrd.gz,再重新包裝成iso檔

3. 換kernel: 需把md相關的module build進去

md-kernel

4. initrd.gz:

gunzip initrd.gz
mount –oloop initrd /tmp/mp1
Copy mdadm static binary to bin
Create device node md0
mknod dev/md0 b 9 0

edit etc/init.d/rcS
Fdisk
  Create partition
  Change partition id (fd for raid)
  Create raid0
  mdadm –C /dev/md0 –l0 –n2 /dev/sda2 /dev/sdb1
Format md0
  chroot /mnt mkfs.ext3 /dev/md0 > /dev/null

5. P701L.gz:

gunzip P701L.gz
mount –oloop,offset=32256 P701L /tmp/mp2
compress/decompress boot/initramfs.img
gunzip –dc initramfs.img| cpio –idm
Find . | cpio –H newc –o | gzip -9 >initramfs.img
Copy mdadm static binary to bin
Create device node md0, sdb, sdb1
mknod dev/md0 b 9 0
mknod dev/sdb b 8 16
mknod dev/sdb1 b 8 17
Edit init in initramfs.img
Assemble raid0
mdadm –A /dev/mdo /dev/sda2 /dev/sdb1
mount  /dev/md0 to /mnt-user instead of /dev/sda2
Replace with md-kernel
Edit boot/grub/menu.lst to use new kernel

6. 重包iso檔:

under your cd content folder
mkisofs –J –R –r –v LABEL_OF_CD –c boot/boot.cat –b boot/isolinux/isolinux.bin –o /tmp/md.iso –no-emul-boot –boot-load-size 4 –boot-info-table .

之後再燒進去就ok啦!

結果如下:

aspire-md

小結

測了一下throughput,MD過後是提升的,原因是因為第一顆是SLC,第二顆是MLC,而SLC比MLC快多了!然而,在boot,shutdown及program launch time的表現都比較差一點。

What does aspire one do?

mount –t aufs –o create=mfs, dirs=/tmp/usb1=rw:/tmp/usb2/=rw none /tmp/usb3

 

arrow
arrow
    全站熱搜

    kezeodsnx 發表在 痞客邦 留言(0) 人氣()