Moving /opt and/or /home to SD

If you want to start moving directories out of flash and onto the SD card, the easiest ones to move are /opt and /home.

Important

Before you start moving any directories from flash to SD, you should shut down the Opie interface, otherwise there's a good chance it will crash at some point.

Once you're finished moving directories, you can restart Opie with:

# /etc/init.d/opie start
    

Moving /opt and /home to SD requires nothing more than copying the directories to the mounted SD card, removing the originals, and creating a symlink from the old location:

# for d in opt home ; do
> cp -a /$d /mnt/card/$d
> rm -rf /$d
> ln -sf /mnt/card/$d /$d
> done
   

Tip

A good way to verify that the move was done correctly is to run the df command both before and after the move. You should see a decrease in space usage under the root filesystem, and an identical increase in usage under /mnt/card.