[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Booting an ISO file from GRUB
From: |
Adam Vodopjan |
Subject: |
Re: Booting an ISO file from GRUB |
Date: |
Wed, 14 Feb 2024 14:56:00 +0200 |
User-agent: |
Mozilla Thunderbird |
On 14/02/2024 10:26, Marko Toivanen wrote:
> I have been trying to find information related to the following problem:
>
> I'm trying to start a Lubuntu 22.04 installation from an older Lubuntu 14.04
> installation by booting the ISO file from grub menu.
>
> Booting the ISO file works by adding the following menu configuration to file
> /etc/grub.d/40_custom:
>
> menuentry "Linux ISO to RAM" {
> insmod lvm
> insmod ext2
> set root="lvm/lubuntu--vg-root"
> set isofile="/home/user/lubuntu-22.04.3-desktop-amd64.iso"
> loopback loop $isofile
> linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile toram
> initrd (loop)/casper/initrd
> }
>
> The problem is when Lubuntu 22.04 starts this way, there is a device
> "/dev/lubuntu-vg" showing up in Linux (what I didn't expect) and because of
> that, I can't make a clean install of Lubuntu 22.04 on the hard drive when
> Lubuntu was started from the ISO file (which is located on the hard drive).
>
> My initial thought was that using "toram" option would completely load the
> ISO to RAM, so I could then be able to repartition the hard drive without
> having to start Lubuntu 22.04 installation from an USB stick.
>
> When I try to repartition /dev/sda (where this lubuntu-vg is located) with
> gparted, I get the following error message:
>
> "we have been unable to inform the kernel of the change, probably because
> if/they are in use"
The thing is it is not literally "in use", but the vg has been activated. You
should first deactivate it with "vgchange -an lubuntu-vg", and after that
continue with repartitioning. But you'd better have the iso on another device
since if the installation is interrupted, you'll end up even without your iso.
With https://github.com/thias/glim you can put your iso to boot from on a flash
drive as a file, without sacrificing the whole drive for a single image. But
beware, recently ubuntu iso sizes exceed 4gb (some of them), so your flash
drive should be not FAT. You could format it to F2FS for example
>
> So, is it possible to boot an ISO file so the problem described wouldn't
> happen?
>
>