-
Notifications
You must be signed in to change notification settings - Fork 0
/
lvmConfig.py
90 lines (84 loc) · 5.31 KB
/
lvmConfig.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import lvm_backend as lvm
a = True
while a == True:
lvm.clearScreen()
lvm.introHeader()
print("What You would like to do?")
print("""
1. Create New Logical Volume\n
2. Extend the size of the Logical Volume\n
3. Convert drives to Physical Volume\n
4. Add Physical volumes to the Volume Group\n
5. Check details about the Logical Volumes and related\n
6. exit
""")
uc = int(input("Enter the option: "))
lvm.clearScreen()
if (uc == 1):
lvm.introHeader()
lvm.checkAvailableDisks()
vol = lvm.VolList()
lvm.createPhysicalVolume(vol)
vg = lvm.createVolumeGroup(vol)
lv = lvm.createLogicalVolume(vg)
lvm.firstFormat(lv,vg)
lvm.mount(lv,vg)
continue
elif (uc ==2):
lvm.introHeader()
volGrpName = input("Enter the name of your Volume Group: ")
logVolName = input("Enter the name of your Logical volume: ")
lvm.extendLogicalVolume(volGrpName,logVolName)
lvm.extendedFormat(logVolName,volGrpName)
continue
elif (uc == 3):
lvm.introHeader()
vol = lvm.VolList()
lvm.createPhysicalVolume(vol)
continue
elif (uc == 4):
lvm.introHeader()
vgname = input("Name of Volume Group you want to extend: ")
no = int(input("How many Physical Volume to add: "))
for i in range(no):
vol = input("Enter volume you want to add: ")
lvm.extendVolumeGroup(vol,vgname)
continue
elif (uc == 5):
lvm.introHeader()
b=True
while b == True:
print("Select one you want the details:\n 1.Physical Volume\n 2.Volume Group \n 3. Logical Volume\n 4.exit")
choose = int(input("Your selection: "))
if (choose == 1):
lvm.detailsPhysicalVolume()
continue
elif (choose == 2):
lvm.detailsVolumeGroup()
continue
elif (choose == 3):
lvm.detailsLogicalVolume()
continue
elif (choose == 4):
b= False
continue
else:
print("No option Like that available, please select \
between 1 to 4")
continue
continue
elif (uc == 6):
a = False
continue
else:
print("No option Like that available, please select \
between 1 to 6")
continue
print("""
████████ ██ ██ █████ ███ ██ ██ ██ ███████ ███████ ██████ ██████ ██ ██ ███████ ██ ███ ██ ██████ ████████ ██ ██ ██ ███████ ████████ ██████ ██████ ██
██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ███████ ███████ ██ ██ ██ █████ ███████ █████ ██ ██ ██████ ██ ██ ███████ ██ ██ ██ ██ ██ ███ ██ ███████ ██ ███████ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ████ ██ ██ ███████ ██ ██████ ██ ██ ██████ ███████ ██ ██ ████ ██████ ██ ██ ██ ██ ███████ ██ ██████ ██████ ███████
""")