{"id":28,"date":"2011-11-14T16:51:29","date_gmt":"2011-11-14T16:51:29","guid":{"rendered":"http:\/\/www.guymerritt.net\/?p=28"},"modified":"2011-11-14T16:51:29","modified_gmt":"2011-11-14T16:51:29","slug":"mounting-a-secondary-lvm-drive-etc","status":"publish","type":"post","link":"http:\/\/www.webputzer.com\/?p=28","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>lvm lvscan<br \/>\nlvm vgchange -ay<\/p>\n<p>Anyway &#8211; about adding a second hard drive&#8230;&#8230;.<\/p>\n<p>With only the secondary drive attached, place a Centos cd\/dvd in the optical drive and type rescue mode 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>lvm lvscan<\/p>\n<p>You will, normally, see a LVM group with the name VolGroup00.<\/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>lvm vgrename VolGroup00 VolGroup07<\/p>\n<p>I created a directory call \/harddisk2, and, added the following to rc.local to mount the second hard drive at boot time:<\/p>\n<p>lvm lvscan<br \/>\nlvm vgchange -ay<br \/>\nmount \/dev\/VolGroup07\/LogVol00 \/harddisk2<\/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>mount &#8211;bind \/harddisk2\/etc \/mount2<\/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>touch \/var\/lock\/subsys\/local<br \/>\nlvm lvscan<br \/>\nlvm vgchange -ay<br \/>\nmount \/dev\/VolGroup07\/LogVol00 \/harddisk2<br \/>\nmount &#8211;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<\/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-28","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/28","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=28"}],"version-history":[{"count":0,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}