-
-
Save rasheedamir/b9f4cae2e118b8c8935e45805935c169 to your computer and use it in GitHub Desktop.
Mount Windows share drives on CoreOS
Author
Author
Workaround we came up with is to manually mount the fileshare in the cloud-init. So our cloud-init looks like this now:
- name: cifsmount.service
command: start
enable: false
content: |
[Unit]
Description=Copy CIFS mount
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
ExecStartPre = -/usr/bin/mkdir -p /opt/sbin
ExecStart=/bin/sh -c "rm -fr /opt/sbin && rsync -a /usr/sbin/ /opt/sbin/ && /usr/bin/docker run -v /opt/sbin:/target so0k/mount.cifs_copy /target && mount --bind /opt/sbin/ /usr/sbin/ && mount -t cifs //<storage_account>.file.core.windows.net/<fileshare> /mnt/azure -o vers=2.1,username=<storage_account>,password=<storage_account_key>,dir_mode=0777,file_mode=0777"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mounting NAS/Cifs
Mounting a cifs share is not natively supported in CoreOS but there is a pretty easy workaround to allow the host system to mount NAS shares. You will use a container to build the mount.cfis module and then copy it to the CoreOS system
On the CoreOS system run the following to download and drop in to a Fedora container:
docker run -t -i -v /tmp:/host_tmp fedora /bin/bash
Once you are in the container you will want to run the following to build the cifs utility
dnf groupinstall -y "Development Tools" "Development Libraries"
dnf install -y tar
dnf install -y bzip2
curl https://ftp.samba.org/pub/linux-cifs/cifs-utils/cifs-utils-6.4.tar.bz2 | bunzip2 -c - | tar -xvf -
cd cifs-utils-6.4/
./configure && make
cp mount.cifs /host_tmp/
Now that the mount.cifs file has been copied to the host machine you can exit the docker container by issuing the 'exit' command or pressing 'ctrl+d'. When you are back in the CoreOS system you can mount the CIFS share with the following command:
/tmp/mount.cifs //nasXXX.service.softlayer.com/USERNAME -o username=USERNAME,password=PASSWORD /path/to/mount