Author Topic: How to Mount Buffalo Router NAS automatically, and manually, under UBUNTU linux for Backups.  (Read 13004 times)

don54321

  • Calf
  • *
  • Posts: 3

I was successful with the below technique with my WZH-HP series Router NAS using the alternate Buffalo Simple firmware (not DD-WRT which also came with the router)

I really do not understand what I am doing, but have found that the below operation works fine on several computers, and I will explain what I can. I borrowed from lots of posts to figure this out. Perhaps someone more knowledgeable can edit this down to the essential.

 

I do not know if all of these installs are necessary, but open synaptic and install, cifs-utilities, smf-utilities, smbfs, & samba, fuse-utilities and anything that jumps out at you mentioning the same cifs, smf, smb,. It should be not much more than a half dozen items or so. I wish I could be more specific. Some of above was already installed on my distro so I do not know if they are needed or not.  CIFS and SMBF appear to be the critical items

 

Your portable USB drive should have been formated as FAT or preferably XFS per the manual for it to work with the Buffalo unit. NTFS drives won't work. The FAT file system has a rather small maximum file size, so if you are copying videos or other large files, you have no choice but formatting to XFS. Formatting the USB hard disk can be done directly via the router's web interface, and I found that this works best. There is a selection to format the drive under the NAS settings using the standard Buffalo firmware. Also, I did not set up any users or permissions on the BuffaloNAS web page.  I am clueless how to do anything using the highly touted DD-WRT which also shipped with my router. I don't think that the DD-WRT that shipped with the router supports NAS functionality at all. 

 

Once these synaptic packages are installed, you should have no difficulty searching the “windows network” that the NAS created and find and browse your files using Nautilus (Gnome) or Dolphin (KDE).  Some other file browsers are less capable of browsing networks.  Once you are browsing using the file manager, you will notice that the NAS will identify the disk as“disk1_pt1” meaning disk 1, partition 1. If you have partitioned this drive, you will see a different designation.  The problem I am attempting to address, is that most linux backup programs can't address a samba, smb drive the way Naultilus & Dolphin file browser do. In order to backup to the NAS, you need to “mount” it. I don't understand why, but what needs to be done is to create a local directory on your filesystem which is linked to the NAS directory. If the commands execute correctly, browsing to the directory you created will actually show you the contents of the NAS. If you screw-up, then writing to this directory will actually be showing the contents of the local directory and not the NAS. It is really helpful to put something identifiable as USB contents on this USB drive to help you figure out what you are looking at. The below command creates a directory "BuffaloNAS in your media folder:


sudo mkdir /media/BuffaloNAS

 

BuffaloNAS is just the arbitrary name I chose for this directory. It could be anything, and it does not need to be in media. ( Equally well, you could put it in your home directory and name it MyNAS with: sudo mkdir /home/ MyNAS ) Other posts suggested using the chmod command to alter permissions, but this was not necessary for me, as I am the only user.  The following command will provide a manual (must be re-mounted each time you boot):

 

sudo mount -t cifs //192.168.11.1/disk1_pt1 /media/BuffaloNAS

 

Where: 192.168.11.1 is the default address for the Buffalo NAS. “disk1_pt1” is the NAS drive name assigned by the Buffalo NAS, and media/BuffaloNAS is the directory you are linking it to.  Be careful with manually mounting the NAS. It is not practical for automatic backup use. If you were to fail to remember to mount the drive before backup, you could accidentally copy your entire Backup into your local media folder, potentially filling up your local hard disk and otherwise creating a mess.  I personally use a rather small “/” partition with a separate much larger “home” partition and fell victim to this error.  Therefore I put my link in the much larger home directory above the user folders.  Better to get the NAS to mount automatically on boot up. To accomplish this, you need to edit the fstab file as root. Open your text editor as root by first opening a terminal and typing sudo gedit (gedit is my text editor. Use what comes with your distro)  The important thing is that the editor be opened with root permissions, which is the function of the sudo command.  Then edit your /etc/fstab file (you need root privileges) to add these lines:  (Lines beginning with pound don't execute and are comments)

 

# user added below line.

//192.168.11.1/disk1_pt1 /home/RemoteMedia/BuffaloNAS cifs guest,uid=1000,iocharset=utf8,codepage=cp850,cp850 0 0

 

(FYI  other non-Buffalo NAS types may require unicode therefore:  //192.168.11.1/disk1_pt1 /media/BuffaloNAS cifs guest,uid=1000,iocharset=utf8,codepage=unicode,unicode 0 0)

 

Copied much of below from the Ubuntu Wiki

Where the fields are : //servername/sharename /media/mountname cifs guest,uid=1000,iocharset=utf8,codepage=unicode,unicode 0 0:

  • guest indicates you don't need a password to access the share,

  • uid=1000 makes the Linux-user with specified uid or username owner of the mounted share, thereby allowing that user to rename files,

  • the combination iocharset=utf8,codepage=unicode,unicode allows access to files with names in non-English languages. This doesn't work with shares of devices like the Buffalo Tera Station, or Windows machines that export their shares using ISO8895-15. With these the codepage argument has to be codepage=cp850, otherwise characters like the German 'Umlaute' are displayed as garbage.

After you added the entry to /etc/fstab type:

sudo mount -a

This will (re)mount all entries in /etc/fstab


I hope that this helps,

Don


don54321

  • Calf
  • *
  • Posts: 3

This is an UPDATE to my earlier post.   Something changed in Ubuntu 12.10 / Mint 14 Nadia.  Manual mounting works as before.  The previously posted fstab entry no longer works.  The new fstab should be:

 

# Don added below line

//192.168.11.1/disk1_pt1  /home/RemoteMedia/BuffaloNAS cifs guest,uid=1000 0 0

 

This mounts disk 1_pt1 (displayed as BuffaloNAS) in a folder "RemoteMedia" I created in advance in the home directory.  (Do not create BuffaloNAS, only RemoteMedia)  Please note, that this is in the home directory above the "User Don home"  (obviously I am Don) This is where I like putting the mounted directory, out of the way of accidental actions.  Getting into this home area above user may require sudo priviledges to create the directory and view the contents.  (You will probably need to open you file browser with the sudo command, ie. sudo nautilus, or sudo caja to navigate to this spot.  When you create a folder under sudo, you will need to right click the file, enter permissions, and change the permissions to allow non-root access.  Just make the owner "yourself" instead of root.

 

A more fool proof entry might be: 

//192.168.11.1/disk1_pt1  /home/Don/RemoteMedia/BuffaloNAS cifs guest,uid=1000 0 0     

as this is a more easily accessed part of the file system without worrying about permissions (I think).

 

Don

 

Be sure that cif-utilities package has been installed.  I also think that you need fuse.


don54321

  • Calf
  • *
  • Posts: 3

Update to my Update ---  The Buffalo NASs I used are both WZR series routers with USB storage.  In each case, I downgraded to the USER FRIENDLY FIRMWARE from the dd-wrt.  The first time I did this was because my older WZR router did not support USB storage on dd-wrt.  This recent time, I discovered that the new WZR-300HP does indeed support the USB NAS STORAGE.  MY USB HD however is formatted with the XFS filesystem, which was not recognized under dd-wrt.  Since the NAS has been so robust under the friendly software, I chose to just load the friendly firmware again.  With the latest Linux Mint, probably the only thing that you need to do is

 

1)install cifs-utilities 

 

2) add the line

//192.168.11.1/disk1_pt1  /home/RemoteMedia/BuffaloNAS cifs guest,uid=1000 0 0

to /etc/fstab

 

3) create the place where the NAS mounts as defined in the fstab line above.  My example requires the creation of the RemoteMedia folder in home.  BuffaloNAS is not a folder or file you create.

 

Create the folder (or directory what ever you call it) RemoteMedia in home next to your "user folder (in my case "don") (you will need to do this as root or sudo most likely opening your file manger from the terminal with sudo nautilus or similar command, and arrow up from your user home)  You then might need to change the permissions to allow you to get at it without root priviledges later.  If this proves too much for you, put the folder someplace easier and modify the fstab accordingly.

 

Reboot the computer and the Buffalo NAS should be where you put it.  A beautiful thing!!!!   I then use Lucky Backup to back up my data nightly.  Works great for my 3 computers.