[pve-devel] move disk to LVM
Wolfgang Bumiller
w.bumiller at proxmox.com
Fri Feb 17 09:53:10 CET 2017
On Fri, Feb 17, 2017 at 01:59:47AM +0100, Michael Rasmussen wrote:
> On Thu, 16 Feb 2017 07:50:18 +0100 (CET)
> Dietmar Maurer <dietmar at proxmox.com> wrote:
>
> >
> > I am not aware of any decision, and wipe_signatures_when_zeroing_new_lvs
> > is set to 1. Maybe we need to add the -Z flag?
> >
> It seems this has no effect since the lvcreate command is run without
> terminal in which case lvcreate will skip waiting for input and
> fallback to leave the signature on the disk.
I just tested it and it seems lvcreate's output is actually just wrong:
Run 1: create volume, remember its location, create a partition
# lvcreate -L 1G -n test pve </dev/null
Logical volume "test" created.
# dmsetup table pve-test
0 2097152 linear 8:35 916662272
# sgdisk -n0:1M:10M /dev/pve/test
Creating new GPT entries.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
# fdisk -l /dev/pve/test
(...)
Device Start End Sectors Size Type
/dev/pve/test1 2048 20480 18433 9M Linux filesystem
# lvremove pve/test
Do you really want to remove active logical volume test? [y/n]: y
Logical volume "test" successfully removed
Run 2: recreate the volume without wiping to verify this is working
# lvcreate -Wn -Zn -L 1G -n test pve </dev/null
WARNING: Logical volume pve/test not zeroed.
Logical volume "test" created.
# dmsetup table pve-test
0 2097152 linear 8:35 916662272
# fdisk -l /dev/pve/test
(...)
Device Start End Sectors Size Type
/dev/pve/test1 2048 20480 18433 9M Linux filesystem
# lvremove pve/test
Do you really want to remove active logical volume test? [y/n]: y
Logical volume "test" successfully removed
Note that `dmsetup table pve-test` showed the same output and `fdisk -l`
gave us the partition table.
Run 3: recreate with wiping enabled
# lvcreate -Wy -Zy -L 1G -n test pve </dev/null
WARNING: gpt signature detected on /dev/pve/test at offset 512. Wipe it? [y/n]: n
Aborted wiping of gpt.
1 existing signature left on the device.
Logical volume "test" created.
# fdisk -l /dev/pve/test
(...) shows that it's empty
# dmsetup table pve-test
0 2097152 linear 8:35 916662272
Note that
1) This is still the same volume according to `dmsetup table pve-test`
2) The partition table is empty according to `fdisk -l`
3) `lvcreate` still claimed it "Aborted wiping of gpt"
(PS: The free_image() code could still use some cleanup though as it
activates the volume regardless of whether it's going to write to it
currently (the 'saferemove' flag).)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20170217/361258d7/attachment.sig>
More information about the pve-devel
mailing list