← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~mwhudson/curtin:reformat-vs-preserve into curtin:master

 

Review: Needs Information

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.

```
create_raid = True
if preserve:
    raid_verify(md_devname, raidlevel, device_paths, spare_device_paths)
    LOG.debug('raid %s already present, skipping create', md_devname)
    create_raid = False

if create_raid:
    mdadm.mdadm_create(md_devname, raidlevel,
                       device_paths, spare_device_paths, container_dev,
                       info.get('mdname', ''), metadata)

wipe_mode = info.get('wipe')
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.block.mdadm.zero_device for more details.
        pass
    else:
        LOG.debug('Wiping raid device %s mode=%s', md_devname, wipe_mode)
        block.wipe_volume(md_devname, mode=wipe_mode, exclusive=False)
```

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).


-- 
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/404623
Your team curtin developers is subscribed to branch curtin:master.


References