NSLU2-Linux
view · edit · print · history

Making root's homedir persistent

The / directory of the ds101 and ds101g+ is in a ramdisk. Presumably to let the drive spin down properly. This also means that certain directories (like /bin, /dev/, etc.defaults) are lost when you power off or restart. The contents of the ramdisk are copied from /dev/hda4 on boot. So to make root's homedir "stick", do the following:

  1. mkdir /volume1/root
  2. mount /dev/hda4 /mnt
  3. cd /mnt
  4. mv root/.profile /volume1/root
  5. rmdir root
  6. ln -s /volume1/root root
  7. cd /
  8. umount /mnt
  9. reboot to verify that the change stuck


Alternate Method

The DS101's /dev/hda4 (not sure about g+) seems to be persistent across reboots initiated by reboot command or holding down the power button. Afterwards, even if the unit is unplugged it seems to be persistent. The ramdisk and dev/hda4 seem to be in sync always with the following exception:

When it is not shutdown cleanly (eg. you cut power on the DS101 while it is booted and running) then on subsequent restart it appears to "reset" the entire /dev/hda4 to a stock configuration (presumably from flash?).

This needs more verification - need others to test and provide feedback.

Instructions:

  1. mv /root /volume1/root
  2. ln -s /volume1/root root
  3. Add following lines at end of /opt/etc/rc.optware
    rm -rf /root
    ln -s /volume1/root /root
  4. reboot

The third way

mv /root /volume1/root

Edit /etc/passwd and change the following line from:

root:x:0:0:root:/root:/opt/bin/bash

to:

root:x:0:0:root:/volume1/root:/opt/bin/bash
view · edit · print · history · Last edited by eriktar.
Based on work by Doughboy.
Originally by repvik.
Page last modified on April 23, 2006, at 06:44 PM