Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sahilrajput03/c833c7243cd6ef6fc4f0444ff21cc6d3 to your computer and use it in GitHub Desktop.
Save sahilrajput03/c833c7243cd6ef6fc4f0444ff21cc6d3 to your computer and use it in GitHub Desktop.
#mountWindowsShared folder in linux #mount in docker #mountDriveInDocker #mountDriveInLinux

Mounting smartly

Use clear command to get the cursor at top of screen in docker vm. Know more about mount.cifs in docs. Yikes!!

# DO REMEMBER TO CHANGE PASSWORD WITH YOUR LATEST VERSION OF PASSWORD, YIKES!!!
# Do change the ip address in the ~/mount_script if you have your host pc's ip changed.
# PRO TIP: Use cmd(admin), and use `docker-machine ssh manager1` to connect to docker-vm, Its handy!
wget https://tinyurl.com/uiui8ui -O ~/mount_script #UPDATED RIGHTLY ON: 22JAN,2021.
chmod a+wrx ~/mount_script # To make it execuatble for all users.
~/mount_script

#With one line it works as:
wget -O - https://tinyurl.com/uiui8ui | bash #But it won't work coz password is not correct, yo!
  • Note if you don't use(already added in below scrip though) cache=none option then deafult option i.e., cache=strict will be used and thus chaning file won't be refleted every time in machine. Using cache=none, is just awesomely tells not to cache at any cost.

  • For viewing mout details: Use mount | grep /e.

  • Find mount_script gist @ https://gist.github.com/sahilrajput03/1882b2f87009c1f62031c38bc2f0c02b

  • Setting userpermission to be able to read/write in docker vm(or other linux). Also, don't forget to define all permissions you need on linux system for the user info you used to mount it.

  • Problem: I was following the article correctly but din't figure it our early that it corresponded to installing x86 (32 bit version) of packages, but for my case I needed x86_64 (64 bit) packages to make it work. Now, its all cool. Though I need to install two more packages to make it work i.e., samba.tcz and samba-libs.tcz too to make it work actually as mount was throwing that some shit error.

  • Motivation: Also, this article suggests creating new iso image(with cifs installed) as on rebooting docker vm loose changes made to it.

  • Use lsblk insdie the docker vm machine to know the attached devices.

  • Use mount | grep /e to see the mounting deatils.

  • For unmounting use: sudo umount /e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment