undo LVM

Michel Racic michel.racic at gmail.com
Sun May 16 20:21:26 UTC 2010


Hi

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?

My concern is that if I just wipe the LVM headers it still wont be
recognized as a Luks partition instead it will be just like an empty
disc with no content...

Regarding to this messages
(http://dbaspot.com/forums/linux-misc/263673-lvm-possible-undo-pvcreate.html)
that guy used the fact that ext3 stores the superblock on various
locations of the disc so he could reconstruct the ext3 header.
I found another blog
(http://www.effinger.org/blog/2008/10/12/daten-von-mit-luks-verschlusselter-platte-retten/)
that describes a process of geting the luks header with hexedit from
the disk to replace a missing one
 but I'm stuck on the part for identifying the luks header.

Have you guys any idea what exactly happens (physically) on the
pvremove command?
It should wipe the LVM headers from the disc but I'm not sure if that
would get me a step closer or if it could destroy more than I already
destroyed.

Regards Michel

2010/5/16 Michel Racic <michel.racic at gmail.com>:
> Hi Luis
>
> Thanks for the hint, I will research some more to see what exactly the
> vgreduce command will do on my disk.
>
> regards Michel
>
> 2010/5/16 Luis Paulo <luis.barbas at gmail.com>:
>> On Sun, May 16, 2010 at 3:12 PM, Michel Racic <michel.racic at gmail.com> wrote:
>>
>> Hi, Michel
>>
>> I think the way will be
>> http://tldp.org/HOWTO/LVM-HOWTO/removepvsfromvg.html
>>
>> like in
>> $ sudo vgreduce data /dev/sdb1
>>
>> Please wait a little, do wait, to see what other may say about it.
>>
>> Regards
>> Luis
>>
>>> Hi Luis and Herman
>>>
>>> Sorry, it was late when I answered to the thread I found but I see it
>>> was Herman that opened the thread...
>>>
>>> As my main problem is the LVM and not the encryption, maybe you have some hint.
>>>
>>> As its full disk encryption, you can think of just a partition with
>>> any FS on it that has been added to a LVM group.
>>>
>>> Here is the output of the three commands:
>>> ~# vgdisplay
>>>  --- Volume group ---
>>>  VG Name               data
>>>  System ID
>>>  Format                lvm2
>>>  Metadata Areas        1
>>>  Metadata Sequence No  1
>>>  VG Access             read/write
>>>  VG Status             resizable
>>>  MAX LV                0
>>>  Cur LV                0
>>>  Open LV               0
>>>  Max PV                0
>>>  Cur PV                1
>>>  Act PV                1
>>>  VG Size               931.51 GiB
>>>  PE Size               4.00 MiB
>>>  Total PE              238466
>>>  Alloc PE / Size       0 / 0
>>>  Free  PE / Size       238466 / 931.51 GiB
>>>  VG UUID               E9bMha-PSAi-YjNd-dPXi-WSrf-HDdN-jbk1k6
>>>
>>> ~# lvdisplay
>>> ~# pvdisplay
>>>  --- Physical volume ---
>>>  PV Name               /dev/sdb1
>>>  VG Name               data
>>>  PV Size               931.51 GiB / not usable 3.19 MiB
>>>  Allocatable           yes
>>>  PE Size               4.00 MiB
>>>  Total PE              238466
>>>  Free PE               238466
>>>  Allocated PE          0
>>>  PV UUID               DIPP4J-oNdp-NF46-cPa0-qE3N-enbs-SIIBFX
>>>
>>> /dev/sdb is the disk with the encrypted volume on, the process of
>>> making an LVM out of it was a second so I hope it hasn't overwritten
>>> any important information.
>>> Basically I try to find a way to remove the lvm container around and
>>> normally use this encrypted partition again.
>>> I still researching with google how LVM works and how I can revert that process.
>>>
>>> I'm not sure what lvmremove actually will do to my disk (as the man
>>> page isn't very helpful) or if there is a possibility to complete the
>>> lvm setup without data loss (from my current understanding this is not
>>> possible).
>>>
>>> Maybe someone of you have a hint or can point me to a new research
>>> direction as I'm a little bit lost.
>>>
>>> Regards Michel
>>>
>>>
>>> 2010/5/16 Luis Paulo <luis.barbas at gmail.com>:
>>>> On Sat, May 15, 2010 at 11:47 PM, Michel Racic <michel.racic at gmail.com> wrote:
>>>>> Hi Luis
>>>>>
>>>>> Did you get a solution for your problem?
>>>>>
>>>>> I made the same (similar) mistake...
>>>>> I have a 1TB Data disk that is encrypted with luks (cryptsetup) and I
>>>>> installed a new SSD disk because my old HD has crashed and wanted to
>>>>> install lucid lynx on it.
>>>>> On the partition screen I accidentally added the encrypted partition
>>>>> to the LVM and have seen it after I accepted the writing of the
>>>>> partition table to the disk.
>>>>> Now I have the problem how to revert the LVM part that I can decrypt
>>>>> my luks partition with cryptsetup again.
>>>>>
>>>>> Could you manage reverting LVM to get to your data or finishing LVM
>>>>> without deleting the content of that disk?
>>>>>
>>>>> Best regards
>>>>>
>>>>> Michel
>>>>>
>>>>
>>>> Hi, Michel
>>>>
>>>> I didn't had any problem with LVM, i think it was Herman.
>>>>
>>>> And I don't know anything about encryption.
>>>>
>>>> Maybe if you can give more details, like:
>>>>
>>>> Do you see the encrypted files, or nothing at all?
>>>>
>>>> Post the output of
>>>> $ sudo vgdisplay
>>>> $ sudo lvdysplay
>>>>
>>>> and of
>>>> $ sudo pvdysplay
>>>> pointing out what is the partition you want to rescue.
>>>>
>>>> I don't really know if lvm erases the content of the partition when
>>>> added during install process, it may just be a simple matter of
>>>> removing it from the lvm. Don't know.
>>>>
>>>> Regards
>>>> Luis
>>>>
>>>
>




More information about the ubuntu-users mailing list