Score:0

Have lvm spread LVs across several PVs

ng flag

I have a server with multiple disks. Most are raid1:

  PV /dev/md127   VG HDDs            lvm2 [465.63 GiB / 421.63 GiB free]
  PV /dev/sdg1    VG backup          lvm2 [<931.51 GiB / <931.51 GiB free]
  PV /dev/md0     VG SSDs            lvm2 [<1.82 TiB / 1.16 TiB free]
  PV /dev/md1     VG SSDs            lvm2 [<1.82 TiB / <1.82 TiB free]
  Total: 4 [5.00 TiB] / in use: 4 [5.00 TiB] / in no VG: 0 [0   ]

I noticed that all the LVs created under SSDs end up being created on md0 instead of being spread across md0 and md1 (to avoid wear and tear). Is there anything that can be done to (automatically?) have the several LVs use the other disks?

I want to avoid splitting a LV across several disks (i.e. having data on both md0 and md1 -- but would be great if half the LVs are stored on md0 and the other half on md1).

Score:0
ci flag

You can create a lv with type raid0:

lvcreate --type raid0 --stripes 2 --stripesize 64 --name lvtest --size 100G SSDs

The man page of lvmraid will explain all options.

ng flag
This is a live server, so any major hard disk reconfiguration are to be avoided. Also read online that lvm is just a wrapper above mdadm and a lot of people were suggested to keep using mdadm for simplicity's sake and as the scripts are more completed. Not sure how old that doc was though. In your case you are creating a raid0 across the two SSDs PVs?
Alexander Worlitschek avatar
ci flag
No lvm and mdadm are two completly different things. LVM has striping (raid0) support, thats what you asked for. But you can only setup striping during the lv creation. If all of your ssds have the same size, you could remove md1, and change your md0 to type raid10
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.