casper toram forgets to disconnect loop device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Baltix |
Undecided
|
Unassigned | ||
| casper (Ubuntu) |
Medium
|
Unassigned |
Bug Description
Binary package hint: ubiquity
Ubiquity cannot install if you are booting LiveCD directly from ISO.
Booting directly from GRUB to the ISO, mounts the ISO to /isodevice.
Ubiquity will not install (even if on separate disk) if this is not unmounted.
The result being that one cannot install Ubuntu in this method.
This method can be used to create a recovery partition or a multi-usb bootable drive. For more explanation on how to do this:
========== START ==========
* Run the following commands which will create the directory /boot/iso and download the iso file to that directory.
$ sudo -s
# mkdir /boot/iso
# cd /boot/iso
# wget http://
* Add a custom menu entry in GRUB2 configuration file. Edit /etc/grub.
#!/bin/sh
echo "Adding 40_custom." >&2
exec tail -n +3 $0
menuentry "Maverick CD Image ISO" {
set isofile=
loopback loop (hd0,1)$isofile
linux (loop)/
initrd (loop)/
}
* Afterwards, run update-grub for the changes to be propagated to /boot/grub/grub.cfg
# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-...
Found initrd image: /boot/initrd.
========== STOP ==========
================== Workaround =================
After casper copy to ram , it need to disconnect the loop device and unmount
losetup -d /dev/loop0
umount /isodevice
=======
The result of booting from the ISO directly from GRUB, is that the CD is that the partition where the ISO is located is mounted to /isodevice.
Ubiquity seems to want to have control of all disks and unmount all disks before it starts installing. In the images here you see the example is sda2 for / and sda for the MBR. I have also tried this with a secondary disk where sdb1 was to be used for / and sdb for the MBR and ubiquity still complained that it had to to unmount /isodevice, even though it is on sda1. Doesn't make much sense to unmount a disk if you will not be editing any part of it.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: ubiquity 2.4.8
ProcVersionSign
Uname: Linux 2.6.35-22-generic i686
NonfreeKernelMo
Architecture: i386
Date: Thu Dec 2 16:34:42 2010
LiveMediaBuild: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ubiquity
komputes (komputes) wrote : | #1 |
komputes (komputes) wrote : | #2 |
komputes (komputes) wrote : | #3 |
komputes (komputes) wrote : | #4 |
komputes (komputes) wrote : | #5 |
komputes (komputes) wrote : | #6 |
komputes (komputes) wrote : | #7 |
description: | updated |
description: | updated |
komputes (komputes) wrote : | #9 |
How can one preseed d-i values on a LiveCD with ubiquity? Can you please provide instructions and I will test and get back to you.
Changed in ubiquity (Ubuntu): | |
status: | Invalid → New |
tags: | added: ubiquity-2.4.8 |
komputes (komputes) wrote : | #10 |
This no longer affects me with the latest version.
Changed in baltix: | |
status: | New → Invalid |
Changed in ubiquity (Ubuntu): | |
status: | New → Invalid |
Krainov Lev (lev-krainov) wrote : | #11 |
reproduced in kubuntu-
Aditya (meta1729) wrote : | #12 |
Present in xubuntu-
Please reopen this bug.
experimancer (experimancer) wrote : | #13 |
Still present in ubuntu-
No way to continue with installation cause "/isodevice cannot be unmounted" (the operation of which is not even needed).
Not "invalid" or "fixed" not even in any of this bugs duplicates.
Wonder why this has ever been closed, even if it has been around for atleast 4 years in each and every Ubunut installatiion .iso image.?
The quality of Ubuntu distributions is getting worse and worse every year.. And seems that rven this severe installation bugs are not fixed :(
tags: | added: installer ubuntu-14.04 |
experimancer (experimancer) wrote : | #14 |
Fix is actully here: https:/
Changed in ubiquity (Ubuntu): | |
status: | Invalid → New |
no longer affects: | ubiquity |
Launchpad Janitor (janitor) wrote : | #15 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in ubiquity (Ubuntu): | |
status: | New → Confirmed |
gregrwm (gregrwm) wrote : | #16 |
confirmed that the 'umount -lrf /isodevice' workaround works on the bionic iso of 2018/2/8. i didn't even use 'toram'.
everyone expects they need either burn a cd, use a thumb or external drive, or use another installer, eg mini.iso. with this workaround, or better yet if this bug gets fixed, none of those are necessary.
Phillip Susi (psusi) wrote : | #17 |
Looks like after casper copies the squashfs to ram, it forgets to disconnect the loop device. The workaround is to run losetup -d /dev/loop0 and umount /isodevice.
affects: | ubiquity (Ubuntu) → casper (Ubuntu) |
Changed in casper (Ubuntu): | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
summary: |
- Ubiquity cannot install if you are booting LiveCD directly from ISO + casper toram forgets to disconnect loop device |
Daniel Richard G. (skunk) wrote : | #18 |
Philip Susi: Confirmed with the Bionic live CD:
root@xubuntu:~# cat /proc/cmdline
BOOT_IMAGE=
root@xubuntu:~# umount /isodevice
umount: /isodevice: target is busy.
root@xubuntu:~# losetup -d /dev/loop0
root@xubuntu:~# umount /isodevice
(succeeds)
However, I did not observe the issue as originally reported; Ubiquity was able to install the system even with /isodevice mounted and unable to be unmounted. (In my case, the ISO file was on a USB thumbdrive, and I installed to a hard drive.)
Phillip Susi (psusi) wrote : | #19 |
Yes; the install only fails if the iso file is on your hard disk.
Filip (fspacek) wrote : | #20 |
Here's a patch for casper to delete the loopback after copying:
diff --git a/scripts/casper b/scripts/casper
index 5861ced..fa06c0d 100644
--- a/scripts/casper
+++ b/scripts/casper
@@ -191,7 +191,7 @@ copy_live_to() {
if [ -e ${copyfrom}/.disk ]; then
cp -a ${copyfrom}/.disk ${copyto}
fi
- umount ${copyfrom}
+ umount -d ${copyfrom}
mount -r -o move ${copyto} ${copyfrom}
rmdir ${copyto}
return 0
Charles Wilkins (cg-chas) wrote : | #21 |
Regarding comment #20, 2019-10-03,
I tried this patch and umount -d ${copyfrom} seems like it should unmount the loopback device, but it does not.
Yet this works:
root@xubuntu:~# losetup -d /dev/loop0
root@xubuntu:~# umount /isodevice
I am still looking that this, but was curious if anybody else is experiencing the same issue when booting a recent live iso from disk.
Charles Wilkins (cg-chas) wrote : | #22 |
I tried explicitly using losetup -d /dev/loop0 right before umount ${copyfrom} in the casper script and it did not work. losetup -d /dev/loop0 and umount /isodevice does work out of rc.local just fyi.
tags: |
added: bionic focal removed: maverick |
description: | updated |
Michel-Ekimia (michel.ekimia) wrote : | #23 |
Did you try to force umount at line
https:/
Michel-Ekimia (michel.ekimia) wrote : | #24 |
Even better option of umount : -d ( detach loop devices )
So sudo umount -lfd /isodevice
should be the way.
description: | updated |
Michel-Ekimia (michel.ekimia) wrote : | #25 |
Any update on this small but big win fix ?
Michel-Ekimia (michel.ekimia) wrote : | #26 |
Still on 20.04.1 ...
Michel-Ekimia (michel.ekimia) wrote : | #27 |
Just an Update : umount -lfd was not enough
So I'm trying to embed a startup script in a Live custom ISO :
losetup -d /dev/loop0
umount -lfd /isodevice
And it works
description: | updated |
description: | updated |
Jerzy Luszawski (dr-agon) wrote : | #28 |
When booting Kubuntu 20.04.1 (LTS) iso the workaround of detaching /dev/loop0 device and then unmounting /isodevice was required, as in comment #27. Then setup finished.
You need to preseed the following:
d-i partman/ filter_ mounted boolean false partman- skip-unmount boolean true
d-i ubiquity/