Resizing a DRBD Resource Built On A LVM

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, February 14, 2011

Follow me on Twitter as @mattiasgeniar

This is far easier than it sounds. First, make sure you increase the LVM volume on which you’ve built your DRBD system. For more information on how to do so, please have a look at the ‘Increase a VMware Disk formatted as LVM’ article I wrote a while back. Follow those steps, just until you get to the resize2fs part. Don’t run that (yet).

Now, determine your master DRBD node.

root@srv ~]# cat /proc/drbd 
0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
ns:329 nr:328 dw:657 dr:383 al:2 bm:2 lo:0 pe:0 ua:0 ap:0 oos:0

It should contain the term ‘Primary’ as first item in the st: block (which indicates the state).

When on the primary node, browse to the excellent ‘Resizing resources’ manual from DRBD to determine your approach. It’s dependant on having internal or external metadata for your resource, and whether you can do an online resize or not.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.