Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace-kernel: unmounting fails #25

Closed
xypron opened this issue Jan 17, 2023 · 7 comments · Fixed by #26
Closed

replace-kernel: unmounting fails #25

xypron opened this issue Jan 17, 2023 · 7 comments · Fixed by #26

Comments

@xypron
Copy link
Contributor

xypron commented Jan 17, 2023

xorriso : UPDATE :  88.01% done
ISO image produced: 1033350 sectors
Written to medium : 1033350 sectors at LBA 0
Writing to 'stdio:new.iso' completed successfully.

mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
umount: /tmp/tmpx8_mo_oq/.tmp/tmph5ya1u24: target is busy.
Traceback (most recent call last):
  File "/usr/local/bin/livefs-edit", line 8, in <module>
    sys.exit(__main__.main())
  File "/usr/local/lib/python3.10/dist-packages/livefs_edit/__main__.py", line 80, in main
    ctxt.teardown()
  File "/usr/local/lib/python3.10/dist-packages/livefs_edit/context.py", line 218, in teardown
    run(['umount', '-R', mount])
  File "/usr/local/lib/python3.10/dist-packages/livefs_edit/__init__.py", line 7, in run
    return subprocess.run(cmd, check=check, **kw)
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['umount', '-R', '/tmp/tmpx8_mo_oq/.tmp/tmph5ya1u24']' returned non-zero exit status 32.
make[1]: *** [Makefile:29: new] Error 1

The following mounts exist at this time

/dev/loop12p1 on /tmp/tmpx8_mo_oq/old/iso type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8)
overlay on /tmp/tmpx8_mo_oq/new/iso type overlay (rw,relatime,lowerdir=/tmp/tmpx8_mo_oq/old/iso,upperdir=/tmp/tmpx8_mo_oq/.tmp/tmpeu8y9ths,workdir=/tmp/tmpx8_mo_oq/.tmp/tmpm5_55sf2,xino=off)
overlay on /tmp/tmpx8_mo_oq/new/initrd type overlay (rw,relatime,lowerdir=/tmp/tmpx8_mo_oq/old/initrd,upperdir=/tmp/tmpx8_mo_oq/.tmp/tmp9mwbz4ni,workdir=/tmp/tmpx8_mo_oq/.tmp/tmpi8zt3e2z)
/tmp/tmpx8_mo_oq/old/iso/casper/ubuntu-server-minimal.squashfs on /tmp/tmpx8_mo_oq/old/ubuntu-server-minimal type squashfs (ro,relatime,errors=continue)
overlay on /tmp/tmpx8_mo_oq/new/ubuntu-server-minimal type overlay (rw,relatime,lowerdir=/tmp/tmpx8_mo_oq/old/ubuntu-server-minimal,upperdir=/tmp/tmpx8_mo_oq/.tmp/tmpj65ygrpa,workdir=/tmp/tmpx8_mo_oq/.tmp/tmp7nyrdp5a,xino=off)
/tmp/tmpx8_mo_oq/old/iso/casper/ubuntu-server-minimal.ubuntu-server.squashfs on /tmp/tmpx8_mo_oq/old/ubuntu-server-minimal.ubuntu-server type squashfs (ro,relatime,errors=continue)
/tmp/tmpx8_mo_oq/old/iso/casper/ubuntu-server-minimal.ubuntu-server.installer.squashfs on /tmp/tmpx8_mo_oq/old/ubuntu-server-minimal.ubuntu-server.installer type squashfs (ro,relatime,errors=continue)
/tmp/tmpx8_mo_oq/old/iso/casper/ubuntu-server-minimal.ubuntu-server.installer.generic.squashfs on /tmp/tmpx8_mo_oq/old/ubuntu-server-minimal.ubuntu-server.installer.generic type squashfs (ro,relatime,errors=continue)
overlay on /tmp/tmpx8_mo_oq/.tmp/tmph5ya1u24 type overlay (rw,relatime,lowerdir=/tmp/tmpx8_mo_oq/old/ubuntu-server-minimal.ubuntu-server.installer:/tmp/tmpx8_mo_oq/old/ubuntu-server-minimal.ubuntu-server:/tmp/tmpx8_mo_oq/new/ubuntu-server-minimal,upperdir=/tmp/tmpx8_mo_oq/.tmp/tmpxb6sqsqd,workdir=/tmp/tmpx8_mo_oq/.tmp/tmpmkgap73e,xino=off)
xypron added a commit to xypron/livefs-editor that referenced this issue Jan 17, 2023
Closes: mwhudson#25

When running kernel-replace 'umount -R' tends to fail.
Catch the exception and use 'umount -l' in that case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
@mwhudson
Copy link
Owner

Out of curiosity which kernel are you running here?

@xypron
Copy link
Contributor Author

xypron commented Jan 24, 2023

The kernel I need to install is linux-laptop from ppa:juergh/linux. My laptop is running the same kernel.

@mwhudson
Copy link
Owner

Ah sorry I meant on your system (I'm half wondering if this unmount failure is a kernel bug)

@xypron
Copy link
Contributor Author

xypron commented Jan 24, 2023

As said on my system I use the same kernel.

@xypron
Copy link
Contributor Author

xypron commented Jan 24, 2023

The same problem occurs on an arm64 system running Lunar with 5.19.0-21-generic.

lsof shows this process relating to one of the mounts:

gpg-agent 14794                             root    3u     unix 0xffff14b5cf5adc00      0t0     101556 /tmp/tmp1gt0b9_6/.tmp/tmpz2qgvhxl/S.gpg-agent type=STREAM (LISTEN)
gpg-agent 14794                             root    4u     unix 0xffff14b5cf5ac000      0t0     101557 /tmp/tmp1gt0b9_6/.tmp/tmpz2qgvhxl/S.gpg-agent.extra type=STREAM (LISTEN)
gpg-agent 14794                             root    5u     unix 0xffff14b5cf5ad000      0t0     101558 /tmp/tmp1gt0b9_6/.tmp/tmpz2qgvhxl/S.gpg-agent.browser type=STREAM (LISTEN)
gpg-agent 14794                             root    6u     unix 0xffff14b5cf5acc00      0t0     101559 /tmp/tmp1gt0b9_6/.tmp/tmpz2qgvhxl/S.gpg-agent.ssh type=STREAM (LISTEN)
root       14794  0.0  0.0  80940  2860 ?        Ss   17:26   0:00 gpg-agent --homedir /tmp/tmp1gt0b9_6/.tmp/tmpz2qgvhxl --use-standard-socket --daemon

@xypron
Copy link
Contributor Author

xypron commented Jan 24, 2023

update.yaml with these lines is enough to reproduce the problem:

---
- name: add-apt-repository
  repo: 'ppa:juergh/linux'
- name: replace-kernel
  flavor: 'laptop'
sudo livefs-edit lunar-live-server-arm64.iso new.iso --action-yaml update.yaml

@mwhudson
Copy link
Owner

Oh right I see the gpg's hanging around too (I could reproduce the problem). Not sure why my lsof-ing didn't find them though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants