SMB setup for external storage
-
I’ve search the forums and can’t find any article that list specific steps for creating a SMB share and mounting it.
I tried using NFS. However, our external storage is a Buffalo Terastation. From the forums, I found out that NFS doesn’t work with this device. I read suggestions for setting up SMB connection to the external storage. However, there are not a lot of specific articles that say how.
I’m also running CentOS 6.5 with Fog version 1.2.0 on a Proxmox VM.
Here is what I have pieced together so far.
Prior to installing FOG, do this:
- I setup a share on the Terastation called images. I assigned no file restrictions to it.
- I created a password file called secret.txt in /root. I put in it:
username=fog
password=(my local fog user in linux password) - mkdir /images
- sudo chmod -R 777 images
- chown -R fog.root /images
- vi /etc/fstab
I added the following line:
//x.x.x.x/images /images cifs credentials=/root/secret.txt,noperm,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0 - I installed fog
- The home screen shows the full storage of my remote storage device.
- I create an image in Image configuration
- I registered a host computer
- I assigned the image for upload
- I booted up the host and I receive the following error message:
mounting x.x.x.x:/images/dev on /images failed: permission denied
Checking Mounted File System
An error has been detected.
Fatal error: Failed to mount NFS Volume
Computer will reboot in 1 minute.
If I open the share in Windows explorer and attempt and on CentOS - I can see the directory structure. If I create a folder or file, I can see those folders and files appear in the Windows share. So, I believe I have the file permissions correct.
I also saw an article that you needed to create the .mntcheck file. I see this file in the dev directory already with 777 access for everyone. I read somewhere else that this file needs to exist in the /images directory as well. So, I copied the file from /images/dev to /images
So, why is Fog not able to connect and create the image?
Any help would be greatly appreciated!
-
The imaging client script fog.checkin (src/buildroot/package/fog/scripts/bin/fog.checkin) mounts the NFS share. That’s why there is no reference to the NFS share in /etc/fstab on the imaging client.
If you want to experiment with that, you will need to edit your init.xz to connect to samba instead.
[By the way, I want to do this later on an official basis.]
-
@cmcleod
Hi,You can setup your Terastation with a NFS share instead cifs, and declare it as a second node in your Storage Group.
You must configure your share for NFS and FTP on your NAS for the user fog. -
@ch3i
Initially I tried the NFS route with the Terastation. When I added it to the Storage Group as a second node, fog just showed an error on the Home page for that storage device.I then mounted the NFS share within CentOS and pointed fog to the local mount point. Fog saw the additional storage with no problem. However, when I tried to upload the image, I received the same error I stated in my original post that I was receiving now with CIFS.
-
What are you trying to do? Access the images from windows? What is your intention?
-
No, the Buffalo Terastation supports NFS. However, you can’t change the owner of the /images folder or change settings at all for fog to access it. I’ve changed the UID for CentOS and for the terastation on the fog user. I still can’t access it.
I’ve researched it and others say they are having the same problem with this device. I saw recommendations to set the mount point within the /images folder for SMB and that will work. However, I’ve tried everything and it’s not working. The space updates within FOG for available space but I receive the error in my original post when trying to image to it.
My goal is just to be able to use my NAS device as external storage.
-
Do you have SSH access to the terastation? Don’t those run Linux ?
-
SSH does work… However, every user I have created can’t login. They didn’t provide the credentials for the root account.
-
Oh… something simple…
Maybe make sure the .mntcheck files exist inside your terastation’s /images and /images/dev directories?
.mntcheck are hidden files.
I doubt that this will fix it, but these files are necessary and I didn’t see anything in your steps above about it…
This is what I use for connecting remotely to my FOG’s NFS at home on Fedora 21, this should be interchangeable with CentOS because they are both Red-Hat based.
[CODE]//10.0.0.3/images /home/wayne/linuxshare cifs username=UserNameGoesHere,password=PasswordGoesHere,noperm,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0[/CODE]
I noticed you are using credentials= and I’m not sure if that’s correct… Try the above line and see what happens…
Oh and also - FOG does not support imaging via SMB… nope. Not yet anyways. See, it doesn’t matter what changes you make to the actual FOG server… When the clients download their boot files and load up, they are programmed to mount via NFS. I’d recommend trying your very best to get SSH to that device and PUT nfs on it!
And, as a last ditch thing, just run your NFS exports on the FOG server itself like many others do, and just regularly backup all your images to your terastation.
-
@cmcleod said:
@ch3i
Initially I tried the NFS route with the Terastation. When I added it to the Storage Group as a second node, fog just showed an error on the Home page for that storage device.I then mounted the NFS share within CentOS and pointed fog to the local mount point. Fog saw the additional storage with no problem. However, when I tried to upload the image, I received the same error I stated in my original post that I was receiving now with CIFS.
Wich is the mount point of your NFS share in your NAS? I think is not xxx.xxx.xxx.xxx:/images.
For example a ReadyNAS : the NFS share is >> xxx.xxx.xxx.xxx:/c/media/your_share/ (your_share can be images…)
-
perhaps… just perhaps…
Run the download in “debug” mode,
mount the SMB share manually at the CLI, and start the imaging process? (do not use the “fog” command, it tries to mount via NFS).
You’d have to dive into what the “Fog” command actually does… find it’s file and examine what is in it…
And just do everything in there except the NFS stuff (because you already mounted via SMB, right?) and cross your fingers and see if it works?
The "Troubleshoot NFS " article MIGHT assist you with some of this…
https://wiki.fogproject.org/wiki/index.php/Troubleshoot_NFSAnd the ill-completed Fedora 21 Server article has examples of SMB mounting…
https://wiki.fogproject.org/wiki/index.php/Fedora_21_Serverand, if you can figure out the commands to issue… and it works… then modify the “fog” command so that it does those things every time, then it should work for normal image downloads?
You’d have to modify the upload processes too.
I’d totally absolutely try this like right now but my servers are down due to a dead AC adapter for my router
-
Also, it’s not necessary to use /etc/fstab to mount things… It can be done directly from the CLI.
-
I had that error the other day when trying to image from my USB connected External Drive. Issue was the exports file. Might be worth looking at.
-
Ok, I’ll go back to my original NFS configuration and maybe I’m doing something wrong and you guys will be able to pick up on it.
On the Terastation - I have enabled NFS. I assigned the fog server as a client on nfs via it’s IP address. I’ve created a fog user with it’s UID set to match the UID of the fog user on the fog server - 1001. The NFS mount point on the terastation is //mnt/array1/images
First, I logged into fog and tried to mount the storage server through NFS.
Name: Terastation
IP: 192.168.142.176
Max clients:10
Storage Group: default
Image path: /mnt/array1/images – path specified on the NAS
Interface: eth0
Username: fog user and same password as on the NAS
I add it and then I go to the home screen. I click under Disk info to change to Terastation. The response: No error, but no data was return. So, my guess is that means it didn’t work.On the fog server, I ran the following commands:
- mkdir /mnt/nfs/images
- mount 192.168.142.176:/mnt/array1/images /mnt/nfs/images
- mount - shows that it was mounted successfully. However, there is no rw after the mount. Does that mean it is not read/write?
- vi /etc/fstab
- line added:
192.168.142.176:/mnt/array1/images /mnt/nfs/images nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0 - mkdir /mnt/nfs/images/dev
- touch /mnt/nfs/images/.mntcheck
- touch /mnt/nfs/images/dev/.mntcheck
- reboot now
- confirm the mount point was successful - output of the mount command is:
192.168.142.176:/mnt/array1/images on /mnt/nfs/images type nfs (rw,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800,addr=192.168.142.176) - ls -alh /mnt/nfs/images - the .mntcheck file is there with the following permissions:
-rwxrw-rw- fog:52
/dev - drwxrwxrwx fog:52
/images/dev/.mntcheck - same permissions as the other file
**so I’m not sure if those permissions are correct or not - I login to fog. I go back to the Terastation storage I created earlier. This time I create a storage group called Terastation and change the storage node for terastation’s IP to the fog server. I change the Image path to: /mnt/nfs/images
- I go back to the Home screen and change to terastation and I can now see the space available on the Terastation.
- I go to Images and create an image:
Name: Win7-64-Pre-Sysprep
Storage Group: terastation
OS: Windows 7
Image Path: /images/Win764PreSysprep
Image Type: Multiple Partition Image - all Disks (Not Resizable)
I click Add - I boot up and register a host computer.
- I go to the hosts in fog and choose to upload for the computer to upload an image to fog.
I reboot the host and I get this error:
mounting 192.168.142.72:/mnt/nfs/images/dev on /images failed: Permission denied.
An error has been detected!
Fatal Error: Failed to mount NFS Volume
Computer will reboot in 1 minute.
Any ideas? Thanks so much for your help.
-
Update - When I went back into Image Management after it failed, there was an error:
FOGFTP: Login failed. Host: 192.168.142.72, Username: fog, Password: (my password), Error: ftp_login(): Login incorrrect. -
Sounds like a dirty install. If you reinstalled FOG, you will need to delete the fog user.
-
I tried deleting fog from the forum instructions and I deleted the fog user. I re-installed following the same specifications I listed earlier and I’m still receiving the same error message.
-
@cmcleod said:
ftp_login(): Login incorrrect
-
So, here is how I resolved this issue.
First, on the Terastation, NFS was setup incorrectly. It was running in User Mode and it needed to be running in Kernel Mode. After this was set, we could then go back into the Fog server and removed the Terastation node. We changed the settings for the DefaultMember to point to the Terastation. After doing this, we were still receiving FTP errors. However, we could see the mount point and the files within.
We fixed the FTP issues by going to Fog Configuration, Fog Settings, TFTP server and changing the Fog account password. Also, the Terastation was joined to our Windows domain. After some research, we found out that if it is joined to the domain, FTP will not work. After unjoining from the domain, FTP started working immediately.
The only issue, and this may not be able to be solved, is that when we go to the Home page of Fog and look at the Disk Information, it just reports “No error, but no data was return.”
If you run df -h in the terminal, you can see the data returned for the total space and free space available. Is there a way to have this show up for the NFS mount in Fog?Thanks so much for your help!
-
@cmcleod Fog uses FTP to determine disk usage. Is the ‘size’ (or relevant command) supported by the buffalo terastation?