2

I just bought a Raspberry Pi and want to start using it as a NAS.  I'm fairly new to this, but I've gotten this far.

I've got an external hard drive (freshly formatted NTFS) connected with a USB cable to my Raspberry Pi and am connected through SSH terminal (I don’t have an external display to use). Every time my Pi reboots, I have to remount the drive in order to use it.  I added this line to /etc/fstab file:

/dev/sda1 /media/NAS ntfs-3g defaults 0 0 

For as far as I understand, that’s all I need to make my Raspberry Pi auto mount my USB hard drive as soon as it reboots.

What am I doing wrong?

1
  • Does running mount /media/NAS manually work? What distribution are you using? Commented May 25, 2015 at 14:39

1 Answer 1

0

There are a few things you should try. First is to change the last 0 on that line to 1 or 2 as you only want this mounted once your root file system (which normally is at level 0) has been mounted, as that is probably where /media/NAS is located.

Then you might also need to remove the -3g IIRC, that was dropped from ntfs a couple of years ago after the third generation became the "standard' version.

/dev/sda1 /media/NAS ntfs auto,defaults 0 2 
6
  • Hi,I tried it with changing the last 0 to 1 or 2, but no avail, I removed the -3 behind NTFS, but that didn't automount it either. I'm at work now and I think my hard drive is turned off, so I'm gonna have to try it out when I'm back at home. (thanks for the quick response) Commented May 25, 2015 at 14:43
  • @Dutchman I had the chance to try this out remotely on a friends Banana Pi, (running a Debian derivative, he lives 550km away and had bought a 6Tb external drive). After that I realise I did not remove the noauto, option but changed it to auto for him. Which I thought would be included in the default, but you can try to add it explicitly (as I did). If that doesn't work: Q1) does mount /media/NAS work? or do you mount differently. And Q2) what distribution are you running on your raspberry pi? Commented May 25, 2015 at 15:53
  • OTOH defaults should include auto Commented May 25, 2015 at 15:54
  • I couldn't get it to work using the fstab file, so I ended up writing a mount script sudo mount UUID=44C0BAFAC0BAF172 /data, and referenced to it in the /etc/rc.local file. Once rebooted I was able to access the drive immediately. Q1 I usually mount with sudo mount /dev/sdaX /folder-to-mount-in or sudo mount -a. Q2 Raspbian Commented May 27, 2015 at 0:49
  • @Dutchman does that mean you never tested just using mount /media/NAS? Maybe your /dev/sda1 is not that drive, or your usb module is not loaded at that point yet. You can use UUID as with UUID=44C0BAFAC0BAF172 /data ntfs defaults 0 2 in the /etc/fstab as well. Commented May 27, 2015 at 1:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.