Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Raspberry Pi running raspian. I've installed Apache2, PHP & MySQL. Apache & MySQL are both configured to use sub-directories of /var. I'd like to use a directory on my USB HDD instead of my SD card.

I'd also like to move the /home directory to the USB HDD.

I'd like to avoid re-partioning my HDD if possible. I thought maybe I could use a symlink to tell raspian that /var is really at /media/USBHDD1/var and /home is really at /media/USBHDD1/home. I tried it last night but couldn't get it to work.

share|improve this question
You should be able to move the home directories to the flash drive and then mount the drive to /home in fstab. So your fstab would look like: /dev/sdX# /home ext4 defaults 0 0 (replace X# with your device id/partition num and defaults with your preferred). That would be automatic each boot. – nerdwaller Jun 29 '13 at 2:54
That looks like it needs a separate partition. I was hoping to avoid that. – doni49 Jun 29 '13 at 3:51
Not sure why you say that, you could mount the whole disc there. And if it supports the formatting, you really shouldn't have much trouble. When I get home later - if I remember I will try to set that up - because there is no real reason why it shouldn't work. – nerdwaller Jun 29 '13 at 22:40
Right now, I have something like the following in. Y fstab (typed from memory): /dev/sda1 /media/USBHDD1 auto defaults 0 0 I'd like to avoid creating a new partition if I can do so. I'd like to mount /media/USBHDD1/home as /home. – doni49 Jun 30 '13 at 4:11
Sorry, I misunderstood. You need a block device, so a partition or full drive. If you do the whole drive mounted, you could accomplish the goal with symlinks to get the specifics. – nerdwaller Jun 30 '13 at 4:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.