{"id":42,"date":"2011-11-14T17:01:20","date_gmt":"2011-11-14T17:01:20","guid":{"rendered":"http:\/\/www.guymerritt.net\/?p=42"},"modified":"2012-06-07T15:44:31","modified_gmt":"2012-06-07T15:44:31","slug":"mounting-a-secondary-lvm-drive-etc-2","status":"publish","type":"post","link":"http:\/\/www.webputzer.com\/?p=42","title":{"rendered":"Mounting a secondary LVM drive, etc."},"content":{"rendered":"<p>This is something I&#8217;d written awhile ago when using Centos. It should apply to Scientific Linux, as well.<\/p>\n<p>Here&#8217;s a little update, too. If your using a Linux live CD (eg. Slax) to recover files from a hard drive with a LVM partition these commands are handy as well. You can run the following to activate the partition for mounting::<\/p>\n<p><code>lvm lvscan<br \/>\nlvm vgchange -ay<\/code><\/p>\n<h2>Adding a slave drive with an LVM master<\/h2>\n<p>With only the secondary drive attached, place a Centos cd\/dvd in the optical drive and type <strong>rescue mode<\/strong> at the boot prompt.<\/p>\n<p>You will be asked some questions, the most important being about activating the LVM partitions &#8211; <strong>you do not want to activate LVM volumes at this point.<\/strong><\/p>\n<p>Now, type:<\/p>\n<p><code>lvm lvscan<\/code><\/p>\n<p>You will, normally, see a LVM group with the name <strong>VolGroup00<\/strong>.<\/p>\n<p>Very likely both of your hard drives will have LVM partitions that have the same names &#8211; usually &#8220;VolGroup00&#8221;. This won&#8217;t work, so do something like this to rename the secondary drives partition:<\/p>\n<p><code>lvm vgrename VolGroup00 VolGroup07<\/code><\/p>\n<p>I created a directory call \/harddisk2, and, added the following to <strong>rc.local<\/strong> to mount the second hard drive at boot time:<\/p>\n<p><code>lvm lvscan<br \/>\nlvm vgchange -ay<br \/>\nmount \/dev\/VolGroup07\/LogVol00 \/harddisk2<\/code><\/p>\n<p>Further, to mount a specific directory (in this case, \/etc) on the second hard drive the following works, although I haven&#8217;t tried it in rc.local yet:<\/p>\n<p><code>mount --bind \/harddisk2\/etc \/mount2<\/code><\/p>\n<p>UPDATE: the above does work in rc.local, and, adding the mounted directory as a share in smb.conf worked, as well. I assume you should probably start smbd and nmbd after the LVM activation, mount, etc. My rc.local file looks like this:<\/p>\n<p><code>touch \/var\/lock\/subsys\/local<br \/>\nlvm lvscan<br \/>\nlvm vgchange -ay<br \/>\nmount \/dev\/VolGroup07\/LogVol00 \/harddisk2<br \/>\nmount --bind \/harddisk2\/stuff \/mount2<br \/>\n\/usr\/sbin\/smbd start<br \/>\n\/usr\/sbin\/nmbd start<br \/>\n\/etc\/rc.d\/mysql.server start<br \/>\n\/usr\/local\/apache2\/bin\/apachectl start<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is something I&#8217;d written awhile ago when using Centos. It should apply to Scientific Linux, as well. Here&#8217;s a little update, too. If your using a Linux live CD (eg. Slax) to recover files from a hard drive with a LVM partition these commands are handy as well. You can run the following to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":0,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}