Failed to open stream
-
Server
- FOG Version: 1.3.5
- OS: Ubuntu 14.04 LTS
Client
- Service Version:
- OS:
Description
I have recently installed FOG and have it set up that the images are stored on an external drive.
My hosts boot to FOG and the capture proceeds to 100% but then fails when tries to write to the drive with the following error:I assume it has to do with permissions, but being new to this not sure exactly what to do with it.
Thanks, -
@isaac said in Failed to open stream:
set up that the images are stored on an external drive.
This may be your issue. FOG is not designed to do this.
But with this said, I can tell you how fog works. FOG uses nfs to upload captured images to the FOG server. The images are saved in /images/dev/<mac_address> then the pxe booting computer connects back to the FOG server using ftp to move the file pointers from /images/dev/<mac_name> to /images/<image_name>. The target computer connects back to the FOG server using the user name and password defined in the storage node configuration on the fog server.
If this was a typical fog server setup I would say the user ID and password defined for the fog server
fog
doesn’t match the linux user accountfog
defined in the OS. Don’t confuse the linux userfog
with the web gui administrator calledfog
too. They are different accounts used for different purposes. -
@george1421
That was the first place I went, and yes I just confirmed that the username and password in storage management matches the fog user account in the OS.I need to be able to store the images on an external drive because the Ubuntu OS that houses the FOG server is a VM inside WIN 7 and I did not leave enough room in the VM for more than one image. Is it worth it for me to pursue storing images externally? or is it impossible?
-
@isaac Is it possible, yes.
Tell me a bit more about this “external” drive. What is it and what hosts it?
-
@george1421
It is just a 2TB USB drive with lots of space for storing images. Formatted Ext4 and mounted. Completely empty. -
@isaac How is that connected to your VM?
From your fog server linux console can you post the results of this command
df -h
-
@george1421
Not sure what exactly you mean, I am using Virtual Box and any USB automatically gets picked up when plugged in. -
@isaac said in Failed to open stream:
Virtual Box and any USB automatically gets picked up when plugged in
Ah more bits of the puzzle are divulged.
Then lets start with the
df -h
command and thenshowmount -e 127.0.0.1
and finallylsblk
If you use putty to connect to your fog server you can copy and paste pretty easy. Or use a screen snipping tool to grab a picture of the console since you are using VB,
You have an interesting FOG server setup. I want to see if all of the bits are in place for this to work.
-
@george1421
Better quality in a minute. I am taking photos, because my host is offline right now. -
@isaac The
showmount
command will tell me more. I see what you are doing so far and we could make this work.as well as the output of
ls -la /media/fossie/FOG
that will show the structure of the images directory -
@george1421
Okay I will be back tomorrow, thank you!! -
Maybe I’m under thinking here, but is /media/fossie/FOG/images owned by the fog server’s FOG user?
It almost looks like it’s not and because of this it’s not allowed to move the data (hence the Permission Denied).
So maybe you can start with:
chown -R fog:root /media/fossie/FOG/images chmod -R 777 /media/fossie/FOG/images
-
@george1421
I did what Tom Elliott suggested to no avail, coming up with the same error after capture.
Besides the images folder is there any other place that needs fog permissions?
-
@george1421 said in Failed to open stream:
@isaac The
showmount
command will tell me more. I see what you are doing so far and we could make this work.as well as the output of
ls -la /media/fossie/FOG
that will show the structure of the images directoryHow about this info
edit: I did see in your post, but I need the whole command
showmount -e 127.0.0.1
-
@isaac Sorry I should have asked for one level deeper on the file structure.
ls -la /media/fossie/FOG/images
-
-
@isaac Excellent!
first thing I noticed is that the hidden file .mntcheck is missing from …/images I’ll also assume its missing from …/images/dev. You can fix by:
touch /media/fossie/FOG/images/.mntcheck
touch /media/fossie/FOG/images/dev/.mntcheck
Your nfs shares appear to be configured correctly setup.
The next thing I need a screen shot of is how your storage is configured for this fog server. It will be accessed by the web management gui.
-
@george1421
That is odd, it was in the dev folder but not in images. I created it. -
@isaac OK we are almost done with the checks.
On that web page. Down at the bottom. There is a user ID and a password. If you click on the little eye you can see what the password is and copy it out.
I want you to do this next part from a windows computer.
User FTP and connect to your fog server using the user account on the web page and password.once you get logged in then do a
cd /media/fossie/FOG/images
if you have a small file in the current directory on your windows server you can test the right permissions to …/images withput something.txt
If it uploads the file then that completes this part of the test.Lastly inspect the contents of the fog configuration file in
/opt/fog/.fogsettings
Make sure the user ID there and password matches the web interface also make sure the storage path matches the one where your files will be on the external drive.
If everything looks good run through the FOG installer one more time. The installer will correct any remaining settings that are not in line.
But from what I see your setup should be working. There is more testing we can do, but lets see if this gets you back on track.
-
@george1421
It worked! Captured Successfully.
It ended up being the permissions to the external drive, your post paved the way.
Thanks:)