I have a plug computer with 512MB internal storage (NAND) and a SD card slot with an 8GB SD card, currently. The plug computer runs Ubuntu 9.04 (Jaunty), and I plan to use it mainly as a webserver.

As I have limited storage internally I want to move all directories potentially growing in size to the SD card (e.g. /var, /srv, /opt). But is it possible to mount more than one directory onto the SD card?

What could a solution look like that doesn't play tricks with symlinks? Do I have to split the SD card into several partitions and mount them separately? Would be nice to know whether there is a solution that allows me to have a single, continuous place of storage.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

A bind mount allows you to mount a directory somewhere else in the file structure.

mount --bind /var/volumes/srv /srv

See the mount(8) man page for more details.

link|improve this answer
Thanks! That helped. – Peterino Nov 5 '10 at 10:26
1  
That's what my /etc/fstab looks like for mounting the SD card and binding some directories to it: /dev/mmcblk0p1 /media/sdcard auto defaults 0 0 /media/sdcard/opt /opt none bind /media/sdcard/srv /srv none bind – Peterino Nov 5 '10 at 10:32
Glad to hear that it helped, but /media would be the wrong place. Put it under /mnt instead. – Ignacio Vazquez-Abrams Nov 5 '10 at 10:33
Why? Aren't removable devices always (auto)mounted in /media/<volume_name>? What's wrong with it, can you explain? This leaves me /mnt free for manual mounts. – Peterino Nov 8 '10 at 23:52
Indeed, /media is intended for automounts. However, you're putting system volumes on the card, therefore it's inappropriate to consider it an automount. – Ignacio Vazquez-Abrams Nov 9 '10 at 0:00
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.