cannot partition existing raid
Bug #1932976 reported by
Michael Hudson-Doyle
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
"preserve = true" for a disk means "preserve the partition table".
For a raid it means "preserve the raid array" but ALSO "preserve the partition table".
So you can't reformat a pre-existing RAID :(
Related branches
~mwhudson/curtin:reformat-vs-preserve
Merged
into
curtin:master
- Ryan Harper (community): Approve
- Server Team CI bot: Approve (continuous-integration)
- Dan Bungert: Approve
-
Diff: 235 lines (+170/-3)5 files modifiedcurtin/block/schemas.py (+1/-0)
curtin/commands/block_meta.py (+14/-3)
doc/topics/storage.rst (+5/-0)
examples/tests/partition-existing-raid.yaml (+115/-0)
tests/vmtests/test_preserve_raid.py (+35/-0)
summary: |
- cannot parition existing raid + cannot paritition existing raid |
summary: |
- cannot paritition existing raid + cannot partition existing raid |
Changed in curtin: | |
status: | New → Incomplete |
To post a comment you must log in.
Hrm, I didn't think this was true (that preserve means keeping partition table).
looking at raid_handler, if you set wipe: superblock, it will wipe a verified.
``` verify( md_devname, raidlevel, device_paths, spare_device_paths)
create_raid = True
if preserve:
raid_
LOG.debug('raid %s already present, skipping create', md_devname)
create_raid = False
if create_raid: mdadm_create( md_devname, raidlevel,
device_ paths, spare_device_paths, container_dev,
info. get('mdname' , ''), metadata)
mdadm.
wipe_mode = info.get('wipe') block.mdadm. zero_device for more details.
LOG.debug( 'Wiping raid device %s mode=%s', md_devname, wipe_mode)
block. wipe_volume( md_devname, mode=wipe_mode, exclusive=False)
if wipe_mode:
if wipe_mode == 'superblock' and create_raid:
# Newly created raid devices already wipe member superblocks at
# their data offset (this is equivalent to wiping the assembled
# device, see curtin.
pass
else:
```
Curtin will verify the array, lower the create_raid flag, and then if wipe
is set, it will clear the array; it only *skips* clearing if wipe=superblock
and we've just created the array (which already wipes the underlying disks).