A Fanless Mini-ITX Barebone
| This tutorial shows how to setup a wonderful quiet fanless system. The system that has been bought is a LEX NEO, a terribly nice Mini-ITX fanless barebone which includes an onboard bootable CF-card slot. Philip Iezzi (iezzi.ch) and Thomas Bocek (nope.ch) have set up the system with several configurations. | | Autor: pipo, tom - Date: 08.27.2005 - Size: 9708 chars - Hits / Day: 0.29 - Total Hits: 3806 | Introduction
 Lex NEOThe idea is to have a system with as few moving parts as possible. Moving parts in PCs cause noise and we wanted to reduce the noise. Thus, our objectives are:
- The harddisk should only run when used (harddisk is still necessary, because flash storage is not available for storing 100 GB)
- The whole system should be stored on a CF-card, while the data remains on the harddisk
- We don't want to stress our CF-card. Directories with a lot of access like /var/log should be run in RAM, because flash storage "wears out" during a write operation. (http://en.wikipedia.org/wiki/Flash_memory, http://www.sandisk.com/pdf/oem/WPaperWearLevelv1.0.pdf)
Installation  Lex Neo - BacksideWe decided to install Debian Linux by USB-install, using a USB-stick instead of running some PXE network install which seems to be far more complicated. Here's a short HOWTO. For more detailed instructions, please check Debian USB memory stick booting (http://www.debian.org/releases/stable/i386/ch04s04.html.en). Download boot.img.gz (7.9 MB). Also, download the official netinst image (108 MB). If you can't find it, check http://www.debian.org/CD/netinst/ and download the stable i386 version.
Now, prepare the USB-stick:
$> gunzip boot.img.gz $> dd if=boot.img of=/dev/sda $> mount -t vfat /dev/sda /mnt/ $> cp debian-31r0a-i386-netinst.iso /mnt/ Boot from your USB-stick and install Debian Linux on your CF-card. If it won't recognize your CF-card, you might want to disable DMA ("ide=nodma" as boot parameter).
The Motherboard of the LEX NEO is a CV860A ( www.lex.com.tw:8080/product/spec/CV860A.doc). However, the motherboard seems to have problems with some CF cards. We have tested a few CF cards.
| Type | Works | Restrictions |
| SanDisk Ultra II 1GB | Yes | Works only with flag "ide=nodma" |
| SanDisk CF Extreme III 1GB | No | Does not work at all, hangs at boottime |
| Apacer PSPII 1 GB | Yes | Works only with flag "ide=nodma" |
| Canon CF 8 MB | Yes | - |
| SanDisk CF 128 MB | Yes | - |
The oldest CF cards worked best in our test. Make sure before you buy a CF card that the CF card works with your system! As soon as your system is set up, configure it to run directories with a lot of write-access completely in RAM. Let's create /sbin/preinit that will be called before /sbin/init:
#!/bin/bash
echo "creating tmpfs in /var/log" mount -n -t tmpfs tmpfs /var/log echo "copy /var/log" cp -a /var/log_persistent/* /var/log echo "set dma on for hdd" hdparm -d1 /dev/hdd hdparm -B0 -S18 /dev/hdd echo "done, resume normal operations..." exec /sbin/init
 Lex NEO - InsideThis will copy all data from /var/log_persistent to /var/log which is located in RAM as tmpfs on boot-up. Also, it sets the harddrive's APM to extremely aggressive (-B0) and standby/spindown timeout to 1:30 minutes (-S18). We have disabled the DMA mode due to the CF card DMA problem for all devices mentioned before but the device hdd should work in DMA mode, because with DMA, the CPU will not be bothered and can be used for other things. The option (-d1) enables DMA.
Make sure, this runs before the default init.d scripts. We managed this by specifying the init parameter in GRUB, /boot/grub/menu.lst:
title Debian GNU/Linux, kernel 2.6.8-2-386 root (hd0,0) kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hdc1 ro init=/sbin/preinit ide=nodma initrd /boot/initrd.img-2.6.8-2-386 savedefault boot Next, set up /etc/fstab. Note that a couple of directories are mounted with tmpfs. It is also possible set the initial size of the temp files ystem with the option "size=xy" (for example size=16m):
proc /proc proc defaults 0 0 /dev/hdc1 / ext2 defaults,errors=remount-ro 0 1 /dev/hdd1 /myharddisk ext3 defaults,errors=remount-ro 0 1 tmpfs /var/run tmpfs defaults 0 0 tmpfs /var/lock tmpfs defaults 0 0 tmpfs /var/log tmpfs defaults 0 0 tmpfs /tmp tmpfs defaults 0 0 /dev/hdc represents the CF-card on Secondary Master, /dev/hdd is the harddisk on Secondary Slave. As you see, we're now running the following directories in RAM: /var/log, /var/run, /var/lock, /var/log, /tmp. All we need to do now, is synchronizing back the /var/log data to our CF-card every hour and on a shutdown in /etc/cron.hourly/backup-var resp. /etc/init.d/commit:
#!/bin/bash rsync -ax --delete --temp-dir=/tmp /var/log/* /var/log_persistent
#!/bin/sh
case "$1" in start) echo -n "n/a" echo "." ;; stop) echo -n "Comitting changes and backup" /etc/cron.hourly/backup-var echo "." ;; restart) echo -n "n/a" echo "." ;; reload|force-reload) echo -n "n/a" echo "." ;; *) echo "Usage: /etc/init.d/commit start|stop|restart|reload|force-reload" exit 1 ;; esac exit 0 (This script is not executed at the time when all daemons have stopped logging, so it is possible that some data are lost at shutdown. A good idea is to run the script just before unmountig the device.)
Add the commit script to all necessary runlevels:
$> cd /etc/init.d $> update-rc.d commit defaults Installation - Filesystems We have set up different file systems. The FS, we have tested, are Cramfs, JFFS2 and ext2. Due to the fact that flash storages wears out we have focused on limiting the writing to the flash card. The first test we made was with the Cramfs, which is a compressed read-only file system.
| Read Only
| Read / Write
| Compressed
| | Cramfs | + | - | + | | JFFS2 | - | + | + | | ext2 | - | + | - |
 Lex Neo - Inside 2 We had the system with cramfs for a couple of month in production, but the update of the system always required a reboot. To be more precise, a reboot could have been omitted, but only with an additional effort (mount, changeroot, sync, update, resync, changeroot, ...). JFFS2 did not work with apt (http://www.handhelds.org/hypermail/intimate/0/0028.html), due to jffs2 does not support shared writable mmap, so no quick update was possible. However, having a 1GB flashcard, no compression is necessary, because our system with almost everything needs only 350MB. We have chosen not to use a journaling FS, because we want to limit the write operations.
Other compressed read-only files systems such as cloop, squashfs or zisof have not been tested. Further comparisons can be found at http://kerneltrap.org/files/PERFORMANCE.README.txt. That's it! Enjoy your slick silent baby!
| Bemerkungen, Kommentare und Feedback  | | Beiträge: 1 | 12.09.2005 22:17 |
|
Du kannst auch selber einen Thread starten, indem du hier klickst. |
| Home
| Artikel / Tipps und Tricks | | Artikel Navigation | |
|
|