Notes on making my EEE PC 900A have a nilfs2 root
My EEE PC is nearly a 900A, it was a bit crippled to be a super lower than low end Best Buy machine.
First I will create a nilfs2 rooted system on an SD card to verify the steps, then I will migrate that to the internal flash. I am running 2.6.30 with no init ramdisk. Most of the important bits are compiled in, some fringe stuff is a module.
- 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/sdaand 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/sda2is 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 /mntthis 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
exitto 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.
After several days of use I can add:
- 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.
I noticed the same problem with the nilfs_cleanerd. Upgrading (from source, in my case) to nilfs-utils 2.0.13 solved the problem for me.