0

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.

Peterino
  • 395
  • 3
  • 7

1 Answers1

3

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.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • 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 05 '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 05 '10 at 10:33
  • Why? Aren't removable devices always (auto)mounted in `/media/`? What's wrong with it, can you explain? This leaves me `/mnt` free for manual mounts. – Peterino Nov 08 '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 09 '10 at 00:00