Imaging Scripts - mount

  1. 2 years ago

    Hi!
    I need to run my script to change an .ini file. (Look at my previous post)
    At the moment i run the script at the bottom of cd_push after change_computer_name.

    What happens then is that my script runs twice. If i run it as a separate imaging script i can't get it to mount the drive again.

    Do you have an easier way to mount the drive? Like a global function i can use?

    I see. Yes, the post scripts are only run once per hard drive, they are not run against individual partitions because that would result in the script running multiple times. Therefore the partition is not mounted when the script runs because it has no idea which partition to target. You would need to put it in your script. The easiest way is just to hard code the destination.

     mkdir /mnt/ntfs		
     ntfs-3g -o force,rw,remove_hiberfile ${hard_drive}2 /mnt/ntfs

    Just change the number 2 to the partition number you want to mount

    When the script is done umount with

    umount /mnt/ntfs
  2. clonedeploy

    16 Jun 2016 Administrator

    I don't fully understand your question. Is there a reason you are not using the built in script editor for CloneDeploy? Then your script would only run once. Can't you just unmount the partition when your script is done?

  3. Sorry

    The issue i am having is when i run the script in post it cannot change anything on the deployed disk because the drive is not mounted anymore.

    Do you have any easy way to mount it again or do i have to build it into my script?

  4. clonedeploy

    16 Jun 2016 Administrator Answer

    I see. Yes, the post scripts are only run once per hard drive, they are not run against individual partitions because that would result in the script running multiple times. Therefore the partition is not mounted when the script runs because it has no idea which partition to target. You would need to put it in your script. The easiest way is just to hard code the destination.

     mkdir /mnt/ntfs		
     ntfs-3g -o force,rw,remove_hiberfile ${hard_drive}2 /mnt/ntfs

    Just change the number 2 to the partition number you want to mount

    When the script is done umount with

    umount /mnt/ntfs
  5. Yes that worked perfectly.

    I might add something like this to cd_global_functions. Just need to figure out how to determine which drive to mount in an efficient way.

    I will post my scripts here for everyone to use. :)

 

or Sign Up to reply!