Unable to find the first partition of /dev/loop0
pmbootstrap seems to get stuck when trying to copy all the files to the images:
ERROR: Unable to find the first partition of /dev/loop0, expected it to be at /dev/loop0p1!
The last 200 lines of the log are here:
pmbootstrap log
15:51:44.362351 Unknown or no compression format set, using gzip
15:51:44.362472 == Generating initramfs-extra ==
15:51:44.362585 - Using compression format gzip with level "default"
15:51:44.363055 - Searching for file lists from /usr/share/mkinitfs/files-extra
15:51:44.363265 -- Including files from: /usr/share/mkinitfs/files-extra/00-initramfs-extra-base.files
15:51:44.378655 - Searching for file lists from /etc/mkinitfs/files-extra
15:51:44.378768 - Searching for hook scripts from /usr/share/mkinitfs/hooks-extra
15:51:44.378874 - Searching for hook scripts from /etc/mkinitfs/hooks-extra
15:51:44.379333 - Searching for kernel modules from /usr/share/mkinitfs/modules-extra
15:51:44.379997 - Searching for kernel modules from /etc/mkinitfs/modules-extra
15:51:45.164036 initramfs-extra completed in: 0.80s
15:51:45.164254 == Using boot-deploy to finalize/install files ==
==> Running hooks
==> kernel: device-tree blob operations
==> kernel: appending device-tree qcom/sdm845-oneplus-fajita
==> initramfs: creating boot.img
==> Checking free space at /boot
... OK!
==> Installing: /boot/initramfs
==> Installing: /boot/initramfs-extra
==> Installing: /boot/vmlinuz-dtb
==> Installing: /boot/boot.img
==> Not flashing boot in chroot
15:51:48.613155 boot-deploy completed in: 3.45s
15:51:48.623237 mkinitfs completed in: 4.76s
(2974054) [15:51:48] *** SET LOGIN PASSWORD FOR: 'user' ***
(2974054) [15:51:48] (rootfs_oneplus-fajita) % passwd user
New password:
Retype new password:
passwd: password updated successfully
(2974054) [15:52:00] (rootfs_oneplus-fajita) % grep ^root:!: /etc/shadow
root:!::0:::::
(2974054) [15:52:00] (rootfs_oneplus-fajita) root is already locked
(2974054) [15:52:00] NOTE: No valid keymap specified for device
(2974054) [15:52:00] (rootfs_oneplus-fajita) % setup-timezone -i [snip]
(2974054) [15:52:02] (rootfs_oneplus-fajita) % sh -c echo pablo > /etc/hostname
(2974054) [15:52:02] (rootfs_oneplus-fajita) % sed -i -e s/^127\.0\.0\.1.*/127.0.0.1\tpablo localhost.localdomain localhost/ /etc/hosts
(2974054) [15:52:02] *** (3/4) PREPARE INSTALL BLOCKDEVICE ***
(2974054) [15:52:02] (native) % losetup --json --list
{
"loopdevices": [
{
"name": "/dev/loop0",
"sizelimit": 0,
"offset": 0,
"autoclear": false,
"ro": false,
"back-file": "/home/pmos/rootfs/oneplus-fajita.img",
"dio": false,
"log-sec": 4096
}
]
}
(2974054) [15:52:02] (native) umount /dev/loop0
(2974054) [15:52:02] (native) % losetup -d /dev/loop0
(2974054) [15:52:02] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/var/cache/distfiles
(2974054) [15:52:02] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/var/cache/apk
(2974054) [15:52:02] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/usr/bin/qemu-aarch64-static
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/proc
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/sccache
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/rust
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/packages
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/netboot
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/go
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/git
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/ccache
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/pmbootstrap/abuild-config
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/mnt/appstream-data
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/etc/apk/keys
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/dev/shm
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/dev
(2974054) [15:52:03] % sudo rm /home/user/.local/var/pmbootstrap/chroot_native/in-pmbootstrap
(2974054) [15:52:03] % sudo rm /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita/in-pmbootstrap
(2974054) [15:52:03] % sudo du -ks /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita
1008836 /home/user/.local/var/pmbootstrap/chroot_rootfs_oneplus-fajita
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/dev/install
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/sccache
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/rust
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/packages
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/netboot
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/go
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/git
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/ccache
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/abuild-config
(2974054) [15:52:03] % sudo umount /home/user/.local/var/pmbootstrap/chroot_native/mnt/appstream-data
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/cache_appstream/x86_64/edge /home/user/.local/var/pmbootstrap/chroot_native/mnt/appstream-data
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/cache_ccache_x86_64 /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/ccache
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/cache_git /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/git
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/cache_go /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/go
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/cache_rust /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/rust
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/config_abuild /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/abuild-config
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/cache_sccache /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/sccache
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/images_netboot /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/netboot
(2974054) [15:52:03] % sudo mount --bind /home/user/.local/var/pmbootstrap/packages/edge /home/user/.local/var/pmbootstrap/chroot_native/mnt/pmbootstrap/packages
(2974054) [15:52:03] % sudo touch /home/user/.local/var/pmbootstrap/chroot_native/in-pmbootstrap
(2974054) [15:52:03] (native) % losetup --json --list
{
"loopdevices": [
]
}
(2974054) [15:52:03] (native) % rm /home/pmos/rootfs/oneplus-fajita.img
(2974054) [15:52:03] (native) % busybox su pmos -c HOME=/home/pmos mkdir -p /home/pmos/rootfs
(2974054) [15:52:03] (native) create oneplus-fajita.img (1488M)
(2974054) [15:52:03] (native) % truncate -s 1488M /home/pmos/rootfs/oneplus-fajita.img
(2974054) [15:52:03] (native) mount /dev/install (oneplus-fajita.img)
(2974054) [15:52:03] (native) mount /home/pmos/rootfs/oneplus-fajita.img (loop)
(2974054) [15:52:03] (native) % losetup -f /home/pmos/rootfs/oneplus-fajita.img -b 4096
(2974054) [15:52:03] (native) % losetup --json --list
{
"loopdevices": [
{
"name": "/dev/loop0",
"sizelimit": 0,
"offset": 0,
"autoclear": false,
"ro": false,
"back-file": "/home/pmos/rootfs/oneplus-fajita.img",
"dio": false,
"log-sec": 4096
}
]
}
(2974054) [15:52:03] (native) % losetup --json --list
{
"loopdevices": [
{
"name": "/dev/loop0",
"sizelimit": 0,
"offset": 0,
"autoclear": false,
"ro": false,
"back-file": "/home/pmos/rootfs/oneplus-fajita.img",
"dio": false,
"log-sec": 4096
}
]
}
(2974054) [15:52:03] % sudo mount --bind /dev/loop0 /home/user/.local/var/pmbootstrap/chroot_native/dev/install
(2974054) [15:52:03] (native) partition /dev/install (boot: 256M, reserved: 0M, root: the rest)
(2974054) [15:52:03] (native) % parted -s /dev/install mktable msdos
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/install 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.
(2974054) [15:52:03] (native) % parted -s /dev/install mkpart primary ext2 2048s 256M
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/install 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.
(2974054) [15:52:04] (native) % parted -s /dev/install mkpart primary 256M 100%
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/install 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.
(2974054) [15:52:04] (native) % parted -s /dev/install set 1 boot on
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/install 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.
(2974054) [15:52:04] (native) % losetup --json --list
{
"loopdevices": [
{
"name": "/dev/loop0",
"sizelimit": 0,
"offset": 0,
"autoclear": false,
"ro": false,
"back-file": "/home/pmos/rootfs/oneplus-fajita.img",
"dio": false,
"log-sec": 4096
}
]
}
(2974054) [15:52:04] NOTE: (1/20) failed to find the install partition. Retrying...
(2974054) [15:52:04] NOTE: (2/20) failed to find the install partition. Retrying...
(2974054) [15:52:04] NOTE: (3/20) failed to find the install partition. Retrying...
(2974054) [15:52:04] NOTE: (4/20) failed to find the install partition. Retrying...
(2974054) [15:52:04] NOTE: (5/20) failed to find the install partition. Retrying...
(2974054) [15:52:04] NOTE: (6/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (7/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (8/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (9/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (10/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (11/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (12/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (13/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (14/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (15/20) failed to find the install partition. Retrying...
(2974054) [15:52:05] NOTE: (16/20) failed to find the install partition. Retrying...
(2974054) [15:52:06] NOTE: (17/20) failed to find the install partition. Retrying...
(2974054) [15:52:06] NOTE: (18/20) failed to find the install partition. Retrying...
(2974054) [15:52:06] NOTE: (19/20) failed to find the install partition. Retrying...
(2974054) [15:52:06] NOTE: (20/20) failed to find the install partition. Retrying...
(2974054) [15:52:06] ERROR: Unable to find the first partition of /dev/loop0, expected it to be at /dev/loop0p1!
(2974054) [15:52:06] See also: <https://postmarketos.org/troubleshooting>
(2974054) [15:52:06] Traceback (most recent call last):
File "/home/user/temp/oneplus6t/pmbootstrap/pmb/__init__.py", line 63, in main
getattr(frontend, args.action)(args)
File "/home/user/temp/oneplus6t/pmbootstrap/pmb/helpers/frontend.py", line 329, in install
pmb.install.install(args)
File "/home/user/temp/oneplus6t/pmbootstrap/pmb/install/_install.py", line 1295, in install
install_system_image(args, 0, f"rootfs_{args.device}", step, steps,
File "/home/user/temp/oneplus6t/pmbootstrap/pmb/install/_install.py", line 836, in install_system_image
pmb.install.partitions_mount(args, layout, disk)
File "/home/user/temp/oneplus6t/pmbootstrap/pmb/install/partition.py", line 41, in partitions_mount
raise RuntimeError(f"Unable to find the first partition of {prefix}, "
RuntimeError: Unable to find the first partition of /dev/loop0, expected it to be at /dev/loop0p1!
The point where it goes wrong seems to be when running parted
:
(2974054) [15:52:03] (native) % parted -s /dev/install mktable msdos
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/install 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.
I see a loop0
in my block devices:
user@probook ~/temp/oneplus6t $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 1.5G 0 loop
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot/efi
└─nvme0n1p2 259:2 0 476.6G 0 part
...
The error message is telling me to restart my machine, but that makes no difference.