undo LVM
Tom H
tomh0665 at gmail.com
Mon May 17 23:35:24 UTC 2010
On Sun, May 16, 2010 at 10:51 PM, Luis Paulo <luis.barbas at gmail.com> wrote:
> On Sun, May 16, 2010 at 11:06 PM, Michel Racic <michel.racic at gmail.com> wrote:
>>
>> Thanks for explaining the process of manual LVM setup.
>> Just to repeat the facts, vgdisplay and pvdisplay show the partition
>> but lvdisplay doesn't have any output.
>> This seems to me that the installer did just the step with pvcreate
>> (which wrote the LVM headers to my encrypted disc) and vgcreate which
>> added the pv to a group but the last step with creating a logical
>> volume hasn't been done by the installer because I aborted the
>> installation as soon as I saw the mess I created.
>>
>> You suggest pvmove to move any data but I think that is meant if the
>> pv actually was used in an LVM setup or did I get that wrong?
>>
>> I don't use the VG that this PV is in, so I don't care about the LVM
>> stuff (in the meaning it is not a disc I want to take out of a
>> productive LVM setup) but I need to get to the data on that disk and
>> its a ext3 FS but encrypted with Luks.
>>
>> Just to get my situation from the Thread:
>> The disc was in use as a Luks encrypted partition and I just
>> accidentaly added it to a LVM group but if I open the device in
>> hexedit I see that the Luks header should still be OK but I don't know
>> how to recover the partition header that I can mount it again with
>> cryptsetup.
>>
>> Regards Michel
>>
>> 2010/5/16 Tom H <tomh0665 at gmail.com>:
>>> On Sun, May 16, 2010 at 4:21 PM, Michel Racic <michel.racic at gmail.com> wrote:
>>>>
>>>> Someone on #LVM channel (freenode) meant that pvremove could help as
>>>> it wipes the LVM headers for that disc if I used pcvreate for the
>>>> creation.
>>>>
>>>> Does someone know what exactly the alternate installer does on the
>>>> step in manual partition if you create a LVM group and ad a disk to
>>>> it?
>>>
>>> I have not followed this thread from the beginning so I am only
>>> commenting on the post above.
>>>
>>> If you want to run pvremove make sure that you precede it with a
>>> pvmove and vgremove.
>>>
>>> If you are creating a VG manually (and I assume that the installer
>>> does this in the background), you
>>> - run pvcreate to turn a partition into an LVM physical volume
>>> - run vgcreate to add the newly created PV to a VG (or vgextend if
>>> adding a PV to an existing VG)
>>> - run lvcreate to carve out a logical volume in that VG
>>>
>>> If you want to remove a partition from a VG, you
>>> - run pvmove to move any data ("physical extents") from that PV to another PV
>>> - run vgreduce to remove that PV from the VG
>>> - run pvremove to remove that PV from LVM
>>>
>>> Just running pvremove will not work - or if does work, will leave you
>>> with an LVM mess.
>>>
>>> --
>>> ubuntu-users mailing list
>>> ubuntu-users at lists.ubuntu.com
>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>>
>>
>> --
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
> So, I would try
> $ sudo vgreduce data /dev/sdb1
> My only concerns is that sdb1 is the only pv of the volume.
>
> Will not run the pvmove, that may mess your data
>
> Then I'll try to mount it and try to get access the data
>
> If sucess, I'll do a backup. You will not be in this situation if you
> had one. Maybe there's a reason for not to have one.
>
> If it doesn't work or after the backup, I will run the pvremove
>
> (From man pvremove)
> "pvremove wipes the label on a device so that LVM will no longer
> recognise it as a physical volume."
pvmove will only work if you have another PV in the VG.
If there is no data on the PV/VG/LV, then vgreduce followed by
pvremove is the way to go about this.
More information about the ubuntu-users
mailing list