Adding storage - failed to open stream: no such file or directory
-
Ubuntu 20.04.6 LTS Workstation
FOG 1.5.9I need help sorting an error of an image capture to a recently added local storage node
First I’ll explain that I don’t have a lot of linux knowledge. I installed this a couple of years ago and just by keeping everything updated including kernel, it has been good so far. I have been trying to add a second storage with no luck. I’ve read post of people having similar problems and done the following:
-
Followed the tutorial by @george1421 here: https://forums.fogproject.org/topic/10450/adding-additional-image-storage-space-to-fog-server.
-
I get an error when trying to capture to the new created storage node: File: /user/www/fog/lib/fog/fogftp.class.php, Line 709, Message: ftp_put(/images2/dev/f4ee08d9234b): Failed to open stream: No such file or directory, Host 192.168.1.10, Username: fogproject
-
Changed the permissions to the /images2, subfolders and files allowing everything I could.
fogger@fog-ESPRIMO-E900:~$ ls -l /images2
total 12
drwxrwxrwx 3 fogproject root 4096 feb 22 04:55 dev
drwxrwxrwx 2 fogproject root 4096 feb 20 12:12 postdownloadscriptsfogger@fog-ESPRIMO-E900:~$ ls -l /images2/dev
total 4
drwxrwxrwx 2 fogproject root 4096 feb 20 12:12 postinitscriptsfogger@fog-ESPRIMO-E900:~$ ls -l /images2/postdownloadscripts/
total 4
-rwxrwxrwx 1 fogproject root 235 feb 20 12:12 fog.postdownloadfogger@fog-ESPRIMO-E900:~$ ls -l /images2/dev/postinitscripts/
total 4
-rwxrwxrwx 1 fogproject root 249 feb 20 12:12 fog.postinit-
Connected FTP from a windows computer using Filezilla and was able to upload a test.txt file and move it around, but the file uploaded with the following permissions (I don’t know how to interpret this):
-rw-r–r-- 1 fogproject fogproject 4 feb 22 04:55 test.txt -
I read in some post that the image files were to be uploaded to /images2/dev/MACaddress/ and afterwards moved to /images2/ImageName/, but I don’t see that the /images2/dev/MACaddress is ever created.
-
Finally, the default storage group and node pointing to /images is still working fine for both capture and deploy.
More info and outputs
fogger@fog-ESPRIMO-E900:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 55,5M 1 loop /snap/core18/2284
loop2 7:2 0 61,9M 1 loop /snap/core20/1361
loop3 7:3 0 218,4M 1 loop /snap/gnome-3-34-1804/93
loop4 7:4 0 73,9M 1 loop /snap/core22/864
loop5 7:5 0 248,8M 1 loop /snap/gnome-3-38-2004/99
loop6 7:6 0 40,9M 1 loop /snap/snapd/20290
loop7 7:7 0 497M 1 loop /snap/gnome-42-2204/141
loop8 7:8 0 91,7M 1 loop /snap/gtk-common-themes/1535
loop9 7:9 0 219M 1 loop /snap/gnome-3-34-1804/77
loop10 7:10 0 65,2M 1 loop /snap/gtk-common-themes/1519
loop11 7:11 0 63,5M 1 loop /snap/core20/2015
loop12 7:12 0 349,7M 1 loop /snap/gnome-3-38-2004/143
loop13 7:13 0 12,3M 1 loop /snap/snap-store/959
loop14 7:14 0 54,2M 1 loop /snap/snap-store/558
loop15 7:15 0 55,7M 1 loop /snap/core18/2796
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 465,3G 0 part /
sdb 8:16 0 1,8T 0 disk
└─sdb1 8:17 0 1,8T 0 part /images2fogger@fog-ESPRIMO-E900:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3,2G 1,9M 3,2G 1% /run
/dev/sda2 457G 361G 74G 84% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/loop0 128K 128K 0 100% /snap/bare/5
/dev/loop1 56M 56M 0 100% /snap/core18/2284
/dev/loop2 62M 62M 0 100% /snap/core20/1361
/dev/loop3 219M 219M 0 100% /snap/gnome-3-34-1804/93
/dev/loop6 41M 41M 0 100% /snap/snapd/20290
/dev/loop4 74M 74M 0 100% /snap/core22/864
/dev/loop5 249M 249M 0 100% /snap/gnome-3-38-2004/99
/dev/loop7 497M 497M 0 100% /snap/gnome-42-2204/141
/dev/loop9 219M 219M 0 100% /snap/gnome-3-34-1804/77
/dev/loop10 66M 66M 0 100% /snap/gtk-common-themes/1519
/dev/loop8 92M 92M 0 100% /snap/gtk-common-themes/1535
/dev/loop11 64M 64M 0 100% /snap/core20/2015
/dev/loop15 56M 56M 0 100% /snap/core18/2796
/dev/loop12 350M 350M 0 100% /snap/gnome-3-38-2004/143
/dev/loop13 13M 13M 0 100% /snap/snap-store/959
/dev/loop14 55M 55M 0 100% /snap/snap-store/558
/dev/sda1 511M 6,1M 505M 2% /boot/efi
/dev/sdb1 1,8T 36K 1,7T 1% /images2
tmpfs 3,2G 40K 3,2G 1% /run/user/1000fogger@fog-ESPRIMO-E900:~$ showmount -e 127.0.0.1
Export list for 127.0.0.1:
/images2/dev *
/images2 *
/images/dev *
/images * -
-
I just found that the temporary placement of the files is /images/dev instead of /images2/dev. That should be the reason why the move command is not finding the file.
Also noticed that when creating the new image and selecting the StorageGroup2 there’s no way to change the path to /images2 the only option is /images.
.
**** However, after creating the new image just like that, it will show the correct path in the image properties.****Trying to find out how to fix it. Any help is appreciated.
-
@ian77 I’m suspecting its a file permission issue because everything else looks right.
There is a debugging dividing line we need to find. So the first question I have is: If you look at /images2/dev after an image capture to the /images2 storage node is there a directory that is named line a mac address?
If no, then the issue is on the NFS side of the image capture.
If yes, then the issue is on the FTP side of image capture.If the issue is on the nfs side then we will need to start another image capture in debug mode (by selecting debug before you pick image capture when you schedule an image capture in the fog web ui.
If the issue is on the ftp side then from a windows computer (like I think you have already done) ftp to the fog server using the fogproject user account (the password is in a hidden file in /opt/fog called .fogsettings [named with a leading dot]. On your computer just create a small text file [test.txt] that we can use for testing. You will transfer that file to the fog server. Now start the ftp program and connect to the fog server using the fogproject user.
In the ftp client issue the following commands:
cd /images2/dev put test.txt mv /images2/dev/test.txt /images2 mkdir /images2/dev/aaaa mv /images2/dev/aaaa /images2 cd /images2 rm test.txt rmdir /images2/aaaa
The above will test the actions that FOG does during an image capture. If the above works OK then we know the permissions are good for the fogproject user. The only gotcha is that when the FOS engine (running on the target computer captures the image and transfers it to the FOG server /images2/dev it does this using the root user account. So the permissions on the captured images directory may not be right.
But first lets identify if the directory is being created in /images2/dev first.
-
Thank you for your support @george1421
If you look at /images2/dev after an image capture to the /images2 storage node is there a directory that is named line a mac address?
No there is not. It’s uploading to the wrong directory.
The directory named as the mac appears in /images/dev and not in /images2/dev.
Partclone in the client shows the path as /images2/dev but it is actually writing to /images/dev.
Looks like that after finish capturing, the FOS engine does not find the misplaced directory stating: No such file or directory.The FTP commands worked OK. I started an image capture in debug mode. In the client I got the following variable dump from FOG and the linux prompt:
osid=9
osname=Windows 10
mbrfile=
type=up
storage=192.168.1.10:/images2/dev
img=test3
imgType=n
imgFormat=5
imgPartitionType=all
disks=/dev/nvme0n1
hd=/dev/nvme0n1[Fri Feb 23 root@fogclient /]#
What commands must be issued to get useful debugging information?
-
@ian77 That is strange that the storage variable points to /images2 and yet /images gets mapped.
Now understand on the FOS linux side it will be /images/dev, but what its mapped to should be /images2/dev.
So you are in debug capture mode. What you will do is confirm that the storage variable is pointing to you /images2/dev directory.
The first step is list manually try to mount the directory to see if nfs is working correct…
Please post the output of /etc/exportfs, the fsid variable needs to be different between the /images and /images2 paths if they are the same you will get exactly what you are seeing. It placing the files in the wrong directory.
/images should have fsid of 0
/images/dev fsid 1
/images2 fsid 2
/images2/dev fsid 3once we sort out the fsid I’ll continue with debugging instructions.