{"id":337,"date":"2014-10-29T23:10:43","date_gmt":"2014-10-30T04:10:43","guid":{"rendered":"http:\/\/www.hpux.ws\/?p=337"},"modified":"2014-10-29T23:15:00","modified_gmt":"2014-10-30T04:15:00","slug":"puzzle-of-the-day-strict-logical-volume-prevents-you-from-extending-a-filesystem","status":"publish","type":"post","link":"http:\/\/www.hpux.ws\/?p=337","title":{"rendered":"Puzzle of the day. Strict logical volume prevents you from extending a filesystem"},"content":{"rendered":"<p>Thanks to Veerappan Dhandapani of HCL Technologies for bringing me this problem<\/p>\n<p>You have 50 GB free in the volume group.<\/p>\n<p>You try to extend the logical volume and you cant.<\/p>\n<p>Basics:<\/p>\n<p>1) bdf is the tool for measuring filesystem size not logical volume size<\/p>\n<p>2)lvdisplay is the tool for measuring logical volume size.<\/p>\n<p>Steps:<\/p>\n<p>1) Extend the logical volume. That is why the previous two number points are important. In process after extending the logical volume size the lv size and file system size are not equal<\/p>\n<p>2) Extend the file system.<\/p>\n<p><strong>root@mybox# vgdisplay -v vgdata | grep -i &#8220;Free PE&#8221;<\/strong><br \/>\nFree PE 1784<br \/>\nFree PE 511<br \/>\nFree PE 0<br \/>\nFree PE 0<br \/>\nFree PE 0<br \/>\nFree PE 0<br \/>\nFree PE 1273<br \/>\nFree PE 0<\/p>\n<p><strong>root@mybox# lvdisplay \/dev\/vgdata\/lv_prod_datastaging<\/strong><br \/>\n&#8212; Logical volumes &#8212;<br \/>\nLV Name \/dev\/vgdata\/lv_prod_datastaging<br \/>\nVG Name \/dev\/vgdata<br \/>\nLV Permission read\/write<br \/>\nLV Status available\/syncd<br \/>\nMirror copies 0<br \/>\nConsistency Recovery MWC<br \/>\nSchedule parallel<br \/>\nLV Size (Mbytes) 245760<br \/>\nCurrent LE 7680<br \/>\nAllocated PE 7680<br \/>\nStripes 0<br \/>\nStripe Size (Kbytes) 0<br \/>\nBad block on<br \/>\nAllocation PVG-strict<br \/>\nIO Timeout (Seconds) default<\/p>\n<p><strong>root@mybox# lvextend -L 278528 \/dev\/vgdata\/lv_prod_datastaging<\/strong><br \/>\nlvextend: Not enough free physical extents available.<\/p>\n<p>The problem here is the allocation policy.<\/p>\n<p><strong>lvchange -C n -s n \/dev\/vgdata\/lv_prod_datastaging<\/strong><\/p>\n<p>See the man page for details. -C is for contiguous -s is for strict allocation.<\/p>\n<p>We changed both to n(o).<\/p>\n<p>Off camera we extended the logcal volume<\/p>\n<p><strong>lvdisplay \/dev\/vgdata\/lv_prod_datastaging<\/strong><\/p>\n<p>&#8212; Logical volumes &#8212;<br \/>\nLV Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/vgdata\/lv_prod_datastaging<br \/>\nVG Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/vgdata<br \/>\nLV Permission\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 read\/write<br \/>\nLV Status\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 available\/syncd<br \/>\nMirror copies\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nConsistency Recovery\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MWC<br \/>\nSchedule\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 parallel<br \/>\n<strong>LV Size (Mbytes)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 302848<\/strong><br \/>\nCurrent LE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9464<br \/>\nAllocated PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9464<br \/>\nStripes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nStripe Size (Kbytes)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nBad block\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on<br \/>\nAllocation\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 non-strict<br \/>\nIO Timeout (Seconds)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default<\/p>\n<p>We get the size from the logical volume size to feed into the Online JFS extend command so we do not have to do math.<\/p>\n<p><strong>fsadm -F vxfs -b 302848m \/prod\/datastaging<\/strong><\/p>\n<p>bdfmegs is Bill Hassell&#8217;s new and improved bdf<\/p>\n<p><strong>\/var\/adm\/bin\/bdfmegs \/prod\/datastaging<\/strong><br \/>\nFile-System\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Mbytes\u00a0\u00a0\u00a0 Used\u00a0\u00a0 Avail %Used Mounted on<br \/>\n\/dev\/vgdata\/lv_prod_datastaging\u00a0\u00a0 310.1g\u00a0 215.7g\u00a0\u00a0 94.0g\u00a0 70% \/prod\/datastaging<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to Veerappan Dhandapani of HCL Technologies for bringing me this problem You have 50 GB free in the volume group. You try to extend the logical volume and you cant. Basics: 1) bdf is the tool for measuring filesystem size not logical volume size 2)lvdisplay is the tool for measuring logical volume size. Steps: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[28,7,8],"tags":[57,102,105,101,144,103,104,100],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-capacity-planning","category-lvm","category-sysadmin","tag-bdf","tag-fsadm","tag-logical-volume-manager","tag-lvchange","tag-lvm","tag-no-math-fsadm","tag-onlin-jfs","tag-strict-allocation-change"],"_links":{"self":[{"href":"http:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/337"}],"collection":[{"href":"http:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=337"}],"version-history":[{"count":2,"href":"http:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/337\/revisions"}],"predecessor-version":[{"id":339,"href":"http:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/337\/revisions\/339"}],"wp:attachment":[{"href":"http:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}