Mount share folder on windows - linux

I am trying to mount to a Windows share folder from RedHat Linux, I have below code in /etc/fstab
//TheWindowsIP/ShareFolder /LinuxPath/LinuxFolder cifs username=username,password=password,domain=windowsDomain,dir_mode=0777,file_mode=0777 0 0
When I run "mount -a" I got a "Resource temporarily unavailable" error, can someone tell me how can I solve this issue? Or maybe advise another way to access the window folder from RedHat Linux(cifs is driving me crazy)

OK, after the tremendous effort of searching and trying in different ways, turns out the only action I need to solve this problem is reboot. I guess, somehow, the content in /etc/fstab will be mount correctly when the Linux start, but cannot be mount properly when I run mount -a. Ahhh what can I say...

Related

Install/Update cifs-utils before mount smb

I'm currently trying to get Vagrant to provision a working CentoOS7 image on Windows10, using Hyper-V. Vagrant 1.8.4, current latest.
I envcounter a problem where the provisioning fails and I need to workaround each time. The CentOS7 image is a minimal image and does not include cifs-utils, therefore the mount wont work. So, I need cifs-utils installed before mount.
Error:
==> default: Mounting SMB shared folders...
default: C:/Programs/vagrant_stuff/centos7 => /vagrant
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t cifs -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`,sec=ntlm,credentials=/etc/smb_creds_4d99b2
d500a1bcb656d5a1c481a47191 //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191 /vagrant
mount -t cifs -o uid=`id -u vagrant`,gid=`id -g vagrant`,sec=ntlm,credentials=/etc/smb_creds_4d99b2d500a1bcb656d5a1c481a
47191 //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191 /vagrant
The error output from the last command was:
mount: wrong fs type, bad option, bad superblock on //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.
As it is now, the provisioning has to fail, and I need to:
vagrant ssh (powershell)
(connect to instance via putty/ssh)
sudo yum install cifs-utils -y (putty/ssh)
(wait for install...)
exit (putty/ssh)
vagrant reload --provision (powershell)
This is obviously a pain and I am trying to streamline the process.
Does anyone know a better way?
You can install the missing package in your box and repackage this box so you can distribute a new version of this box containing the missing package.
In order to provision a vagrant box you need to create it from an iso. While preparing the box you can install all needed packages for you. In your case it is Hyper-v - https://www.vagrantup.com/docs/hyperv/boxes.html
Best Regards
Apparently my original question was downvoted for some reason. #whatever
As I mentioned in one of the comments above:
I managed to repackage and upload an updated version. Thanks for the advice. Its available in Atlas as "KptnKMan/bluefhypervalphacentos7repack".
Special thanks to #frédéric-henri :)

How to fix virtualbox unknown filesystem type 'vbox'

I want to make a virtual machine for web development on archlinux guest that acts like vagrant box. I don't want to use vagrant box because I want to learn how to do things on my own first and I want to keep the disk space used by the machine at minimum as possible. For this I have installed and configured apache2, php, mariadb with a total of 640M used on disk. I have forwarded guest 80 port to host 127.0.0.1:8080.
I encounter an error with the vboxfs module, I have installed virtualbox-guest-module as described here and after a machine reboot tried:
mount -t vboxfs share_name mount_location and I get this error unknown filesystem type 'vbox'.
I have searched google and all the results make reference to the virtualbox-guest-utils from archlinux but the problem is I don't need all the dependencies that package has (alsa, xorg, video driver etc.) and I don't know witch deps I need or I don't need from that package... so I wander if it is possible and it is enough to use just the vboxfs module to be able to use the share functionality from Virtualbox.
You made a typo. It should be vboxsf instead of vboxfs. I did the same and was wondering why it doesn't work. So the full command is:
sudo mount -t vboxsf share_name mount_location
To remember the correct type you can think of it as the abbreviation of VirtualBox Shared Folder.

pid file disappears after starting pgpool with ubuntu and postgresql

I´ve installed postgresql 9.1 on ubuntu 12.04 with pgpoolII-3.3.3 and pgPoolAdmin
If I try to run pgpool from a terminal with sudo pgpool it seems to start. Viewing ubuntu file explorer I can see how a pgpool.pid file is created at /var/run/pgpool/pgpool.id (this is the path in pgpool.conf)
But after one second the file disappears.
I have tried to change the owner of the directory and the directory permissions but nothing seems to fix it.
If after that I try to stop pgpool wiht sudo pgpool -m fast stop I got an error: Error. pid file not found
It seems like the file is created and suddenly destroyed. I´m wondering why.
If I try to run pgpool from pgPoolAdmin I got this error: pgpool start failed. pgpool.pid not found.
Like other times, it´s maybe and stupid issue and I´m not being able to solve it as i don´t have a high level of knowledge on those systems.
Any idea about what to try?
Xrry Christmas
Solved. I think the problem was caused by a permission problem. After trying
sudo mkdir /var/run/pgpool
sudo chmod 777 /var/run/pgpool
sudo chown postgres/postgres /var/run/pgpool
sudo postgresql service restart
It seems to be working now.
check the tmp directory using ls -la command and delete the file .s.PGSQL.9999 and .s.PGSQL.9898 and restart the server
Upon configuring PgPool-II, I found some documentation explaining that using the default directory /var/run/pgpool for the PID file was a bad idea, for that file could be erased when the service reboots.
The contents of the /var/run directory (including the pgpool
directory) may be removed by the operating system during a reboot. The
/var/run/pgpool directory should NOT be used as the location for the
pgpool.pid file.
The issue seems to occur when using Ubuntu.
So a possible solution would be to store the PID file in a directory named so as to not match the name of a service that could be rebooted. For instance, you could change the pgpool.conf file :
pid_file_name = '/var/run/pgpool4ever/pgpool.pid'
I could not try it on my own as I do not use Ubuntu, but maybe this could help someone facing a similar problem. Although I am not sure that it is very wise to go past basic Ubuntu way of working....

Linux CentOS 7 autofs does not mount network share after reboot

Problem:
I have CentOS 7 Linux VM with cifs installed. I added a mount point using autofs where the whole idea was to automatically mount a network share every time VM boots. However, when I run this command:
ls /mnt/vmshare/trinity
I get
ls: cannot access /mnt/vmshare/trinity: No such file or directory
Workaround:
What I'm having to do is run this command after each reboot
/sbin/service autofs start
Then I can see the files in trinity.
Maybe autofs does not even start by default on reboot. How to make sure autofs starts on reboot? Or in general, how to solve my problem above?
Thanks so much!
for CentOS 7:
systemctl enable autofs
check with:
systemctl is-enabled autofs
I don't recall exactly what I used to figure this one out, but maybe it will get you on the right track.
I did some research on this a few years ago, and I believe the term you're looking for is "persistent mount."
You'll need to create or find the local mount point for your network directory. For instance, in mine.. /media/disco/disknamehere.../.../Share
This must be added to /etc/fstab with the correct options in place. Sorry I couldn't be more help.
Try to run
chkconfig autofs on
that will enable autofs service to start on boot.

Share folder from Host to Guest VM using KVM

I want to share a folder from the host (linux) to a Linux VM that is running on it.
After some research I used 9p (version = 9p2000.L) sharing, following instructions given on the link below:
http://www.linux-kvm.org/page/9p_virtio
PROBLEM: I am unable to read/write to the mounted folder.
mount command shows the mounted fs as : 9p (rw,trans=virtio,version=9p2000.L)
Even doing a simple "ls" command after entering the mount point says : Permission Denied.
Any help is appreciated
Looks like the 9p kernel module is broken in some kernels (3.5, 3.11). I ungraded by guest to 3.10.9 and things started working! :)
I just went with a hunch and have no bug reports or anything to share. Now when I googled it,I see there are few other facing the similar problem and have solved it in a similar fashion.
https://bugs.archlinux.org/task/36992
-HTH

Resources