#NEWLINE# def _format_volume( self , passphrase , **kwargs ) : #NEWLINE# #INDENT# 'Creates a LUKS header on the volume.\n\n        :param passphrase: the passphrase used to access the volume\n        ' #NEWLINE# LOG . debug ( 'formatting encrypted volume %s' , cipher . dev_path ) #NEWLINE# cmd = [ 'cryptsetup' , '--batch-mode' , 'luksFormat' , '--key-file=-' ] #NEWLINE# cipher = kwargs . get ( 'cipher' , None ) #NEWLINE# if ( cipher is not None ) : #NEWLINE# #INDENT# cmd . extend ( [ '--cipher' , cipher ] ) #NEWLINE# #UNINDENT# key_size = kwargs . get ( 'key_size' , None ) #NEWLINE# if ( key_size is not None ) : #NEWLINE# #INDENT# cmd . extend ( [ '--key-size' , key_size ] ) #NEWLINE# #UNINDENT# cmd . extend ( [ self . dev_path ] ) #NEWLINE# utils . execute ( * cmd , process_input = passphrase , check_exit_code = True , run_as_root = True , attempts = 3 )