How can I mount a CephFS volume on CoreOS using my monitors' domain name? - coreos

I am trying to mount a CephFS volume on CoreOS. It currently works by specifying the IP address of one of my monitors:
mount -t ceph 1.2.3.4:6789:/ /mnt
However, I have three monitors for redundancy and have configured my DNS server to resolve to all three of them so I want to specify the domain name instead of the IPs:
mount -t ceph ceph-mon:6789:/ /mnt
However, this doesn't work. I think mount relies on mount.ceph being installed properly in order to resolve hostnames but I'm not certain about that.
How can I achieve this with CoreOS?

Related

mount point for Azure file share on VM

I am using Azure file share to sync large amounts of data between multiple machines. I followed the mounting docs to mount the file share to an Azure VM (running Ubuntu 20.04):
https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux?tabs=smb311
The Azure VM currently has a /data location with a 64 GB data drive that I elected as an additional option when the VM was created. I then mounted the fileshare at the /data location, mostly as a convenience to have the fileshare directory located in the same place as the local data. The file share mount is now located at /data/storage-account-name/fileshare-name.
When I run df, I can see the /data mount (filesystem /dev/sda1) and the /data/storage-account-name/fileshare-name mount (filesystem //storage-account-name.file.core.windows.net/fileshare-name). The two locations seem to be totally separate mounts, and everything is working as expected with the file share.
However, is it bad practice to mount the file share "on top" of the /data disk like this? Is it preferred to mount at /mnt or /media for any reason? Or is the mount location somewhat arbitrary?

How can dhclient be made namespace aware?

I am using namespaces to separate a few physical interfaces on a server. The routing works perfectly.
Also I have a folder for each namespace in /etc/netns/ e.g. /etc/netns/namespaceA/resolv.conf so that DNS works fine as well.
The problem arises when using DHCP with dhclient.
I am running dhclient from inside a namespace and am getting this error.
(namespaceA)root#tc-vm:~#dhclient
RTNETLINK answers: File exists
mv: cannot move '/etc/resolv.conf.dhclient-new.2740' to '/etc/resolv.conf': Device or resource busy
I found out that the mv in /etc/resolvconf/update.d/libc contains a mv which might cause the problem.
How can dhclient be made namespace aware?
I looked into the issue myself.
What happens is that when you create a network namespace, you see /etc/resolv.conf of the host machine unless you create explicitly /etc/netns/<namespace_name>/resolv.conf, which will bind mount automatically to /etc/resolv.conf when looked up inside the network namespace. Therefore, by simply creating that path, the resolv.conf of the host won't be visibile any more on the network namespace, which will have its own resolv.conf.
The manual page of ip netns explains this:
For applications that are aware of network namespaces, the convention
is to look for global network configuration files first in
/etc/netns/NAME/ then in /etc/. For example, if you want a different
version of /etc/resolv.conf for a network namespace used to isolate
your vpn you would name it /etc/netns/myvpn/resolv.conf.
Ip netns exec automates handling of this configuration, file
convention for network namespace unaware applications, by creating a
mount namespace and bind mounting all of the per network namespace
configure files into their traditional location in /etc.
As far as updating resolv.conf, dhclient doesn't work in network namespaces out of the box when /etc/netns/<namespace_name>/resolv.conf exists (on the other hand, when it doesn't exist, it will overwrite the resolv.conf of the host machine, since it's the only one available, but that's not really desirable). As the error in the question above shows, what happens is that dhclient prepares a temporary file with the new nameserver details in /etc/resolv.conf.dhclient-new.2740 and then tries to rename it as /etc/resolv.conf. It generates an error because /etc/resolv.conf is already bind-mounted and apparently mv isn't allowed to do this trick.
In order to make dhclient work in network namespaces, /sbin/dhclient-script should be modified.
I removed this:
mv -f $new_resolv_conf /etc/resolv.conf
And replaced it with:
cat $new_resolv_conf > /etc/resolv.conf
rm -f $new_resolv_conf
Otherwise, dhcpcd seems to do this job correctly.

Mounting a folder from other machine in linux

I want to mount a folder which is on some other machine to my linux server. To do that i am using the following command
mount -t nfs 192.xxx.x.xx:/opt/oracle /
Which is executing with the following error
mount.nfs: access denied by server while mounting 192.xxx.x.xx:/opt/oracle
Do anyone knows what's going on ??? I am new to linux.
Depending on what distro you're using, you simply edit the /etc/exports file on the remote machine to export the directories you want, then start your NFS daemon.
Then on the local PC, you mount it using the following command:
mount -t nfs {remote_pc_address}:/remote/dir /some/local/dir
Please try with your home directory as per my knowledge you can't dump anything directly on root like that.
For more reference, find full configuration steps here.

Freenas cannot mount NFS

Today I installed FreeNas 9.2.1.8 and now I am trying to set up a NFS.
First I created a Volume with the volume manager. Then I created a dataset.
Now I want to set up a NFS for this dataset.
So I go to share, add UNIX(NFS) share, as mount point I select the path of my created dataset.
As mapalluser and mapallgroup I select nouser and nogroup scince I changed the permission of the dataset to it.
As a final step I have gone to services and switchen on NFS.
When I now try to mount the nfs on Ubuntu 13.10 with
sudo mount -t nfs 192.168.1.5:/mnt/Storage/NFS /home/tm/freenas/
It says mount.nfs Connection timed out
On the FreeNAS i got an message: rpcb_unset failed.
Does someone know what the problem here is?
Ok I solved the problem appearently I had to add my client to the host name database of my freenas server. The Setting can be found at Network Settings-> Global Configuration
And then I add it like:
192.168.1.4 clientmachinename

Mount Netapp NFS share permanently on RHEL 6.4

I am trying to mount a volume on a RHEL 6.4 virtual machine permanently.
My fstab entry is as:
172.17.4.228:/bp_nfs_test1 /mnt1 nfs rsize=8192,wsize=8192,intr
And I mounted the volume as:
mount 172.17.4.228:/bp_nfs_test1 /mnt1
When I run df -h I can see the volume and able to access it properly.
But when I reboot the VM, the mount is gone and not able to access it anymore even though the entry in /etc/fstab is present
I have to manually mount the volume again (mount -a), then only I am able to see my volume in df -h and access it.
Any help is appreciated
The mount process on boot is very early, so your network won't be online thus preventing the nfs share from being mounted. You'll need to enable netfs, which manages network file shares, and runs after the network is up. Your desired process is:
Standard mounts processed.
NFS share is skipped during initial mounts (by adding _netdev to options).
After network is online, netfs will process network file systems like nfs and bring them online.
To prevent automounter for attempting to mount your nfs share before the network services are available, add _netdev to your options:
172.17.4.228:/bp_nfs_test1 /mnt1 nfs rsize=8192,wsize=8192,intr,_netdev
Enable netfs:
chkconfig netfs on
Alternatively, you could also configure the share through the /etc/auto.master configuration and have it mount when the share is accessed.

Resources