linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume
@ 2016-03-16 21:36 Raimonds Cicans
  2016-03-16 22:00 ` Stuart Gathman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Raimonds Cicans @ 2016-03-16 21:36 UTC (permalink / raw)
  To: linux-lvm

Hello.

I am trying to move LVM setup from old RAID md0 to new RAID md1

I did "lvconvert -m 1 /dev/path/to/logical_volume /dev/md1" on bunch of 
logical volumes.
Everything went without problems.

Then I tried to remove md0 from one of logical volumes by running command:
lvconvert -m 0 /dev/varlin/distfiles /dev/md0

I tried to mount this logical volume, but failed.

Then I checked first  megabyte of logical volume it was zero filled.

Partial output of "lvs -o+devices":
   LV              VG     Attr       LSize   Pool Origin Data%  Meta% 
Move Log Cpy%Sync Convert Devices 

   backup          varlin -wi-ao---- 100,00g 
                          /dev/md0(6304) 

   backup          varlin -wi-ao---- 100,00g 
                          /dev/md0(8544) 

   data            varlin -wi-ao----  20,00g 
                          /dev/md0(28384) 

   distfiles       varlin -wi-a-----  20,00g 
                          /dev/md1(2738) 

   ftp             varlin rwi-aor---  10,00g 
         100,00           ftp_rimage_0(0),ftp_rimage_1(0) 

   ftpdown         varlin rwi-aor---  10,00g 
         100,00           ftpdown_rimage_0(0),ftpdown_rimage_1(0) 



lvm2: 2.02.116
kernel: 4.4.2


Questions:

1) What I did wrong?
2) Is it possible to salvage /dev/varlin/distfiles or I must restore it 
from backups?
3) What I should do now to get system to safe state?


Best regards,
Raimonds Cicans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume
  2016-03-16 21:36 [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume Raimonds Cicans
@ 2016-03-16 22:00 ` Stuart Gathman
  2016-03-16 22:56   ` Raimonds Cicans
  2016-03-17  7:32 ` Raimonds Cicans
  2016-03-17 14:57 ` Heinz Mauelshagen
  2 siblings, 1 reply; 6+ messages in thread
From: Stuart Gathman @ 2016-03-16 22:00 UTC (permalink / raw)
  To: linux-lvm

On 03/16/2016 05:36 PM, Raimonds Cicans wrote:
> Hello.
>
> I am trying to move LVM setup from old RAID md0 to new RAID md1
>
> I did "lvconvert -m 1 /dev/path/to/logical_volume /dev/md1" on bunch 
> of logical volumes.
> Everything went without problems.
>
> Then I tried to remove md0 from one of logical volumes by running 
> command:
> lvconvert -m 0 /dev/varlin/distfiles /dev/md0
>
> I tried to mount this logical volume, but failed.
>
> Then I checked first  megabyte of logical volume it was zero filled.
>
> Partial output of "lvs -o+devices":
>   LV              VG     Attr       LSize   Pool Origin Data% Meta% 
> Move Log Cpy%Sync Convert Devices
>   backup          varlin -wi-ao---- 100,00g                          
> /dev/md0(6304)
>   backup          varlin -wi-ao---- 100,00g                          
> /dev/md0(8544)
>   data            varlin -wi-ao----  20,00g                          
> /dev/md0(28384)
>   distfiles       varlin -wi-a-----  20,00g                          
> /dev/md1(2738)
>   ftp             varlin rwi-aor---  10,00g 100,00           
> ftp_rimage_0(0),ftp_rimage_1(0)
>   ftpdown         varlin rwi-aor---  10,00g 100,00           
> ftpdown_rimage_0(0),ftpdown_rimage_1(0)
>
>
> lvm2: 2.02.116
> kernel: 4.4.2
>
>
> Questions:
>
> 1) What I did wrong?
I would have used pvmove.  Using lvconvert, I think you needed to sync 
the mirrors before removing a leg.
> 2) Is it possible to salvage /dev/varlin/distfiles or I must restore 
> it from backups?
Use the metdata backups (/etc/lvm) to restore lvm to before you removed md0.
> 3) What I should do now to get system to safe state?
The system is probably fine - you just removed you data.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume
  2016-03-16 22:00 ` Stuart Gathman
@ 2016-03-16 22:56   ` Raimonds Cicans
  0 siblings, 0 replies; 6+ messages in thread
From: Raimonds Cicans @ 2016-03-16 22:56 UTC (permalink / raw)
  To: linux-lvm

On 17.03.2016 00:00, Stuart Gathman wrote:
> On 03/16/2016 05:36 PM, Raimonds Cicans wrote:
>> I am trying to move LVM setup from old RAID md0 to new RAID md1
>>
>> I did "lvconvert -m 1 /dev/path/to/logical_volume /dev/md1" on bunch
>> of logical volumes.
>> Everything went without problems.
>>
>> Then I tried to remove md0 from one of logical volumes by running
>> command:
>> lvconvert -m 0 /dev/varlin/distfiles /dev/md0
>>
>> I tried to mount this logical volume, but failed.
>>
>> Then I checked first  megabyte of logical volume it was zero filled.
>>
>> Partial output of "lvs -o+devices":
>>   LV              VG     Attr       LSize   Pool Origin Data% Meta%
>> Move Log Cpy%Sync Convert Devices
>>   backup          varlin -wi-ao---- 100,00g /dev/md0(6304)
>>   backup          varlin -wi-ao---- 100,00g /dev/md0(8544)
>>   data            varlin -wi-ao----  20,00g /dev/md0(28384)
>>   distfiles       varlin -wi-a-----  20,00g /dev/md1(2738)
>>   ftp             varlin rwi-aor---  10,00g 100,00
>> ftp_rimage_0(0),ftp_rimage_1(0)
>>   ftpdown         varlin rwi-aor---  10,00g 100,00
>> ftpdown_rimage_0(0),ftpdown_rimage_1(0)
>>
>>
>> lvm2: 2.02.116
>> kernel: 4.4.2
>>
>>
>> Questions:
>>
>> 1) What I did wrong?
> I would have used pvmove.  Using lvconvert, I think you needed to sync
> the mirrors before removing a leg.

How do I sync mirror before removing leg? I thought 100 in Cpy%Sync 
column mean - everything is in sync.


Best regards,
Raimonds Cicans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume
  2016-03-16 21:36 [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume Raimonds Cicans
  2016-03-16 22:00 ` Stuart Gathman
@ 2016-03-17  7:32 ` Raimonds Cicans
  2016-03-20 17:41   ` Raimonds Cicans
  2016-03-17 14:57 ` Heinz Mauelshagen
  2 siblings, 1 reply; 6+ messages in thread
From: Raimonds Cicans @ 2016-03-17  7:32 UTC (permalink / raw)
  To: linux-lvm

On 16.03.2016 23:36, Raimonds Cicans wrote:
> I am trying to move LVM setup from old RAID md0 to new RAID md1
>
> I did "lvconvert -m 1 /dev/path/to/logical_volume /dev/md1" on bunch of
> logical volumes.
> Everything went without problems.
>
> Then I tried to remove md0 from one of logical volumes by running command:
> lvconvert -m 0 /dev/varlin/distfiles /dev/md0
>
> I tried to mount this logical volume, but failed.
>
> Then I checked first  megabyte of logical volume it was zero filled.
>
> Partial output of "lvs -o+devices":
>    LV              VG     Attr       LSize   Pool Origin Data%  Meta%
> Move Log Cpy%Sync Convert Devices
>    backup          varlin -wi-ao---- 100,00g
> /dev/md0(6304)
>    backup          varlin -wi-ao---- 100,00g
> /dev/md0(8544)
>    data            varlin -wi-ao----  20,00g
> /dev/md0(28384)
>    distfiles       varlin -wi-a-----  20,00g
> /dev/md1(2738)
>    ftp             varlin rwi-aor---  10,00g         100,00
> ftp_rimage_0(0),ftp_rimage_1(0)
>    ftpdown         varlin rwi-aor---  10,00g         100,00
> ftpdown_rimage_0(0),ftpdown_rimage_1(0)
>
>
> lvm2: 2.02.116
> kernel: 4.4.2
>
>

I made following test:
I unmounted /opt and dumped to files following volumes:
/dev/mapper/varlin-opt
/dev/mapper/varlin-opt_rimage_0
/dev/mapper/varlin-opt_rimage_1

and then diff-ed them.

/dev/mapper/varlin-opt_rimage_0 was not equal with /dev/mapper/varlin-opt.
Why??? I thought 100 in Cpy%Sync column of lvs output mean volume is 
fully synchronized.

With "lvconvert -m0" I removed /dev/mapper/varlin-opt_rimage_0 from 
/dev/mapper/varlin-opt.

I did some test of volume - everything was normal.

My plan for now:
for each mirrored volume:
1) do volume content backup
2) umount volume
3) run md5sum for volume itself and all mirror sub-volumes
4) with "lvconvert -m0" remove sub-volume which is not equal to volume
5) do some volume tests
6) if something went wrong - restore volume content from backup
7) if on step 4 was removed new RAID md1, then make pvmove to md1


Best regards,
Raimonds Cicans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume
  2016-03-16 21:36 [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume Raimonds Cicans
  2016-03-16 22:00 ` Stuart Gathman
  2016-03-17  7:32 ` Raimonds Cicans
@ 2016-03-17 14:57 ` Heinz Mauelshagen
  2 siblings, 0 replies; 6+ messages in thread
From: Heinz Mauelshagen @ 2016-03-17 14:57 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: ray

On 03/16/2016 10:36 PM, Raimonds Cicans wrote:
> Hello.
>
> I am trying to move LVM setup from old RAID md0 to new RAID md1
>
> I did "lvconvert -m 1 /dev/path/to/logical_volume /dev/md1" on bunch 
> of logical volumes.
> Everything went without problems.
>
> Then I tried to remove md0 from one of logical volumes by running 
> command:
> lvconvert -m 0 /dev/varlin/distfiles /dev/md0
>
> I tried to mount this logical volume, but failed.

Please provide "lvs -a" and the output of the lvconvert commands to tell 
better what failed here.

Did you check, that your new 2-legged mirror got convert to/from and
that it synced properly?

That said, this is a valid procedure beside using pvmove.

Can't tell what failed w/o further information.

Heinz

>
> Then I checked first  megabyte of logical volume it was zero filled.
>
> Partial output of "lvs -o+devices":
>   LV              VG     Attr       LSize   Pool Origin Data% Meta% 
> Move Log Cpy%Sync Convert Devices
>   backup          varlin -wi-ao---- 100,00g                          
> /dev/md0(6304)
>   backup          varlin -wi-ao---- 100,00g                          
> /dev/md0(8544)
>   data            varlin -wi-ao----  20,00g                          
> /dev/md0(28384)
>   distfiles       varlin -wi-a-----  20,00g                          
> /dev/md1(2738)
>   ftp             varlin rwi-aor---  10,00g 100,00           
> ftp_rimage_0(0),ftp_rimage_1(0)
>   ftpdown         varlin rwi-aor---  10,00g 100,00           
> ftpdown_rimage_0(0),ftpdown_rimage_1(0)
>
>
> lvm2: 2.02.116
> kernel: 4.4.2
>
>
> Questions:
>
> 1) What I did wrong?
> 2) Is it possible to salvage /dev/varlin/distfiles or I must restore 
> it from backups?
> 3) What I should do now to get system to safe state?
>
>
> Best regards,
> Raimonds Cicans
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume
  2016-03-17  7:32 ` Raimonds Cicans
@ 2016-03-20 17:41   ` Raimonds Cicans
  0 siblings, 0 replies; 6+ messages in thread
From: Raimonds Cicans @ 2016-03-20 17:41 UTC (permalink / raw)
  To: linux-lvm

On 17.03.2016 09:32, Raimonds Cicans wrote:
> On 16.03.2016 23:36, Raimonds Cicans wrote:
>> I am trying to move LVM setup from old RAID md0 to new RAID md1
>>
>> I did "lvconvert -m 1 /dev/path/to/logical_volume /dev/md1" on bunch of
>> logical volumes.
>> Everything went without problems.
>>
>> Then I tried to remove md0 from one of logical volumes by running
>> command:
>> lvconvert -m 0 /dev/varlin/distfiles /dev/md0
>>
>> I tried to mount this logical volume, but failed.
>>
>> Then I checked first  megabyte of logical volume it was zero filled.
>>
>> Partial output of "lvs -o+devices":
>>    LV              VG     Attr       LSize   Pool Origin Data%  Meta%
>> Move Log Cpy%Sync Convert Devices
>>    backup          varlin -wi-ao---- 100,00g
>> /dev/md0(6304)
>>    backup          varlin -wi-ao---- 100,00g
>> /dev/md0(8544)
>>    data            varlin -wi-ao----  20,00g
>> /dev/md0(28384)
>>    distfiles       varlin -wi-a-----  20,00g
>> /dev/md1(2738)
>>    ftp             varlin rwi-aor---  10,00g         100,00
>> ftp_rimage_0(0),ftp_rimage_1(0)
>>    ftpdown         varlin rwi-aor---  10,00g         100,00
>> ftpdown_rimage_0(0),ftpdown_rimage_1(0)
>>
>>
>> lvm2: 2.02.116
>> kernel: 4.4.2
>>
>>
>
> I made following test:
> I unmounted /opt and dumped to files following volumes:
> /dev/mapper/varlin-opt
> /dev/mapper/varlin-opt_rimage_0
> /dev/mapper/varlin-opt_rimage_1
>
> and then diff-ed them.
>
> /dev/mapper/varlin-opt_rimage_0 was not equal with /dev/mapper/varlin-opt.
> Why??? I thought 100 in Cpy%Sync column of lvs output mean volume is
> fully synchronized.
>
> With "lvconvert -m0" I removed /dev/mapper/varlin-opt_rimage_0 from
> /dev/mapper/varlin-opt.
>
> I did some test of volume - everything was normal.
>
> My plan for now:
> for each mirrored volume:
> 1) do volume content backup
> 2) umount volume
> 3) run md5sum for volume itself and all mirror sub-volumes
> 4) with "lvconvert -m0" remove sub-volume which is not equal to volume
> 5) do some volume tests
> 6) if something went wrong - restore volume content from backup
> 7) if on step 4 was removed new RAID md1, then make pvmove to md1
>
>

Plan failed, because one of sata controllers failed.
I moved all disks to other computer and booted from SystemRescueCD.
All volumes was synced. I checked by md5sum-ing volumes itself an both 
their legs.
Then I without problems moved all remaining volumes to new RAID.

So, case is closed.

Best regards,
Raimonds Cicans

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-20 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 21:36 [linux-lvm] lvconvert -m 0 /dev/varlin/distfiles /dev/md0 => zero filled logical volume Raimonds Cicans
2016-03-16 22:00 ` Stuart Gathman
2016-03-16 22:56   ` Raimonds Cicans
2016-03-17  7:32 ` Raimonds Cicans
2016-03-20 17:41   ` Raimonds Cicans
2016-03-17 14:57 ` Heinz Mauelshagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).