Partman modifies USB drive from which debian is being installed in UEFI mode

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Partman modifies USB drive from which debian is being installed in UEFI mode

#1 Post by torque_wrench »

Hello dear debian community,

i know there is an old topic with, probably, matches with my problem but this topic was marked as "closed" so i start a new on.

The Problem:

I´ve created a preseed config for the full-automated installtion of my debian, based on the netinstall-iso. When the Installation comes to the step in which "partman" shoul partitionate my NVMe-SSD it hngs with the following Message:
"Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. "
/dev/sda is my USB-drive and should not be edited.

In another post https://forums.debian.net/viewtopic.php?t=158680 the solution was to add --mac option for isohybrid - unfortunately, this does not work (anymore?), because i receive this errormessage from isohybrid an the iso was not created:
genisoimage -V debian-netinstall-custom-amd64 \
-r -J -b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-eltorito-alt-boot \
-e debian_iso_xpand boot/grub/efi.img \
-no-emul-boot \
-o debian-netinstall-custom-amd64.iso debian_iso_xpand

isohybrid --uefi --mac debian-netinstall-custom-amd64.iso
isohybrid: debian-netinstall-custom-amd64.iso: unable to find mac efi image
also
genisoimage -V debian-netinstall-custom-amd64 \
-r -J -b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-eltorito-alt-boot \
-e debian_iso_xpand boot/grub/efi.img \
-no-emul-boot \
-o debian-netinstall-custom-amd64.iso debian_iso_xpand

isohybrid --mac debian-netinstall-custom-amd64.iso
isohybrid: debian-netinstall-custom-amd64.iso: unable to find mac efi image
ends up with the error message.
I´ve tried this with isohybrid 0.12 (current in "stable and "testing").

Also the part
debconf-set partman/ignore_device /dev/sda
in the preseed-file has no effect.

All other areas of the preseed-file are working only this error comes up and stops the automated install, has anyone an idea or a solution please ?

Thanks in advence for your help

my preseed-config:

Code: Select all

### Locale and Keyboard Settings ###
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/language string en
d-i debian-installer/country string DE

# Tastaturlayout
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string de
d-i console-setup/modelcode string pc105
d-i console-keymaps-at/keymap select de
d-i keyboard-configuration/xkb-keymap select de

### Timezone ###
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Berlin

### Network Setup ###
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string B6T-EPS
d-i netcfg/get_domain string 

### Firmware Loading ###
d-i hw-detect/load_firmware boolean true
d-i preseed/early_command string anna-install network-console
d-i network-console/start select continue
d-i network-console/password password XXXX
d-i network-console/password-again password XXXX

### User Setup ###
d-i passwd/root-password-crypted password XXXX
d-i passwd/user-fullname string XXXX
d-i passwd/username string XXXX
d-i passwd/user-password-crypted password XXXX

### APT Setup ###
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/non-free-firmware boolean true
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/disable-cdrom-entries boolean true
d-i apt-setup/use_mirror boolean false

### Ignore USB Stick for Partitioning ###
debconf-set partman/ignore_device /dev/sda

### Disk Partitioning ###
d-i partman-auto/disk string /dev/nvme0n1
d-i partman-auto/method string regular

# Delete existing partitions
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-auto/initialize_disk_label boolean true

# Partition Layout
d-i partman-auto/expert_recipe string custom-partitioning :: \
      100 100 100 fat32 \
          $primary{ } $bootable{ } method{ efi } format{ } use_filesystem{ } filesystem{ vfat } mountpoint{ /boot/efi } \
      . \
      50000 50000 50000 ext4 \
          $primary{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } \
      . \
      40000 40000 40000 ext4 \
          method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /home } \
      . \
      5000 5000 5000 linux-swap \
          method{ swap } format{ } \
      . \
      160000 160000 -1 ext4 \
          method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } \
      .

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true

### Package Installation ###
tasksel tasksel/first multiselect standard, ssh-server
d-i pkgsel/include string openssh-server

### Late Command ###
d-i preseed/late_command string \
    mkdir -p /target/root/post_install; \
	cp -R /target/media/cdrom/post_install/. /target/root/post_install/

### Popularity Contest ###
popularity-contest popularity-contest/participate boolean false

### GRUB Installation (UEFI) ###
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean false
d-i grub-installer/bootdev string /dev/nvme0n1

### Finish Installation ###
d-i finish-install/reboot_in_progress note
d-i debian-installer/exit/poweroff boolean true

Aki
Global Moderator
Global Moderator
Posts: 3950
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#2 Post by Aki »

Hello,

During the installation, you can access a terminal by pressing F4 from the debian-installer, insert an ext4-formatted spare usb-disk and copy logs to it.

You can copy the Debian installer logs (in /var/log/syslog/installer, if I remember correctly) and the dmesg command output after the error message appears. Analysing them will probably give you a better idea of what is happening.

You can report logs in one of the following ways:
  • attaching the logs to a follow-up forum message as a compressed zip or gz file
  • paste logs into the body of a follow-up message between code tags (if they fit the size of a forum message)
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#3 Post by torque_wrench »

Hello,

i have catched the all log files from the debian-installer, "/var/log" has the following content,

Code: Select all

/var/log # ls -la
drwxr-xr-x    2 root     root           100 Sep 30 06:09 .
drwxr-xr-x    7 root     root           140 Sep  6  2020 ..
-rw-r--r--    1 root     root            41 Sep 30 06:09 firmware-summary
-rw-r--r--    1 root     root        275219 Sep 30 06:19 partman
-rw-r--r--    1 root     root        110314 Sep 30 06:12 syslog
All the log-files are in the attachment.

Thanks for your help
Attachments
logs.zip
(44.51 KiB) Downloaded 7 times

torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#4 Post by torque_wrench »

Nobody an Idea ?

I have now also tried this with the installer of the current Debian testing, the error also occurs there. If anyone has an idea or a workaround - please let me know.

Aki
Global Moderator
Global Moderator
Posts: 3950
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#5 Post by Aki »

I didn't find any hints in the files you sent.

Try installing from the standard Debian installer (instead of your custom built installer).

Please, send a working preseed file that can be really tested (and not a template with invalid obscured values for some fields).

According to the Debian Installation Guide:
  • B.5.2. Using preseeding to change default values:
    For more debugging information, use the boot parameter DEBCONF_DEBUG=5. This will cause debconf to print much more detail about the current settings of each variable and about its progress through each package's installation scripts.
Collect the system log (/var/log/syslog) after starting the Debian installer as you have already done, but start the installer with the DEBCONF_DEBUG=5 parameter.

Hope this helps.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#6 Post by torque_wrench »

Hello Together,

i have now tried the installtion with the Standard debian-12.7.0-amd64-netinst.iso with "DEBCONF_DEBUG=5" and without of any preseed file.
The error also appears here with this installation method.
I have attached the syslog-File.
Attachments
syslog.txt
(377.53 KiB) Downloaded 5 times

Aki
Global Moderator
Global Moderator
Posts: 3950
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#7 Post by Aki »

Hello,
torque_wrench wrote: 2024-10-15 08:59 i have now tried the installtion with the Standard debian-12.7.0-amd64-netinst.iso with "DEBCONF_DEBUG=5" and without of any preseed file.
The error also appears here with this installation method.
I have attached the syslog-File.
What error ? The error from your first post is not in the log.

The Debian Installer installs the operating system files on the nvme0n1 disk partitions and activate the swap on the on it:

Code: Select all

Oct 15 08:19:59 kernel: [    0.000000] secureboot: Secure boot disabled
[..]
Oct 15 08:24:21 partman:   No matching physical volumes found
Oct 15 08:24:21 kernel: [  268.937933]  nvme0n1: p1 p2 p3 p4 p5
Oct 15 08:24:21 kernel: [  268.965459]  nvme0n1: p1 p2 p3 p4 p5
Oct 15 08:25:57 kernel: [  365.226875]  nvme0n1: p1 p2 p3 p4 p5
Oct 15 08:26:02 net/hw-detect.hotplug: Detected hotpluggable network interface enp1s0
Oct 15 08:26:02 net/hw-detect.hotplug: Detected hotpluggable network interface lo
Oct 15 08:26:02 kernel: [  370.283060] Adding 4882428k swap on /dev/nvme0n1p4.  Priority:-2 extents:1 across:4882428k SSFS
Oct 15 08:26:02 partman: mke2fs 1.47.0 (5-Feb-2023)
[..]
Oct 15 08:26:03 kernel: [  370.867417] EXT4-fs (nvme0n1p2): mounted filesystem with ordered data mode. Quota mode: none.
Oct 15 08:26:03 kernel: [  370.877083] EXT4-fs (nvme0n1p3): mounted filesystem with ordered data mode. Quota mode: none.
Oct 15 08:26:03 kernel: [  370.884043] EXT4-fs (nvme0n1p5): mounted filesystem with ordered data mode. Quota mode: none.
[..]
Oct 15 08:26:03 main-menu[318]: INFO: Menu item 'bootstrap-base' selected
Oct 15 08:26:03 debootstrap: /usr/sbin/debootstrap --components=main --debian-installer --resolve-deps --no-check-gpg bookworm /target file:///cdrom/
Oct 15 08:26:08 debootstrap: dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5 package 'dpkg':
Oct 15 08:26:08 debootstrap:  missing 'Description' field
Oct 15 08:26:08 debootstrap: dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5 package 'dpkg':
Oct 15 08:26:08 debootstrap:  missing 'Architecture' field
Oct 15 08:26:08 debootstrap: Selecting previously unselected package base-passwd.
Oct 15 08:26:08 debootstrap: (Reading database ... 0 files and directories currently installed.)
Oct 15 08:26:08 debootstrap: Preparing to unpack .../base-passwd_3.6.1_amd64.deb ...
Oct 15 08:26:08 debootstrap: Unpacking base-passwd (3.6.1) ...
[..]
The grub installer seems installed with no errors:

Code: Select all

[..]
Oct 15 08:28:15 grub-installer: Installing for x86_64-efi platform.
Oct 15 08:28:16 grub-installer: Installation finished. No error reported.
Oct 15 08:28:16 grub-installer: info: grub-install ran successfully
Perhaps I’m missing something. So, what's the issue ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#8 Post by torque_wrench »

Hi,

correct - partman does his job totaly correct, but direct after the confirmation of the partition layout this error
d-i_error.png
occurs. That's the paradox of the matter


The message does not affect the NVMe, because it is the USB-Drive i don´t care about at this point, but interrups my unattended installation.

Theoretically, it would even be enough if the "d-i" “simply” ignore this error. It's a dirty solution, but if it works, it would be okay..

Aki
Global Moderator
Global Moderator
Posts: 3950
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#9 Post by Aki »

Hello,

Thank you for providing more information.

The error message is generated by a component (a library named libparted2) used by the partman program to handle disk partitioning on behalf the debian installer; the involved source code is:
  • sources / parted / 3.5-3 / libparted / arch / linux.c al line 3226 in the function named _disk_sync_part_table:

    Code: Select all

    /*
     * Sync the partition table in two step process:
     * 1. Remove all of the partitions from the kernel's tables, but do not attempt
     *    removal of any partition for which the corresponding ioctl call fails.
     * 2. Add all the partitions that we hold in disk, throwing a warning
     *    if we cannot because step 1 failed to remove it and it is not being
     *    added back with the same start and length.
     *
     * To achieve this two step process we must calculate the minimum number of
     * maximum possible partitions between what linux supports and what the label
     * type supports. EX:
     *
     * number=MIN(max_parts_supported_in_linux,max_parts_supported_in_msdos_tables)
     */
    static int
    _disk_sync_part_table (PedDisk* disk)
    {
    [..]
            if (bad_part_list == NULL)
                    ret = 1;
            else {
                    bad_part_list[strlen (bad_part_list) - 2] = 0;
                    if (ped_exception_throw (
                            PED_EXCEPTION_ERROR,
                            PED_EXCEPTION_IGNORE_CANCEL,
                            _("Partition(s) %s on %s have been written, but we have "
                              "been unable to inform the kernel of the change, "
                              "probably because it/they are in use.  As a result, "
                              "the old partition(s) will remain in use.  You "
                              "should reboot now before making further changes."),
                            bad_part_list, disk->dev->path) == PED_EXCEPTION_IGNORE)
                            ret = 1;
                    free (bad_part_list);
            }
    
As far as I can understand, the program that does the partitioning on behalf of the Debian installer attempts to update the copy of the partition tables used by the Linux kernel after the partitioning of the installed disk has been completed.

Further analysis is required to reproduce the problem.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#10 Post by torque_wrench »

Hi,

yes that is the text, so the culprit has been found.

Who can investigate this ? Can i help further with data and information?

Aki
Global Moderator
Global Moderator
Posts: 3950
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#11 Post by Aki »

You can open a bug report in the Debian Bug Tracking System about the package named debian-installer
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

torque_wrench
Posts: 9
Joined: 2024-09-28 07:17
Been thanked: 1 time

Re: Partman modifies USB drive from which debian is being installed in UEFI mode

#12 Post by torque_wrench »

Okay, i will do this.

Thanks for your help.

Post Reply