I'm wondering how safe it is to reboot a Linux install just after I did an lvextend on a mirrored partition.

I can see that the partition is being mirrored properly as the HDD light is light solid. So it's working hard on that one... and I've seen before that it can take hours to update a complete mirror (I just added over 800Gb to that volume).

The lvextend command has returned with no errors and I can run the lvs command and see that the mirror is 47% done.

Is it safe to reboot while the mirror is being updated in this way?

Note: the mirror was 100% up to date before the lvextend command was run.

  • 1
    I wouldn't chance it. – NickD Jan 18 at 4:46

Please check the mirror segment type with lvs -o name,segtype: if it's raid1, it should be safe to reboot if you must, although you might lose some progress.

If the segment type is the legacy mirror, the same will apply to you only if there is a separate on-disk mirror log segment in use. This mirror type includes a --mirrorlog setting with several options: disk is a persistent mirror log that is not itself mirrored, core keeps the mirror log in RAM only, which will always require resyncing from 0% at every reboot. There used to be also a mirrorlog option mirrored, but apparently it had some design issues as the current lvconvert man page specially recommends that it should be avoided (and creating new mirror segments with that mirrorlog type may already be prevented).

The LVM mirroring code includes a checkpointing mechanism: every once in a while the synchronization process updates a persistent record of how far it got, and if the synchronization is interrupted for any reason, it will automatically resume from the last checkpoint.

Nevertheless, I would not reboot a system when a software RAID of any type is in the middle of syncing unless I absolutely had to. Just in case.

|improve this answer|||||
  • Ah. Using lvs -a -o name,segtype,devices I can see the partitions used by the mirror log. It's a very old install and it used the mirror option... – Alexis Wilke Jan 18 at 17:59
  • From your info, I also found out that the mirror option is being slowly deprecated. We can convert those to RAID1, though: Convert mirror to RAID1 – Alexis Wilke Jan 18 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.