My EEE PC is nearly a 900A, it was a bit crippled to be a super lower than low end Best Buy machine.
- Read about aligning filesystems to flash erase boundaries. I have no idea what my device's erase block size is, but surely it is a power of two and less than 128k, so I will use 128k. I can conceive of a test I could write to establish this, but will not do it. Go read Aligning filesystems to an SSD’s erase block size | Thoughts by Ted to learn what I know.
- For some silly reason, my internal drive is sdb and my SD reader is sda. Keep that in mind, don't trash your system if yours is different.
- Per Ted's thoughts (see above) I did an fdisk -H 224 -S 56 /dev/sda and then created three partitions. A /boot at the front, this will be ext3 for grub's sake, a single track partition 4 typed as 0xef for the BIOS quick boot, and the rest in the middle as my nilfs2 root. (I am willing to believe that this is a bad idea and that the GC of nilfs2 might be happier if I put my log files and such in a different place from my static files, but oh well.)
- mkfs -t nilfs2 /dev/sda2 is amusingly fast.
- Mount the new root on /mnt and the new boot on /mnt/boot
- debootstrap --arch i386 lenny /mnt YOUR-PACKAGE-SOURCE (find that from your /etc/apt/sources file) (I have to do this twice, the first time it complains that Packages.gz is corrupt.)
- chroot /mnt this moves you to the new system. I "touch" a file at the root to identify it so I can tell where I am later... touch /SDCARD
- exit to leave the chroot.
- cp /boot/*2.6.30 /mnt/boot/ -- you'll want your kernel
- cp -arv /lib/modules/2.6.30 /mnt/lib/modules/2.6.30 -- and it will want its modules.
- cp /etc/apt/sources.list /mnt/etc/apt/sources.list
- chroot /mnt
- aptitude update
- aptitude install locales (we need to fix that storm of locale errors pending)
- dpkg-reconfigure locales (I choose nothing.)
- aptitude full-upgrade
- aptitude install openssh-server
- aptitude install nilfs2-tools (sad, 100MB of crap to install this)
- aptitude install grub
- mkdir /boot/grub
- leave the chroot and get some config files
- cp /etc/network/interfaces /mnt/etc/network/
- cp /etc/hostname /mnt/etc/
- cp /etc/hosts /mnt/etc/
- reboot, catch the boot at grub and change to the new root
- grub-install /dev/sda (DANGER! This make break going back to the internal, since I used the internal grub to get here. Maybe manually make the /dev/sda* nodes so grub will work before the reboot?)
- Here goes... time to repeat in reverse to install on the internal flash.
- All is good. I am confused why my menu.lst file needs root to be (hd0,0) when I am on sdb, but I swapped the SD card for a blank one and I can still boot, so I'm not getting grub bits from there. Probably some BIOS stunt.
- Get the nilfs2-tools from squeeze, the one in lenny is too old to work.
- The kernel command line option root=UUID=xxxx or root-LABEL=xxxx don't work because they are not kernel options, they only look like it and are handled in some common initrd programs.
- It feels better than the old ext3 install. That is a terrible metric, I'll have to do something more rigorous when I get home.
- As installed it doesn't reclaim disk space, it just fills up. If I manually run the nilfs cleanerd then it does reclaim space. For some reason the one Debian starts doesn't work.
After 25000km of travel with the a nilfs2 root I have to say I like it a lot. Now to figure out why the Debian start of the cleanerd doesn't reclaim space.
anonymous comment, 5 weeks ago
Flash erase block sizes are typically 4MB or a near power of two these days - pretty large.
Newer, more advanced SSD controllers such as those on the Intel SSDs make this irrelevant by being intelligent about small writes, but with SSDs like those on the Eee PC, you are stuck with erasing and rewriting entire 4MB or so block for small writes. Hence why Flash writes are only high performing when writing 4MB or more.