unlock raid over shell

Status
Not open for further replies.

pedda

Cadet
Joined
Jan 13, 2018
Messages
5
Hello,
I´m trying to decryped my RAIDz1-0 Volume over shell with this code:
Code:
#!/usr/bin/env python

#import json
#import requests

import json
import requests

r = requests.post(
		'https://192.168.10.100/api/v1.0/storage/volume/Raid5.5.45.TB/unlock/',
		auth=('root', '123456'),
		headers={'Content-Type': 'application/json'},
		verify=False,
		data=json.dumps({'123456'})
		)
print (r.text)

And get the fallowing error message:
Code:
Traceback (most recent call last):
File "./unlock.py", line 14, in <module>

data=json.dumps({'123456'})

File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
return _default_encoder.encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: set(['123456']) is not JSON serializable

Does anybody has a clue why its not working?
I´m using FreeNAS 11.1-RELEASE
 
Last edited:

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633

pedda

Cadet
Joined
Jan 13, 2018
Messages
5
I did, copy paste didnt insert the line for some reasons:

Code:
data=json.dumps({'123456'})


Code:
'})
 
Last edited:

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Again, use the code tags ;)
 

pedda

Cadet
Joined
Jan 13, 2018
Messages
5
Code:
Traceback (most recent call last):
File "./unlock.py", line 14, in <module>

data=json.dumps({'123456'})'})

File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
return _default_encoder.encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: set(['123456']) is not JSON serializable
 
Last edited:

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
Let's start with a few basic questions.
  1. What version of FreeNAS are you using?
  2. When you say "unlock" are you speaking about encryption?
  3. We don't use RAID5 or 6 here, so is your volume RAIDz1?
 

pedda

Cadet
Joined
Jan 13, 2018
Messages
5
Yes I´m meaning decrypt the Volume
I´m using FreeNAS 11.1-RELEASE
Yes its a RAIDz1-0
 

pedda

Cadet
Joined
Jan 13, 2018
Messages
5
I´m able to decrypt and mount the Raidz over shell with

Code:
geli attach -k /data/geli/95838408-c17c-404d-b9fc-793a192fdf0a.key /dev/gptid/0d78187b-d2b1-11e7-a724-305a3a7f8b4c
geli attach -k /data/geli/95838408-c17c-404d-b9fc-793a192fdf0a.key /dev/gptid/0e3dffb1-d2b1-11e7-a724-305a3a7f8b4c
geli attach -k /data/geli/95838408-c17c-404d-b9fc-793a192fdf0a.key /dev/gptid/0f09c2c2-d2b1-11e7-a724-305a3a7f8b4c

zpool import Raid5.5.45.TB


But then I have to type in the password for the keyfile 3 times. I´m trying to find a way to type in the password just once.
 
Status
Not open for further replies.
Top