2

I am working with the assumption I have a computer with a single hard drive, no USB connectivity and no access to external disks (no optical, diskette or network drives). No PXE either, of course.

The hard drive contains a single partition (such as ext4), with a working Ubuntu installation. Somehow, I have managed to download a recent ISO LiveCD image to this hard drive (such as 14.04.2). I would now like to install the LiveCD system to the hard drive, replacing the existing system.

Note: this is not a real situation, just something I have thought up to torture myself. And others. ;-)

What I have so far:

  • The first step was to configure GRUB2 to boot from the ISO image. This works, following instructions given in this link: http://www.howtogeek.com/196933/how-to-boot-linux-iso-images-directly-from-your-hard-drive/
  • Once in the live session, I run ubiquity (the Ubuntu installer). In manual hard drive selection, I specifiy using the hard drive's unique partition, but not to format it. I have previously removed the former operating system, deleting directories /bin, /lib, /usr, etc. (but retained /boot and the place where I have the ISO image file).
  • Ubiquity complains it needs to unmount partitions on /dev/sda, even though I have specified no changes are to be made to the existing partition.
  • I have also tried to boot the Ubuntu LiveCD ISO image file completely to RAM (kernel parameter: toram). This works with >= 4 GBytes RAM. Once inside the LiveCD, I manually unmount /dev/sda1. The unmount works, and the LiveCD continues working correctly; i.e. I can run applications from the menu. But the installer still blocks, this time complaining it cannot access the LiveCD. This also happens just after the partitioning stage of the install process.

I have read the responses to a similar question here Can I install Ubuntu on the same hard drive I booted with? but the answers do not seem to be applicable to my case (they set out from a less complex initial situation.)

Any ideas on how to proceed from here?

  • What you think if you create a new separate /boot partition, set to boot ISO from there. Then try to install on the original partition – user.dz Jun 20 '15 at 16:32
  • 1
    Thank you for your comment, @Sneetsher. However, note "Ubiquity complains it needs to unmount partitions on /dev/sda". I have tried what you suggest, i.e. booting off an image on /dev/sda1 and installing into /dev/sda2. Ubiquity insists on unmounting all partitions on /dev/sda before proceeding (even if no actual changes are made to the partition table). – ALAN WARD Jun 20 '15 at 16:35
  • I wonder if you could simply mount the ISO with the archive mounter and then use the upgrade prompt – userDepth Sep 27 '17 at 13:33
1

Boot to RAM, unmount partitions, use gparted to create a small partition 1-2gb, copy iso image there, set up grub to boot iso. boot iso. install. Hope this will work

  • 1
    Welcome to Ask Ubuntu! I recommend editing this answer to expand it with specific details about how to do this. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on Ask Ubuntu.) – David Foerster Sep 15 '16 at 13:20
  • Although this is a simple answer, it is a complete answer, with complete instructions, a brief and concise recipe. The person who can't clearly understand those instructions, should start from this script and learn a few more things before trying to install Linux from an ISO image to the same drive. On the other hand, someone who can understand and follow those instructions (boot to RAM, unmount partition, use Gparted, setup grub to boot from ISO) would find no difficulties to install LInux from an ISO image to another partition in the same drive where the image is. – mguima Aug 16 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.