Menu

Mount Samba Share via ocs_prerun

Help
duderde
2013-10-15
2018-09-30
  • duderde

    duderde - 2013-10-15

    Hi everybody,
    I have a slight problem with mounting a samba share with the ocs_prerun switch.
    Here is the menu-entry from the grub.cfg:
    menuentry "Test Backup"{
    search --set -f /live/vmlinuz
    fakebios
    linux /live/vmlinuz boot=live config noswap edd=on nomodeset noprompt ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 4" ocs_prerun3="mount -t cifs -o user=test,password=1234 //192.168.2.109/isos /home/partimag" ocs_live_run="ocs-sr -q2 -j2 -z1p -i 20000000 -sc -p poweroff savedisk Client2011 sda" ocs_live_extra_param="" keyboard-layouts=de ocs_live_batch="no" locales="de_DE.UTF-8" vga=788 ip=frommedia nosplash
    initrd /live/initrd.img
    }

    The ocs_prerun1 & ocs_prerun2 are working fine. But when running ocs_prerun3 I get the following error:
    error
    http://s7.directupload.net/images/131015/dlfbgr5l.jpg

    It seems to me I'm not using the mount commmand right, but every source I looked at says I should use it as I did.

    Maybe you can help. Thanks in advance

    Additional Information:
    The mount command works fine from command line as su:
    sudo -i
    mount -t cifs -o user=test,password=1234 //192.168.2.109/isos /home/partimag

     

    Last edit: duderde 2013-10-15
  • Fuchs

    Fuchs - 2013-10-16

    I would use additionally
    ocs_prerun4="sleep 2"

    and
    write only in one(!) [append] line, not separated, and with '='

    .. nosplash initrd=/live/initrd.img

     
  • duderde

    duderde - 2013-10-16

    Thank you for your help Fuchs. I tried that, but it didn't work. The problem seems to me (as indicated in the above image) that the mount command isn't passed to the command-line. To reproduce the error message in the picture I only have to enter "-t" at command-prompt. So that's weird.

    But I got it to work anyway by using a custom script file containing the commands given in the ocs_prerun# parameters.

    menuentry "Test"{
      search --set -f /live/vmlinuz
      fakebios
      linux /live/vmlinuz boot=live config  noswap edd=on nomodeset noprompt locales="de_DE.UTF-8" keyboard-layouts=de ocs_live_run="/live/image/live/custombu-2011" ocs_live_extra_param="" ocs_live_batch=no vga=791 ip=frommedia  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes 
      initrd /live/initrd.img
    }
    

    The file custombu-2011 contains basically only the relevant parts:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    #!/bin/bash
    echo "#########################################################################################"
    
    echo "# 1. Netzwerk konfigurieren"
    
    dhclient -v eth0
    sleep 2
    
    echo "#########################################################################################"
    
    echo "# 2. Netzwerkshare mounten"
    
    mount -t cifs -o username=TEST,password=1234 //DABO/ISOs /home/partimag
    sleep 2
    
    echo "#########################################################################################"
    
    echo "# 3. Image erstellen"
    
    ocs-sr -q2 -j2 -z1p -i 20000000 -sc -p poweroff savedisk Client2011 sda
    
    echo "#########################################################################################"
    

    I still don't get, why the mount command is not working in the ocs_prerun# parameter, but this workaround is. So I'm happy :)

     

    Last edit: duderde 2013-10-16
  • Suncatcher

    Suncatcher - 2018-07-01

    Your bash-file is awesome, but it throws error on username, it should be user.
    Also, all those having thos error, try to add ver=2.0 to mount string, this helped me.

     
  • Pablo Gil

    Pablo Gil - 2018-09-21

    hi,

    I'm also having troubles mounting a SAMBA server from Grub, I would like to try this out but I'm quite newbie and I don't know where should I place the script file... I guess it has to be somewhere in the USB clonezilla live but, where?

    Thanks

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.