{"id":340,"date":"2023-01-04T23:31:23","date_gmt":"2023-01-04T19:31:23","guid":{"rendered":"http:\/\/keksus.com\/?p=340"},"modified":"2025-01-11T18:21:11","modified_gmt":"2025-01-11T14:21:11","slug":"grub2-recovery-from-live-usb-lvm","status":"publish","type":"post","link":"https:\/\/hostatto.com\/blog\/grub2-recovery-from-live-usb-lvm.html","title":{"rendered":"Grub2 recovery from live USB (LVM)"},"content":{"rendered":"<p>Boot from live usb. I use <strong>Debian 8<\/strong>. Open terminal and type<\/p>\n<blockquote><p>sudo su<\/p><\/blockquote>\n<p>Install LVM<\/p>\n<blockquote><p>apt-get install lvm2<\/p><\/blockquote>\n<p>List all logical volumes in all volume groups<\/p>\n<blockquote><p>lvscan<\/p><\/blockquote>\n<p>I have such a LVM structure<\/p>\n<blockquote><p>ACTIVE '\/dev\/v1\/boot' [100.00 MiB] inherit<br \/>\nACTIVE '\/dev\/v1\/root' [10.00 GiB] inherit<br \/>\nACTIVE '\/dev\/v1\/tmp' [500.00 MiB] inherit<br \/>\nACTIVE '\/dev\/v1\/var' [30.00 GiB] inherit<\/p><\/blockquote>\n<p>Now mount devices to <strong>mnt<\/strong> folder<\/p>\n<blockquote><p>mount \/dev\/v1\/root \/mnt<br \/>\nmount \/dev\/v1\/boot \/mnt\/boot<br \/>\nmount \/dev\/v1\/var \/mnt\/var<br \/>\nmount --bind \/dev \/mnt\/dev<br \/>\nmount --bind \/proc \/mnt\/proc<br \/>\nmount --bind \/sys \/mnt\/sys<\/p><\/blockquote>\n<p>Change root directory to <strong>mnt<\/strong> folder<\/p>\n<blockquote><p>chroot \/mnt<\/p><\/blockquote>\n<p>Install and update Grub.<\/p>\n<blockquote><p>grub-install \/dev\/sda<br \/>\nupdate-grub<\/p><\/blockquote>\n<p><strong>Note:<\/strong> Use command <strong>fdisk -l<\/strong> to determine which device contain Linux LVM. I have it <strong>\/dev\/sda<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>...<\/p>\n","protected":false},"author":1,"featured_media":506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[21,41,42,43],"class_list":["post-340","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-debian","tag-grub2","tag-lvm","tag-recovery"],"_links":{"self":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":0,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/media\/506"}],"wp:attachment":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}