how to create scrip for mount partition bitlocker?

I want create scrip for mount partition bit locker.
for mount bitlocker i type this commands
: /tmp$ sudo dislocker -v -V /dev/sdb1 -p000000-000000-000000-000000-000000-000000-000000-000000 – /mnt/tmp
: /tmp$ ls /mnt/tmp
: /tmp$ sudo mount -o loop,rw /mnt/tmp/dislocker-file /mnt/disk
: /tmp$ ls /mnt/disk/

I want after create script mount just one click not write commands again and add scrip for running startup
how to create scrip for mount partition bitlocker?

forget this command =======/tmp$ sudo dislocker -v -V /dev/sda9

I am not sure what you are trying to do. Is the bitlocked partition no a fixed or removable hard drive?

If this is a fixed drive partition, then do you wish to mount the decrypted filesystem in e.g. /mnt/disk at boot time?

A simple way would be to create the script (without the sudos) in e.g. /usr/loca/bin (make it executable), and then add a “@reboot” entry for it in root’s crontab.

I want to put the commands in a file(script)
Commands placed in a script and runing when. Boot system

And boot the system to be implemented

I am sorry, but I do not fully understand. If the commands that you posted work,then use any text editor (I use vim) to create a file e.g.* /usr/local/bin/mount-dislocked-1* containing the following:


#! /bin/bash

##  or /bin/dash if preferred and installed
##  mount-dislocked-1

bitloked="/dev/sdb1"
mountpoint="/mnt/disk"

if  "$mountpoint/" ] ;then mkdir -p "$mountpoint/" ; fi chmod a+x $mountpoint 

dislocker -v -V $bitloked  -p000000-000000-000000-000000-000000-000000-000000-000000 -- /mnt/tmp
  
mount -o loop,rw /mnt/tmp/dislocker-file /mnt/disk

# no liability for errors accepted.#


> sudo chmod u+x /usr/local/bin/mount-dislocked-1

> sudo crontab -u root -e 

and add the line:

@reboot  /usr/local/bin/mount-dislocked-1

No guarantees,but it might get yuo started.#

  • i am sorry

  • I want make script for mount partition bitlocker
    I want to put the commands in a file(Commands placed in a script )
    And boot the system to be implemented
    please re-make script
    this is my commands for make script


>su
# dislocker -v -V /dev/sda9
# cd  /mnt/tmp
#dislocker -v -V /dev/sda9 -p451891-000000-000000-000000-000000-000000-000000-000000 -- /mnt/tmp
#mount -o loop,rw /mnt/tmp/dislocker-file /mnt/disk

On Thu, 19 Nov 2015 17:06:01 +0000, 123thinksuse wrote:

> And boot the system to be implemented
> please re-make script this is my commands for make script

Put the commands in a text file that has:

#!/bin/bash

as the first line. Script created.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

[QUOTE=eng-int;2738419
A simple way would be to create the script (without the sudos) in e.g. [i]/usr/loca/bin (make it executable), and then add a “@reboot” entry for it in root’s crontab.[/QUOTE]

Thanks for help
I can create script but runing my script with

 
Sudo ./test 

I wan add script on the startup
I added. Systemsettings5->autostart but not runing in the startup system
How to runing in startup?

Replace sudo with into script

echo "my password" | sudo -S
your command

Now working startup
Thanks to all
Special thanks eng-int