{"id":762,"date":"2010-05-26T16:29:47","date_gmt":"2010-05-26T09:29:47","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=762"},"modified":"2010-05-26T16:29:47","modified_gmt":"2010-05-26T09:29:47","slug":"how-to-mount-linux-lvm-volume-on-ubuntu","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=762","title":{"rendered":"How to mount Linux LVM Volume on ubuntu"},"content":{"rendered":"<p>I have 2 harddisk, the first hdd (80 GB) is an empty hdd that i have already installed with new ubuntu server and the other one is an old hdd(180 GB) consist of ubuntu with LVM system. And i am trying to add the oll hdd to my cpu. Here is the 2 hdd detail<\/p>\n<p># fdisk -l<\/p>\n<p>Disk \/dev\/sda: 80.0 GB, 80026361856 bytes<br \/>\n255 heads, 63 sectors\/track, 9729 cylinders<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br \/>\nDisk identifier: 0x000a4ac8<\/p>\n<p>Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System<br \/>\n\/dev\/sda1\u00a0\u00a0 *\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9328\u00a0\u00a0\u00a0 74920960\u00a0\u00a0 83\u00a0 Linux<br \/>\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9328\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9730\u00a0\u00a0\u00a0\u00a0 3227649\u00a0\u00a0\u00a0 5\u00a0 Extended<br \/>\n\/dev\/sda5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9328\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9730\u00a0\u00a0\u00a0\u00a0 3227648\u00a0\u00a0 82\u00a0 Linux swap \/ Solaris<\/p>\n<p>Disk \/dev\/sdb: 160.0 GB, 160041885696 bytes<br \/>\n255 heads, 63 sectors\/track, 19457 cylinders<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br \/>\nDisk identifier: 0xe626e626<\/p>\n<p>Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System<br \/>\n\/dev\/sdb1\u00a0\u00a0 *\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19426\u00a0\u00a0 156039313+\u00a0 8e\u00a0 Linux LVM<br \/>\n\/dev\/sdb2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19427\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19457\u00a0\u00a0\u00a0\u00a0\u00a0 249007+\u00a0\u00a0 5\u00a0 Extended<br \/>\n\/dev\/sdb5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19427\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19457\u00a0\u00a0\u00a0\u00a0\u00a0 248976\u00a0\u00a0 83\u00a0 Linux<\/p>\n<p>As you can see the old hdd ( 160 GB) \/dev\/sdb1 have LINUX LVM , you need lvm2 so you can mount it, here is the step<\/p>\n<p>#apt-get install lvm2<\/p>\n<p>You need to use pvs command to determine the volume group containing the physical volume \/dev\/sdb1<\/p>\n<p># pvs<\/p>\n<p>PV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0 VG\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Fmt\u00a0\u00a0 Attr\u00a0 PSize\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PFree<br \/>\n\/dev\/sdb1\u00a0\u00a0 test\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lvm2\u00a0 a-\u00a0\u00a0\u00a0 148.81g\u00a0\u00a0\u00a0 0<\/p>\n<p>You can see there are physical volume named test onsecond hdd \/dev\/sdb1<\/p>\n<p>let&#8217;s list the logical volumes in physical volume named test<\/p>\n<p># lvdisplay<br \/>\n&#8212; Logical volume &#8212;<br \/>\nLV Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/test\/root<br \/>\nVG Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 test<br \/>\nLV UUID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1bvHS8-07SA-WuAg-tF5q-eWB5-Lp8a-2cyteC<br \/>\nLV Write Access\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 available<br \/>\n# open\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1<br \/>\nLV Size\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 143.08 GiB<br \/>\nCurrent LE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 36629<br \/>\nSegments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1<br \/>\nAllocation\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inherit<br \/>\nRead ahead sectors\u00a0\u00a0\u00a0\u00a0 auto<br \/>\n&#8211; currently set to\u00a0\u00a0\u00a0\u00a0 256<br \/>\nBlock device\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 251:0<\/p>\n<p>&#8212; Logical volume &#8212;<br \/>\nLV Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/test\/swap_1<br \/>\nVG Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 test<br \/>\nLV UUID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Y6c4ge-sv5W-anJY-e4sH-dis8-a5Qi-rABjMO<br \/>\nLV Write Access\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 available<br \/>\n# open\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nLV Size\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5.73 GiB<br \/>\nCurrent LE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1466<br \/>\nSegments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1<br \/>\nAllocation\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inherit<br \/>\nRead ahead sectors\u00a0\u00a0\u00a0\u00a0 auto<br \/>\n&#8211; currently set to\u00a0\u00a0\u00a0\u00a0 256<br \/>\nBlock device\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 251:1<\/p>\n<p>As you can see there are 2 lvm \/dev\/test\/swap_1 and \/dev\/test\/root that actual shortcut from \/dev\/mapper\/test-swap_1 and \/dev\/mapper\/test-root<\/p>\n<p>Now you just need to mount the \/dev\/testroot to directory you wanted , let say \/mnt\/oldhdd<\/p>\n<p># mkdir \/mnt\/oldhdd<\/p>\n<p># mount \/dev\/test\/root \/mnt\/oldhd\/<\/p>\n<p>you can see the mount now<\/p>\n<p>df -ah<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/test-root\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 141G\u00a0\u00a0 27G\u00a0 108G\u00a0 20% \/mnt\/oldhd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have 2 harddisk, the first hdd (80 GB) is an empty hdd that i have already installed with new ubuntu server and the other one is an old hdd(180 GB) consist of ubuntu with LVM system. And i am trying to add the oll hdd to my cpu. Here is the 2 hdd detail [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[6327],"class_list":["post-762","post","type-post","status-publish","format-standard","hentry","category-ubuntu","tag-how-to-mount-linux-lvm-volume"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=762"}],"version-history":[{"count":1,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/762\/revisions"}],"predecessor-version":[{"id":763,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/762\/revisions\/763"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}