{"id":109,"date":"2009-08-13T13:49:00","date_gmt":"2009-08-13T11:49:00","guid":{"rendered":"http:\/\/antynet.pl\/index.php\/2009\/08\/13\/linux-lvm\/"},"modified":"2010-08-24T22:38:53","modified_gmt":"2010-08-24T20:38:53","slug":"linux-lvm","status":"publish","type":"post","link":"https:\/\/www.antynet.pl\/index.php\/2009\/08\/13\/linux-lvm\/","title":{"rendered":"LINUX LVM"},"content":{"rendered":"<p>1. create LVM partition:<\/p>\n<div class=\"console\">fdisk \/dev\/[disk]<\/div>\n<p>change partition type from  LINUX to LVM<\/p>\n<p>2. initialization LVM partition:<\/p>\n<div class=\"console\">pvcreate \/dev\/[disk_partiton1] \/dev\/[disk_partition2]<\/div>\n<p>check commands:<\/p>\n<div class=\"console\">pvs<br \/>pvdisplay<\/div>\n<p>3. create LVM group:<\/p>\n<div class=\"console\">vgcreate [group_name] \/dev\/[disk_partition1] \/dev\/[disk_partition2]<\/div>\n<p>check commands:<\/p>\n<div class=\"console\">vgs<br \/>vgdisplay<\/div>\n<p>4. create logical volumes which is attached to group:<\/p>\n<div class=\"console\">lvcreate -L[size]M -n [vol_name] [group_name]<\/div>\n<p>check commands:<\/p>\n<div class=\"console\">lvs<br \/>lvdisplay<\/div>\n<p>5. format volumes:<\/p>\n<div class=\"console\">mkfs.ext3 [LV_name_from_lvdisplay]<\/div>\n<p><\/p>\n<hr \/>\n<p><span style=\"font-weight: bold;\">EXTEND<\/span><br \/>change size volume:<\/p>\n<div class=\"console\">lvextend -L +[size]M [LV_name_from_lvdisplay]<\/div>\n<p>change size partition:<\/p>\n<div class=\"console\">resize2fs [LV_name_from_lvdisplay]<\/div>\n<p><b>REDUCE<\/b><\/p>\n<div class=\"console\">fsck -f [LV_name_from_lvdisplay]<\/div>\n<p>change size partition:<\/p>\n<div class=\"console\">resize2fs [LV_name_from_lvdisplay] [size]G<\/div>\n<p>change size volume:<\/p>\n<div class=\"console\">lvreduce -L -[size]G [LV_name_from_lvdisplay]<\/div>\n<hr \/>\n<p><b>install lvm on ubuntu:<\/b><br \/>use ubuntu live: <br \/>* format LVM partition using fdisk without \/boot<br \/>* install lvm2<br \/>* create pvs,vgs,lvs<br \/>use ubuntu install:<br \/>* before partition install lvm2<br \/>* activate previous lvm partitions using: vgchange -a y<br \/>* install system on previous partitions<br \/><i>after restart, system crashed because default ubuntu do not install lvm<\/i> <br \/>use ubuntu live:<br \/>* install lvm2<br \/>* activate lvm partitions: vgchange -a y<br \/>* mount \/dev\/vg_system\/lv_root \/mnt\/dupa<br \/>* mount \/sda4\/boot \/mnt\/dupa\/boot <br \/>* mount &#8211;bind \/dev\/ \/mnt\/dupa\/dev<br \/>* chroot \/mnt\/dupa<br \/>* mount -t sysfs sysfs \/sys<br \/>* mount -t proc proc \/proc<br \/>* install lvm2 in chroot<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. create LVM partition: fdisk \/dev\/[disk] change partition type from LINUX to LVM 2. initialization LVM partition: pvcreate \/dev\/[disk_partiton1] \/dev\/[disk_partition2] check commands: pvspvdisplay 3. create LVM group: vgcreate [group_name] \/dev\/[disk_partition1] \/dev\/[disk_partition2] check commands: vgsvgdisplay 4. create logical volumes which is attached to group: lvcreate -L[size]M -n [vol_name] [group_name] check commands: lvslvdisplay 5. format volumes: mkfs.ext3 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[4],"tags":[26],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-sciaga-admina","tag-linux-lvm"],"_links":{"self":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":1,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}