Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM dm-RAID(5) experiences?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Mon Jan 03, 2022 1:50 am    Post subject: LVM dm-RAID(5) experiences? Reply with quote

Curious if anyone had experience with LVM's RAID5 - meaning using MDRAID5 on top of LVM, LVM being lower on the stack closer to the disks.

I've been using LVM on top of MDRAID all these years because this was the first supported method, and it seems fairly robust. Now there's an option of using md on top of LVM.

Anyway, I tried building an LVM RAID5 in the bit of slack space I have on my RAID disks. Things went okay. Just need to remember that the number of extents you pass it is the number of blocks your actual filesystem is going to use (not counting parity blocks) and the -i option is the number of data storage disks (not counting parity disks).

What I'm not sure about is what happens when you actually get a disk failure... I thought that LVM was pretty nasty at assembly if you lose a disk, maybe not? If you are missing a PV in a VG, what does LVM do? Supposedly you still should be able to bring up the VG with missing PVs... and able to mount LV's inside that VG with missing PVs.

So what would be the equivalent of failing and kicking extents on a disk used in RAID5 over LVM? readding?
If you add a new PV to a VG with a RAID5 on it missing a volume, will it autocreate readd the missing member?

As an experiment I have a small raid5 over lvm with: /dev/sdb3 /dev/sdc3 /dev/sdd3 as PVs, created:
Code:
# for a in b c d; do pvcreate /dev/sd${a}3; done
# vgcreate tvg /dev/sdb3 /dev/sdc3 /dev/sdd3
# lvcreate -n lvr5 --type raid5 -l 1024 -i 2 tvg

Now how do I manage these member disks? If one of the PVs dies, then what?

Dang... I guess that's one reason why I don't do MD over LVM and rather do LVM over MD, at least I'm somewhat familiar with it.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Thu Jun 30, 2022 3:47 pm    Post subject: Reply with quote

Had a panic disk failure last night, but it seemed to be transient. A hot unplug and replug the disk appears to be working again after verifying the disk as functional in a different machine. Was able to quickly do the dance with mdadm as I've done this many times in the past, and thus cleaned up the mdraid5 and mdraid1.

But I was at a complete loss at how to deal with the lvm RAID5 that I set up on spare partitions on the disk as an experiment.

After dropping and reattaching the disk, the LVMRAID5 still thought the old disk alive as apparently it doesn't touch the disks very often to ensure it's working even if idle. The LVMRAID5 was mounted, so I just tried writing a scratch file to the volume, deleted the file, and synced. Now it noticed the disk was dead and dropped the partition from the RAID.

So what do I do now?

The key is that one PV of the LV croaked.
Code:
# vgdisplay -v tvg

displayed the PVs that the RAID5 volume group. Since I removed the disk and put the disk back in service since it was working, the PV UUID still showed up but of course it's out of date. So the usual commands don't seem to work, in fact it seemed a bit confused:
Code:
# vgreduce --remove tvg /dev/sdd3

failed to remove the bad disk. Apparently I had to do this when I first noticed and not after I pulled the disk. Too late now apparently.

Anyway I ended up doing was
Code:
# vgreduce --removemissing tvg --force

It then got rid of the bad PV from the VG.

So after finally removing it, I had to re-add the disk. So I had to
Code:
# pvcreate /dev/newdevice
# vgextend tvg /dev/newdevice

(where newdevice is actually the old disk since it was a remove and put old back, and linux decided to assign a new device for it.) Anyway, now the volume group has enough spare space and I can
Code:
# lvconvert --repair tvg/lvr5

This appeared to suck up the extra extents in the volume group on the "spare" and after the rebuild, the LVM RAID5 is now protected once more.

Well that's my experience with trying to hot repair a LVM RAID5 which seems a bit more convoluted than repairing the MD RAID5...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3345
Location: Rasi, Finland

PostPosted: Thu Jun 30, 2022 5:45 pm    Post subject: Reply with quote

I use the built-in raid of lvm. Which in turn uses mdraid internally. So far no problems. I just assume lvm uses mdraid wisely.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Thu Jun 30, 2022 6:03 pm    Post subject: Reply with quote

LVM RAID (>1) ?

I see a lot of recovery information about MDRAID and LVMRAID1 but nothing more than this...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3345
Location: Rasi, Finland

PostPosted: Fri Jul 01, 2022 7:33 pm    Post subject: Reply with quote

I had several lvs configured as raid5 lv and raid6 lv.
There's always lvconvert --repair <lv>. But that's probably not what you're looking for.
Maybe see https://wiki.gentoo.org/wiki/LVM#Striping_with_parity_.28RAID4_and_RAID5.29 ?

If the whole raid stack gets corrupted, then... retrieve data from backups? ;)

Now that I think of lvmraid, it must be mdraid on top of lvm.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Fri Jul 01, 2022 11:39 pm    Post subject: Reply with quote

Hmm... I see... I guess that's the "downtime" method if the RAID was disassembled and you had to reassemble it in degraded mode. I guess in my case was a hot swap.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Fri Sep 09, 2022 3:40 am    Post subject: Reply with quote

Ugh, my disk got kicked again.

However this time it was weird, it seemed to have "fixed itself" this time? hmm... confusing. And that's why I'd rather use mdadm ...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Fri Sep 09, 2022 3:44 pm    Post subject: Reply with quote

With no (useful) logs? Do you run smartctl checks on it? Maybe there was an error that was fixed.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Fri Sep 09, 2022 3:53 pm    Post subject: Reply with quote

Well the disk suddenly disappeared from the device table and mdraid stopped the disk from the array. However lvm-raid, as I wasn't using it at the time, I don't know.

I hot pulled the disk from the system, cleaned the contacts off real quick, and reinserted it. The disk got recognized and I was able to re-add the MDRAID partitions back to the MDRAID just as I've always done. After waiting for it to resync, I remembered I needed to deal with lvm-raid which was on the same disks in the slack space. However when I checked the lvm-raid with vgdisplay on them...

it looked healthy! All three disks were up as far as I could tell, no signs of degraded operation. Logs didn't make any mention of the lvm RAID volume either...

Weird.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2048
Location: Germany

PostPosted: Sat Sep 10, 2022 8:46 pm    Post subject: Reply with quote

I just went zfs. It is so easy and robust, mdraid looks silly in comparism.
_________________
Study finds stunning lack of racial, gender, and economic diversity among middle-class white males

I identify as a dirty penismensch.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum