Jim's Depository

this code is not yet written
 

Mount CD. Build and load squashfs module
Mount nix-store.squashfs (Lemma: uncompress, uncpio initrd, learn that init is nix/store/*-stage-1-init.sh. This is all about boot parameters, modules, mounting filesystems, and such then leaps to the *-system/init in the main nix-store.)

Make nix-installer dir add dev proc sys etc add nix/store mount nix-store.squashfs on nix/store

oops, “upstart” requires its PID be 1. I can’t chroot the installer, it will have to be containered as well.

mount -t tmpfs tmpfs /machines/nixos-installer cd /machines/nixos-installer mkdir -p dev dev/pts proc sys etc nix/store sbin mount -o loop /media/nixos/nix-store.squashfs nix/store/ cd sbin ln -s ../nix/store/*system/init init

Hmm, maybe it is the graphical installer causing trouble, try the minimal ISO

Need to mknod console,null,zero,tty,and tty{0-4} Drops to an emergency shell mailing to remount /nix/store

nixos-option -i   # make configt file edit /mnt/etc/configuration.nix: (kill grub and modules)

… and how to fix for Debian x86 users…

Anyone with a Western Digital Green Power drive should immediately check the Load_Cycle_Count in their S.M.A.R.T. data. This is the number of head parks. The drives are rated for 300000 over their lifetime, but the firmware parks the head after 8 seconds of idle time. If your computer wakes it up regularly you could wear out in a matter of weeks. Don’t panic a lot if yours is high. Mine drives varied from 30k to 1.5M before I figured this all out and stopped them from parking.

I know this because one of my rather new WD10EADS drives crapped out, causing a fairly unpleasant interruption in my mirrored root partition.

You can not use the standard ATA mechanisms for tuning drives to adjust this parameter.

There is a utility from Western Digital that you can use to change the timeout from 8 seconds to 300 seconds, which is probably enough to keep it from parking the head. Now, if you could run this on any operating system sold this millennium it would be pretty handy. Sadly, it runs only under DOS.

I’ve fixed the drives in three different computers, (and failed on three other drives), and it is an ugly process.

For people running Debian servers, these instructions will guide you through making a USB flash drive to boot DOS and run the WD utility.

  • Go to wdidle3, download the zip and unpack it to get the .exe.
  • Get a flash drive. I used a 256M one.
  • Put a MBR on it. Install syslinux-common, then dd /usr/lib/syslinux/mbr.bin onto the first block of your device.
  • Download a bootable image of freedos, perhaps this one: balder10.img
  • Boot a fake dos machine to format the usb key…
    qemu -boot a -fda balder10.img -hda /dev/sdX -k en-us
  • Use fdisk to make a single partition on the device. Then use format, and finally sys c:
  • Quit qemu, mount the /dev/sdX1 partition somewhere and copy the wdidle3.exe program on there too.
  • Now the ugly part comes up: Your BIOS is not your friend here. You will need to turn your SATA controllers to Legacy IDE mode. You will need to force your USB device to be handled as a hard disk, not a floppy. And of course make it boot off the USB.
  • wdidle3 /s300
  • wdidle3 /r
  • Dance, you deserve it.
  • Now remember to undo all the damage you wrought on your BIOS before you boot back to Debian.

Now, where you will fail is where you have a drive in a USB sled. Even my fancy USB sleds with S.M.A.R.T. support won’t let the drives be fixed. I suppose I need to take all that gear apart and temporarily rotate the drives through a server to repair them.