64 |
|
|
65 |
# create a separate pv partition for each disk with free space |
# create a separate pv partition for each disk with free space |
66 |
devs = [] |
devs = [] |
67 |
|
|
68 |
|
# if there's no partition requests with asVol==True, then there's no |
69 |
|
# need to create any pv partitions |
70 |
|
requested_lvm_partitions = False |
71 |
|
for request in anaconda.id.storage.autoPartitionRequests: |
72 |
|
if request.asVol: |
73 |
|
requested_lvm_partitions = True |
74 |
|
break |
75 |
|
|
76 |
|
if not requested_lvm_partitions: |
77 |
|
return (disks, devs) |
78 |
|
|
79 |
|
# if using RAID1, create free space partitions as RAID1 members |
80 |
|
# so they can later be combined into a single pv partition |
81 |
|
requested_raid_partitions = False |
82 |
|
for request in anaconda.id.storage.autoPartitionRequests: |
83 |
|
if request.useRAID and request.mountpoint == '/': |
84 |
|
requested_raid_partitions = True |
85 |
|
break |
86 |
|
|
87 |
|
if requested_raid_partitions: |
88 |
|
raid_devs = [] |
89 |
|
for disk in disks: |
90 |
|
dev = anaconda.id.storage.newPartition(fmt_type="mdmember", size=1, grow=True, disks=[disk]) |
91 |
|
anaconda.id.storage.createDevice(dev) |
92 |
|
raid_devs.append(dev) |
93 |
|
|
94 |
|
# use minor="1" so that /dev/md1 is the PV, and /dev/md0 is /boot |
95 |
|
part = anaconda.id.storage.newMDArray(fmt_type="lvmpv", minor="1", level="raid1", parents=raid_devs, memberDevices=len(raid_devs)) |
96 |
|
anaconda.id.storage.createDevice(part) |
97 |
|
devs.append(part) |
98 |
|
|
99 |
|
return (disks, devs) |
100 |
|
|
101 |
|
# original default case |
102 |
for disk in disks: |
for disk in disks: |
103 |
if anaconda.id.storage.encryptedAutoPart: |
if anaconda.id.storage.encryptedAutoPart: |
104 |
fmt_type = "luks" |
fmt_type = "luks" |
129 |
if request.asVol: |
if request.asVol: |
130 |
continue |
continue |
131 |
|
|
132 |
|
if request.useRAID: |
133 |
|
log.info("partitioning: RAID1 requested for %s" % request.mountpoint) |
134 |
|
|
135 |
|
raid_devs = [] |
136 |
|
for disk in disks: |
137 |
|
dev = anaconda.id.storage.newPartition(fmt_type="mdmember", |
138 |
|
size=request.size, grow=request.grow, maxsize=request.maxSize, |
139 |
|
mountpoint=request.mountpoint, disks=[disk], weight=request.weight) |
140 |
|
anaconda.id.storage.createDevice(dev) |
141 |
|
raid_devs.append(dev) |
142 |
|
|
143 |
|
dev = anaconda.id.storage.newMDArray(fmt_type=request.fstype, |
144 |
|
mountpoint=request.mountpoint, level="raid1", |
145 |
|
parents=raid_devs, memberDevices=len(raid_devs)) |
146 |
|
anaconda.id.storage.createDevice(dev) |
147 |
|
|
148 |
|
continue |
149 |
|
|
150 |
if request.fstype is None: |
if request.fstype is None: |
151 |
request.fstype = anaconda.id.storage.defaultFSType |
request.fstype = anaconda.id.storage.defaultFSType |
152 |
elif request.fstype == "prepboot": |
elif request.fstype == "prepboot": |
193 |
return |
return |
194 |
|
|
195 |
def _scheduleLVs(anaconda, devs): |
def _scheduleLVs(anaconda, devs): |
196 |
|
if not devs: |
197 |
|
return |
198 |
|
|
199 |
if anaconda.id.storage.encryptedAutoPart: |
if anaconda.id.storage.encryptedAutoPart: |
200 |
pvs = [] |
pvs = [] |
201 |
for dev in devs: |
for dev in devs: |