[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LVM on two disks - spin down?



Hi

On Thu, Oct 30, 2014 at 08:15:47PM +0100, b-misc@gmx.ch wrote:
> Hi all,
> 
> If I have a LVM which uses two partitions on two different disks and at least 
> one of its subvolumes is always in use, can the second disk spin
> down?

Depends on where that subvolume is mapped to.

It will probably be instructive if you run e.g.:

   # pvdisplay --maps /dev/sda1

which will give the answer to "Which LVs occupy chunks of
/dev/sda1?". Or

   # lvdisplay --maps /dev/vgname/lvname

which will give the answer to "Where is vgname/lvname actually
stored?"

(alternatively, run "vgcfgbackup vgname" and peruse /etc/lvm/backup/vgname)

> 
> An example showing what I mean:
>  _ _ _ _ _ _ _ _      _ _ _ _ _ _ _ _
> |/dev/sda1      |    |/dev/sdb1      |
> |_ _ _ _ _ _ _ _|    |_ _ _ _ _ _ _ _|
> 
> 
> lvmGrp  =  /dev/sda1 + /dev/sdb1
>  _ _ _ _   _ _ _       _ _ _ _ _ _
> |lvm1   | |lvm2 |    |lvm3       |
> |_ _ _ _| |_ _ _|    |_ _ _ _ _ _|
> 
> So since sdb is new, if I add lvm3 it will be on sdb1 and not sda1,
> correct?; 

Assuming that /dev/sda1 is full, yes.  Even so, you can force the
issue when creating the LV.  Or by moving it afterwards.

> if I don't mount lvm3 automatically, can sdb spin down although lvm1 and lvm2 
> are used?

I haven't actually tried that, but I believe so. As long as none of
the LVs which reside (even partially) on /dev/sdb1 are in use, yes.

Note that most LVM operations (lvcreate, pvdisplay etc) will wake up
*all* of the PVs.

> The reason for this setup is the possibility to extend e.g. lvm2 later with 
> space on sdb1 if it is really required without any re-formatting. (Of course I 
> will loose the spin down then, but for the time being I'd take care of my new 
> disk.)

Remember that you can move portions of LVs around to suit you if you
like (without downtime) - courtesy of the (somewhat misnamed) pvmove
command.  So even if you start off with the "wrong" layout, it's
relatively easy to fix.

Hope this helps

-- 
Karl E. Jorgensen


Reply to: