[Cinnamon] INSTALLATION: /isodevice (as a mounted directory) locks a partition even if it is not listed by 'mount'

Aperta
#51 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Reproduction is a full ISO-boot/install cycle on real hardware or a VM with an ISO stored on the target partition, so it is heavy for a newcomer. Start by reading how the installer detects and unmounts partitions in use (the Ubiquity Python sources around partition/mount handling and the /isodevice handling in the casper/installer scripts), then compare Mint 20.3 and 21 behaviour. Done means formatting the partition that held the ISO no longer fails because the installer still holds a mount or loop device on it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
This occurs when installing from an iso file located in the same partition that will be formatted (e.g. as root or as boot) and installed.

The following procedure worked with linuxmint-20.3-cinnamon-64bit.iso.

I have been updating my systems this way so far. In brief, copying the iso file to /boot/grml or to /boot/boot-isos.
An entry could be added manually to grub, but I have been using the 'grml-rescueboot' package (installed from the repository with apt install) or booting from USB with Super Grub Disk.
In the boot sequence, in the ISO grub menu, edit the entry (pressing 'e') and add 'toram' to the 'linux' line and then boot ('F10').
After complete boot, in a terminal, losetup showed a loop for the iso file in the isodevice (the partition that contained the iso file) and mount showed /isodevice mount pointing to the partition (MOUNT DOES NOT SHOW THIS LINE ANY MORE IN MINT 21).
Then I deleted the loop (with losetup -d) and afterwards unmounted /isodevice (IN MINT 21 THIS PRODUCES AND ERROR BECAUSE THERE IS NOT SUCH MOUNT).
After that, I could install normally, formatting the partition that contained the iso file (NOT ANY MORE, NOW IT STOPS WITH AN ERROR BECAUSE THE PARTITION IS USED BY THE SYSTEM).

To Reproduce
Steps to reproduce the behavior:

  1. COPY THE ISO FILE TO THE DESTINATION PARTITION AND INCLUDE IT IN GRUB
sudo apt install grml-rescueboot 
sudo cp /media/user/EXTERNAL/boot-isos/linuxmint-21-cinnamon-64bit-beta.iso /boot/grml/
sudo update-grub

Alternatively a manual entry in the grub menu could be added:

menuentry "Grml Rescue System (linuxmint-21-cinnamon-64bit-beta.iso)" {
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
        else
          search --no-floppy --fs-uuid --set=root xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
        fi
        iso_path="/boot/grml/linuxmint-21-cinnamon-64bit-beta.iso"
        export iso_path
        kernelopts="   "
        export kernelopts
        loopback loop "/boot/grml/linuxmint-21-cinnamon-64bit-beta.iso"
        set root=(loop)
        configfile /boot/grub/loopback.cfg
}

  1. REBOOT AND SELECT GRUB ENTRY "Grml Rescue System (linuxmint-21-cinnamon-64bit-beta.iso)"
  2. IN THE NEXT GRUB MENU (THE ONE OF THE ISO FILE) EDIT THE FIRST ENTRY
    Press 'e'.
    Add 'toram' to the 'linux' line. And press 'F10'
linux  /casper/vmlinuz file=/cdrom/pressed/linuxmint.seed boot=casper iso-scan/filename=${iso_path} toram quiet splash --
  1. AFTER BOOTING, IN A TERMINAL WINDOW, TYPE:
mint@mint:~$ losetup
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                         DIO LOG-SEC
/dev/loop1
             0      0         0  0 /cdrom/casper/filesystem.squashfs   0     512
/dev/loop0
             0      0         0  0 /isodevice/boot/grml/linuxmint-21-cinnamon-64bit-beta.iso
                                                                       0     512
mint@mint:~$ sudo losetup -d /dev/loop0
mint@mint:~$ mount
[[/isodevice IS NOT LISTED]]
mint@mint:~$ sudo umount /isodevice
umount: /isodevice: no mount point specified.
mint@mint:~$ 
  1. INSTALL ON SDA5, AN ERROR IS RAISED
    ROOT_PARTITION_FORMAT
    ERROR
  2. THE PARTITION IS BUSY. CONFIRMED IN GPARTED
    GPARTED_ERROR

Expected behavior
To work as it did with linuxmint-20.3-cinnamon-64bit.iso.
Everything works the same for 1, 2, and 3.
4. AFTER BOOTING, IN A TERMINAL WINDOW, TYPE:

mint@mint:~$ losetup
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                         DIO LOG-SEC
/dev/loop1
             0      0         0  0 /cdrom/casper/filesystem.squashfs   0     512
/dev/loop0
             0      0         0  0 /isodevice/boot/grml/linuxmint-20.3-cinnamon-64bit.iso
                                                                       0     512
mint@mint:~$ sudo losetup -d /dev/loop0
mint@mint:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=1904916k,nr_inodes=476229,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=390432k,mode=755)
/dev/sda5 on /isodevice type ext4 (rw,relatime)
/dev/shm on /cdrom type tmpfs (rw,relatime,size=2307212k)
/dev/loop1 on /rofs type squashfs (ro,noatime)
[[... EDITED FOR BREVITY]]
mint@mint:~$ sudo umount /isodevice
mint@mint:~$ 
  1. INSTALL ON SDA5 WORKS FLAWLESSLY
    ROOT_PARTITION_FORMAT
Lingua principale
Python
Stelle
58
Fork
57
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxmint/ubiquity

Tutte le issue di linuxmint/ubiquity

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.