NSLU2-Linux
view · edit · print · history

Disclaimer

Well, the usual – I take no responsibility for any data that you might loose due to following the guide, etc., etc., etc. My advice would be that you start by reading the guide all the way through and then decide if you are able to do what it says. The guide has only been tested on

  • ds101g+.

The default setup

By default when you attach a USB or eSATA disk you will get access to a new folder named something similar to "usbshare1". This only allows you to set "global" user/group permissions for the entire USB/eSATA disk, since you can only create subfolders of "usbshare1" on the disk.

The modified setup

The setup described below will allow you create folders on your USB/eSATA disk similarly to the way you do on your main disk – allowing different permissions for different folders on the disk

Requirements

You need to have a USB/eSATA disk attached to your DiskStation and you need to have shell access to the DiskStation(telnet/ssh access).

Creating a new folder on your USB/eSATA disk

For the sake of this example we will create a new folder named "movies" on your USB/eSATA disk.

If you want to move a folder that already exists on your main disk, to your new USB/eSATA disk you should refer to the section "Moving a folder to you USB/eSATA disk".

  1. Create an empty folder on your main disk named "movies" using the standard administrative web interface (port 5000) running on your DiskStation. This will, as you might know, create a folder on you DiskStation in "/volume1/movies".
  2. Access your DiskStation shell using either telnet or ssh.
  3. Figure out where your USB/eSATA disk has been mounted. Do this by typing ls /. This will present a list of folders in the root of your DiskStation. Your main disk is mounted in "volume1". Your USB/eSATA disk will be mounted in a folder named something like "volumeUSB1" – it should be obvious which it is. The rest of this example will assume "volumeUSB1".
  4. Create a folder named "movies" on your USB/eSATA disk by typing mkdir /volumeUSB1/movies.
  5. Mount the movies folder created on your USB/eSATA disk to the movies folder created on your main disk. Do this by typing mount -o bind /volumeUSB1/movies /volume1/movies.
  6. Test the setup by manually creating a folder directly on USB/eSATA disk. Do this by typing mkdir /volumeUSB1/movies/test. Now access the shared "movies" folder using your preferred method (e.g. Windows shared folder, ftp, etc) and verify that you can see the "test" folder inside the movies folder.
  7. If you could see the "test" folder simply remove it again by typing rmdir /volumeUSB1/movies/test. If you cannot see it, then you either didn’t perform all the steps above or the guide is broken :).
  8. To make sure that the movies folder on your USB/eSATA disk gets mounted automatically to the movies folder on your main disk during bootup you should add the following line to you "/etc/rc.local" file: [ -e /volumeUSB1/movies ] && mount -o bind /volumeUSB1/movies /volume1/movies. You can do this directly from the command line using the VI editor (i.e. vi /etc/rc.local). Alternatively you could copy the rc.local to one of the shared folders (i.e. cp /etc/rc.local /volume1/public), edit the "rc.local" file using your favorite text editor and copy the file back from the shared folder (e.g. cp /volume1/public/rc.local /etc/rc.local).
  9. To revert to the original situation, remove the binding with the umount command: umount /volume1/movies

Moving a folder to you USB/eSATA disk

For the sake of this example we will move an existing folder named "music" from your main disk to your USB/eSATA disk.

If this is the first time you try this part of the guide I would strongly advice that you do not start by trying to move a folder with all of you most important files.

  1. Access your DiskStation shell using either telnet or ssh.
  2. Figure out where your USB/eSATA disk has been mounted. Do this by typing ls /. This will present a list of folders in the root of your DiskStation. Your main disk is mounted in "volume1". Your USB/eSATA disk will be mounted in a folder named something like "volumeUSB1" – it should be obvious which it is. The rest of this example will assume "volumeUSB1".
  3. Create a folder named "music" on your USB/eSATA disk by typing mkdir /volumeUSB1/music.
  4. Move the contents of the music folder on you main disk to the music folder on your USB/eSATA disk. Do this by typing mv /volume1/music/* volumeUSB1/music.
  5. Mount the music folder created on your USB/eSATA disk to the (now empty) music folder on your main disk. Do this by typing mount -o bind /volumeUSB1/music /volume1/music.
  6. Test that the setup by manually creating a folder directly on USB/eSATA disk. Do this by typing mkdir /volumeUSB1/music/test. Now access the shared "music" folder using your preferred method (e.g. Windows shared folder, ftp, etc) and verify that you can see the "test" folder inside the music folder (You should also be able to see all of the old folders – if not you should start crying and read the Disclaimer again).
  7. If you could see the "test" folder simply remove it again by typing rmdir /volumeUSB1/music/test. If you cannot see it, then you either didn’t perform all the steps above or the guide is broken :).
  8. To make sure that the music folder on your USB/eSATA disk gets mounted automatically to the music folder on your main disk during bootup you should add the following line to you "/etc/rc.local" file: [ -e /volumeUSB1/music ] && mount -o bind /volumeUSB1/music /volume1/music. You can do this directly from the command line using the VI editor (i.e. vi /etc/rc.local). Alternatively you could copy the rc.local to one of the shared folders (i.e. cp /etc/rc.local /volume1/public), edit the "rc.local" file using your favorite text editor and copy the file back from the shared folder (e.g. cp /volume1/public/rc.local /etc/rc.local).
  9. To revert to the original situation, remove the binding with the umount command: umount /volume1/music
view · edit · print · history · Last edited by pem.
Based on work by loys and Morten Nielsen.
Originally by Morten Nielsen.
Page last modified on April 18, 2008, at 08:04 AM