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

systemd-gpt-auto-generator: Failed to dissect: Input/output error (boot/rpmb context) #5806

Closed
1 of 2 tasks
kwizart opened this issue Apr 25, 2017 · 29 comments
Closed
1 of 2 tasks
Labels
Milestone

Comments

@kwizart
Copy link
Contributor

kwizart commented Apr 25, 2017

Submission type

  • Bug report
  • Request for enhancement (RFE)

systemd version the issue has been seen with

systemd-233-3.fc26.armv7hl

Used distribution

Fedora 26 armv7hl

In case of bug report: Unexpected behaviour you saw

systemd-gpt-auto-generator[1765]: Failed to dissect: Input/output error

In case of bug report: Steps to reproduce the problem

I'm using a GPT partition layout on the Toshiba AC100 ARM device. It use a NVIDIA tegra20 SOC and the rootfs is located on a 16G eMMC. In this case the bootloader (upstream uboot) is located in the boot area of the eMMC. (/dev/mmcblk1boot1 and /dev/mmcblk1boot2).
I expect this might be the problem for the failure to dissect the partition layout.

The other candidate for the failure is also the availability of /dev/mmcblk1rpmb
(see https://lwn.net/Articles/682276/ )


LANG=C fdisk -l -o "Device,Start,End,Sectors,Size,Type,Type-UUID,Attrs,Name,UUID"
Disk /dev/mmcblk1: 15 GiB, 16055795712 bytes, 31358976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3A26EA3C-EAB6-4124-853C-E7AADD7948E2

Device Start End Sectors Size Type Type-UUID Attrs Name UUID
/dev/mmcblk1p1 2048 1026047 1024000 500M Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4 3E410973-BADE-46FD-9255-3EEB76EEDFD8
/dev/mmcblk1p2 1026048 15706111 14680064 7G Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4 A065B4FD-AD31-422B-A61E-6A5214A4A95C
/dev/mmcblk1p3 15706112 16730111 1024000 500M Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4 0EB211F3-64CC-4FCE-95D5-92644A8A1DFB
/dev/mmcblk1p4 16730112 31358942 14628831 7G Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4 531DBE8A-F643-4C3A-8F08-3C3851069815

Disk /dev/mmcblk1boot1: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mmcblk1boot0: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


@kwizart
Copy link
Contributor Author

kwizart commented Apr 25, 2017

I also see from the kernel side but at different timestamp than "Failed to dissect", so it might be a different issue:
"kernel: blk_update_request: I/O error, dev mmcblk1rpmb, sector 0

Using systemd.gpt_auto=0 the problem doesn't appears anymore.

So I guess there is a need to blacklist the rpmb partition that isn't relevant for systemd-gpt-auto-generator as this is a secure locked partition.

@poettering
Copy link
Member

@kwizart hmm, is there a nice way to detect these kind of partitions? Are they specially marked in some way in sysfs? If possible, I'd prefer to do a better check than just ignore block devices ending in "rpmb".

@poettering poettering added this to the v234 milestone Apr 26, 2017
@kwizart
Copy link
Contributor Author

kwizart commented Apr 26, 2017

I only see this to differentiate them, but reading include/linux/genhd.h it's still unclear what it can mean
grep -H . /sys/block/mmcblk1*/capability
/sys/block/mmcblk1boot0/capability:250
/sys/block/mmcblk1boot1/capability:250
/sys/block/mmcblk1/capability:50
/sys/block/mmcblk1rpmb/capability:250

@poettering
Copy link
Member

Well the capability doesn't really report "rpmb" as your output shows...

I figure we have to match this by name then. Yuck. I figure we can filter everything starting with "mmcblk" and ending with "rpmb"...

poettering added a commit to poettering/systemd that referenced this issue Jun 21, 2017
For now, let's just special-case this in the sources. If more partition
types like this show up we should probably find some other solution.

Fixes: systemd#5806
@poettering
Copy link
Member

Fix waiting in #6165.

martinpitt pushed a commit that referenced this issue Jun 22, 2017
…ons (#6165)

For now, let's just special-case this in the sources. If more partition
types like this show up we should probably find some other solution.

Fixes: #5806
@captaincurrie
Copy link

captaincurrie commented Dec 22, 2017

Hello, i am still getting this issue. I have been getting it for a while i just didn't report it.

Distribution

Archlinux

Kernel

Linux 4.9.70-1-lts x86_64

Boot Message

Dec 22 10:22:28 vessel systemd[1]: systemd 236 running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN default-hierarchy=hy
Dec 22 10:22:28 vessel systemd[1]: Detected architecture x86-64.
Dec 22 10:22:28 vessel systemd[1]: Set hostname to <vessel>.
Dec 22 10:22:28 vessel systemd-gpt-auto-generator[243]: Failed to dissect: Input/output error

Partition Table

<LANG=C fdisk -l -o "Device,Start,End,Sectors,Size,Type,Type-UUID,Attrs,Name,UUID"
Disk /dev/mmcblk0: 116.5 GiB, 125069950976 bytes, 244277248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B47DB373-616A-4A49-9FA9-9A6E1C901A77

Device           Start       End   Sectors  Size Type Type-UUID                            Attrs Name UUID
/dev/mmcblk0p1    4096   1052671   1048576  512M EFI  C12A7328-F81F-11D2-BA4B-00A0C93EC93B       efi  52C3C6EB-3117-4519-B46D-4842860D721D
/dev/mmcblk0p2 1052672   9441279   8388608    4G Linu 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F       swap 56A5F87E-96C0-4DAB-BF19-9D6F08289C2D
/dev/mmcblk0p3 9441280 244277214 234835935  112G Linu 0FC63DAF-8483-4772-8E79-3D69D8477DE4       root FF3DFADC-FF64-465F-9B51-8695E40A5942




Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

@cawilliamson
Copy link

cawilliamson commented Dec 23, 2017

Still getting this here too!

[root@motif ~]# ls -l /dev/mmcblk0*
brw-rw---- 1 root disk 179,  0 Dec 23 22:14 /dev/mmcblk0
brw-rw---- 1 root disk 179,  8 Dec 23 22:14 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 16 Dec 23 22:14 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179,  1 Dec 23 22:14 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,  2 Dec 23 22:14 /dev/mmcblk0p2
brw-rw---- 1 root disk 179,  3 Dec 23 22:14 /dev/mmcblk0p3
crw------- 1 root root 244,  0 Dec 23 22:14 /dev/mmcblk0rpmb
[root@motif ~]# systemctl --version
systemd 236
+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN default-hierarchy=hybrid
[root@motif ~]# uname -a
Linux motif 4.15.0-rc4-jwrdegoede #1 SMP Sat Dec 23 19:20:00 UTC 2017 x86_64 GNU/Linux

@poettering
Copy link
Member

what does /usr/lib/systemd/systemd-dissect /dev/mmcblk0 report?

What does blkid -p report on all the relevant block devices above?

My educated guess its that the "boot0", "boot1" pseudo partitions confuse the dissection logic. Not sure how to fix that though. Also, as we lack the relevant hw, I figure we need a patch for this contributed externally...

@captaincurrie
Copy link

what does /usr/lib/systemd/systemd-dissect /dev/mmcblk0 report?

> /usr/lib/systemd/systemd-dissect /dev/mmcblk0
Failed to dissect image: Input/output error

What does blkid -p report on all the relevant block devices above?

> ls -1 /dev/mmcblk0*
/dev/mmcblk0
/dev/mmcblk0boot0
/dev/mmcblk0boot1
/dev/mmcblk0p1
/dev/mmcblk0p2
/dev/mmcblk0p3
/dev/mmcblk0rpmb
> ls -1 /dev/mmcblk0* | xargs -L 1 blkid -p
/dev/mmcblk0: PTUUID="b47db373-616a-4a49-9fa9-9a6e1c901a77" PTTYPE="gpt"
/dev/mmcblk0p1: UUID="1132-7845" VERSION="FAT32" TYPE="vfat" USAGE="filesystem" PART_ENTRY_SCHEME="gpt" PART_ENTRY_NAME="efi" PART_ENTRY_UUID="52c3c6eb-3117-4519-b46d-4842860d721d" PART_ENTRY_TYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="4096" PART_ENTRY_SIZE="1048576" PART_ENTRY_DISK="179:0"
/dev/mmcblk0p2: UUID="fc14567f-90e4-4493-a497-e55bdf656672" VERSION="1" TYPE="swap" USAGE="other" PART_ENTRY_SCHEME="gpt" PART_ENTRY_NAME="swap" PART_ENTRY_UUID="56a5f87e-96c0-4dab-bf19-9d6f08289c2d" PART_ENTRY_TYPE="0657fd6d-a4ab-43c4-84e5-0933c84b4f4f" PART_ENTRY_NUMBER="2" PART_ENTRY_OFFSET="1052672" PART_ENTRY_SIZE="8388608" PART_ENTRY_DISK="179:0"
/dev/mmcblk0p3: UUID="5d7da418-1261-4643-958e-6a636e7ebfbf" VERSION="1" TYPE="crypto_LUKS" USAGE="crypto" PART_ENTRY_SCHEME="gpt" PART_ENTRY_NAME="root" PART_ENTRY_UUID="ff3dfadc-ff64-465f-9b51-8695e40a5942" PART_ENTRY_TYPE="0fc63daf-8483-4772-8e79-3d69d8477de4" PART_ENTRY_NUMBER="3" PART_ENTRY_OFFSET="9441280" PART_ENTRY_SIZE="234835935" PART_ENTRY_DISK="179:0"

@tYYGH
Copy link

tYYGH commented Dec 31, 2017

I seem to have the same error as the original poster.

First error appearing in journalctl -b0, and also output again at each run of systemctl daemon-reload:

déc. 31 15:25:51 sphinx3 systemd-gpt-auto-generator[215]: Failed to dissect: Input/output error

Hardware:

# uname -a
Linux sphinx3 4.14.9-1-ARCH #1 SMP PREEMPT Tue Dec 26 00:18:37 UTC 2017 x86_64 GNU/Linux
# lspci
00:00.0 Host bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SoC Transaction Register (rev 35)
00:02.0 VGA compatible controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller (rev 35)
00:13.0 SATA controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SATA Controller (rev 35)
00:14.0 USB controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series USB xHCI Controller (rev 35)
00:1a.0 Encryption controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Trusted Execution Engine (rev 35)
00:1b.0 Audio device: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series High Definition Audio Controller (rev 35)
00:1c.0 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Express Port #1 (rev 35)
00:1c.2 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Express Port #3 (rev 35)
00:1f.0 ISA bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCU (rev 35)
00:1f.3 SMBus: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx SMBus Controller (rev 35)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
# lsblk 
NAME                MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
[… skip standard external USB hard disk …]
mmcblk0             179:0    0   7,3G  0 disk 
├─mmcblk0p1         179:1    0   128M  0 part /boot
└─mmcblk0p2         179:2    0   7,2G  0 part 
  ├─Sys-Root        254:0    0   5,2G  0 lvm  /
  └─Sys-Cont        254:1    0     2G  0 lvm  /var/lib/machines
mmcblk0boot0        179:8    0     4M  1 disk 
mmcblk0boot1        179:16   0     4M  1 disk 
mmcblk0rpmb         179:24   0   512K  0 disk 

what does /usr/lib/systemd/systemd-dissect /dev/mmcblk0 report?

# /usr/lib/systemd/systemd-dissect /dev/mmcblk0
Failed to dissect image: Input/output error

What does blkid -p report on all the relevant block devices above?

# for d in /dev/mmcblk0*; do blkid -p $d; done
/dev/mmcblk0: PTUUID="314dab0f-0275-4bdb-a5e6-d656efeb5af1" PTTYPE="gpt"
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="ESP" UUID="AB69-0384" VERSION="FAT16" TYPE="vfat" USAGE="filesystem" PART_ENTRY_SCHEME="gpt" PART_ENTRY_UUID="874794fc-a415-47ba-a181-702588386602" PART_ENTRY_TYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="262144" PART_ENTRY_DISK="179:0"
/dev/mmcblk0p2: UUID="ZoyvkI-DgwO-JtL5-QHUu-oS3f-BVln-twpLoA" VERSION="LVM2 001" TYPE="LVM2_member" USAGE="raid" PART_ENTRY_SCHEME="gpt" PART_ENTRY_UUID="7c40edd7-f08d-4247-a07e-d666e9213767" PART_ENTRY_TYPE="e6d6d379-f507-44c2-a23c-238f2a3df928" PART_ENTRY_NUMBER="2" PART_ENTRY_OFFSET="264192" PART_ENTRY_SIZE="15005663" PART_ENTRY_DISK="179:0"

@Re4son
Copy link

Re4son commented Jan 2, 2018

Same here with some more debug info pointing to a confused line 285 in dissect-image.c:

dmesg:
systemd-gpt-auto-generator[263]: Failed to dissect: Input/output error

With debug info:

# export SYSTEMD_LOG_LEVEL=debug; /lib/systemd/system-generators/systemd-gpt-auto-generator
Found container virtualization none.
/dev/mmcblk0p2: root device /dev/mmcblk0.
blkid and kernel partition list do not match.
Failed to dissect: Input/output error

/dev/:

# ls -l /dev/mmcblk0*
brw-rw---- 1 root disk 179,   0 Jan  2 20:23 /dev/mmcblk0
brw-rw---- 1 root disk 179, 256 Jan  2 20:23 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 512 Jan  2 20:23 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179,   1 Jan  2 20:23 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,   2 Jan  2 20:23 /dev/mmcblk0p2
brw-rw---- 1 root disk 179,   3 Jan  2 20:23 /dev/mmcblk0p3
brw-rw---- 1 root disk 179, 768 Jan  2 20:23 /dev/mmcblk0rpmb

blkid:

# blkid
/dev/mmcblk0p1: UUID="F556-222E" TYPE="vfat" PARTUUID="02f5c33c-98f4-4f0b-8d2e-9027c008bf4d"
/dev/mmcblk0p2: UUID="c038bf87-cc19-4099-98f3-e6fb16574dc6" UUID_SUB="1724bdec-7c89-423a-8ebf-032e9d8b07cb" TYPE="btrfs" PARTUUID="d9586f38-69ce-43d4-9b6a-6e0a96a3ab48"
/dev/mmcblk0p3: UUID="2f5d5064-4d49-4713-b71c-8251d625c462" TYPE="swap" PARTUUID="b88fe281-8d61-41fc-8834-12ea93a00177"
/dev/mmcblk0: PTUUID="13ed065d-26d6-45ac-bdef-aa58a3c5f146" PTTYPE="gpt"

Distribution:
Kali

Kernel:
4.14.0-kali1-amd64

Hope that helps

@poettering
Copy link
Member

So my educated guess is that we need something like 7be1420 that also handles these "boot" partitions properly. But I don#t understand the semantics of those, what they even are, and can't test that, so somebody knowledgeable needsto investigate this, prep a patch and test it and submit it...

@boucman
Copy link
Contributor

boucman commented Jan 2, 2018

I found https://www.kernel.org/doc/Documentation/mmc/mmc-dev-parts.txt but it doesn't clarify much...

  • I've done quite a lot of linux on mmc equiped device, and I never used those partitions... i'm not sure who uses them. most SoC I know don't...
  • from what the doc says, these partitions should be normal block devices. They will usually not contain a partition table, just the raw bootloader, but systemd-dissect should still be able to deal with that, right ?

kwizart added a commit to kwizart/systemd that referenced this issue Jan 24, 2018
/dev/mmcblk0boot0 is a partition found in eMMC
This is not relevant for mounting

This complement the previous fix as reported in
systemd#5806

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
@boucman
Copy link
Contributor

boucman commented Jan 24, 2018

ok, while trying to test #7982 I found the following clues (writing down mainly for my own memory)
I have slightly different hardware/kernel from the original poster, so my device names are different

  • systemd-dissect on /dev/mmcblk1boot* reports correctly that there is no partition table
  • systemd-dissect on /dev/mmcblk1rpbm reports Input/Output error

I did a quick strace of systemd-dissect and it seems that the error comes from the first call to read() on the partition. That partition can't be read before eeding it some kind of crypto key. In a way, reporting an IO error is the correct behaviour

poettering pushed a commit that referenced this issue Jan 25, 2018
/dev/mmcblk0boot0 is a partition found in eMMC
This is not relevant for mounting

This complement the previous fix as reported in
#5806

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
@Astilex5
Copy link

Astilex5 commented Feb 12, 2018

I am getting this as well. I am not sure if it is the cause of my random freezes.

Journalctl:

Feb 12 12:01:12 archlinux systemd-gpt-auto-generator[237]: Failed to dissect: Input/output error
Feb 12 12:01:12 archlinux systemd[231]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.

/dev/:

brw-rw---- 1 root disk 179, 0 Feb 12 12:01 /dev/mmcblk0

lsblk:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk0 179:0 0 58.2G 0 disk ├─mmcblk0p1 179:1 0 512M 0 part /boot ├─mmcblk0p2 179:2 0 4G 0 part [SWAP] └─mmcblk0p3 179:3 0 53.8G 0 part / mmcblk0boot0 179:8 0 4M 1 disk mmcblk0boot1 179:16 0 4M 1 disk

Distribution:

Arch Linux

Linux Kernel:

4.15.2-2-ARCH

Let me know if you need anything else.

@ghost
Copy link

ghost commented Feb 19, 2018

I'm also experiencing the same issue.

blkid

/dev/mmcblk0p1: UUID="E9FC-6A1C" TYPE="vfat" PARTUUID="8db5ba94-af39-4c10-b018-1c83be89ff5b"
/dev/mmcblk0p2: UUID="28131e61-27dc-4f9f-9384-66d3851c6474" TYPE="crypto_LUKS" PARTUUID="578a1002-5ea1-419f-9ddf-0320f7d8c060"
/dev/mmcblk0p3: UUID="9e8615eb-75f8-4c67-9008-c64c93ddc083" TYPE="crypto_LUKS" PARTUUID="1a41258d-472c-4545-9cae-e1335caf9865"
/dev/mapper/luks-28131e61-27dc-4f9f-9384-66d3851c6474: UUID="87832484-102d-4e79-978d-79e0f68595ce" TYPE="ext4"
/dev/mapper/luks-9e8615eb-75f8-4c67-9008-c64c93ddc083: UUID="6bb49609-5f76-4f98-9cdb-d8cfd529cc47" TYPE="swap"
/dev/mmcblk0: PTUUID="78cd3027-adef-4228-aa8b-efdcd1e6a8bf" PTTYPE="gpt"

journalctl

Feb 17 16:12:54 ygg systemd-gpt-auto-generator[275]: Failed to dissect: Input/output error.
Feb 17 16:12:54 ygg systemd[269]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with error code 1.

systemd-dissect /dev/mmcblk0boot*

Coudn't identify a suitable partition table or file system in /dev/mmcblk0boot*

systemd-dissect /dev/mmcblk0rpmb

Failed to dissect image: Input/output error

distribution

Manjaro

kernel

4.14.19-1-MANJARO x86_64

@arximboldi
Copy link

I can reproduce the issue using NixOS unstable, which includes systemd 237: NixOS/nixpkgs#35681

I am quite desperate, since this causes NixOS to not be able to update the boot-loader to boot into new cofigurations. Any workaround is welcome.

blkid

/dev/mmcblk0p1: UUID="245D-76E6" TYPE="vfat" PARTLABEL="boot" PARTUUID="16085dc8-dddd-4d9b-8071-efe7a4ed9e1f"
/dev/mmcblk0p2: UUID="365d62a5-5da6-4e3c-983d-6bc3147f5fc0" TYPE="ext4" PARTLABEL="nixos" PARTUUID="18da2ec5-9edc-41e3-9e97-3d5eb9396c18"
/dev/mmcblk0p3: UUID="77cfb7a0-3ea9-46c8-8c50-8f2914fd2892" TYPE="swap" PARTUUID="029c8855-cb04-4914-bffc-6e1e1a83d5ce"
/dev/mmcblk0: PTUUID="2cd01a6e-a0fd-4035-a194-debef31dbe4d" PTTYPE="gpt"

lsblk

mmcblk0      179:0    0 58.2G  0 disk 
├─mmcblk0p1  179:1    0    1G  0 part /boot
├─mmcblk0p2  179:2    0 49.2G  0 part /
└─mmcblk0p3  179:3    0    8G  0 part [SWAP]
mmcblk0boot0 179:32   0    4M  1 disk 
mmcblk0boot1 179:64   0    4M  1 disk 
mmcblk0rpmb  179:96   0    4M  0 disk 

@arximboldi
Copy link

systemctl --version

systemd 237
+PAM +AUDIT -SELINUX +IMA +APPARMOR +SMACK -SYSVINIT +UTMP -LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD +IDN2 -IDN -PCRE2 default-hierarchy=hybrid

@boucman
Copy link
Contributor

boucman commented Feb 27, 2018

Can you try "/lib/systemd/systemd-dissect /dev/mmcblk0" I suspect it will also return an I/O error...

if it does, can you strace that function ? or even better use gdb to backtrace what system call exactly returns an IO error ?

I tried reproducing at home, but didn't manage to...

@tYYGH
Copy link

tYYGH commented Feb 27, 2018

[root@sphinx3 ~]# /lib/systemd/systemd-dissect /dev/mmcblk0
Failed to dissect image: Input/output error

I have neither gdb nor strace on the “prod” machine where this error happens, and I cannot install it right now. I will however keep this bug in mind in case an opportunity comes to install one of these tools…

@lheckemann
Copy link

@arximboldi I just helped someone else work around this issue with nixos — changing your hardware-configuration.nix to refer to devices by paths like /dev/mmcblk0p1, /dev/sda etc, so the UUID scan doesn't need to run, makes it work.

I also suggested boot.initrd.postDeviceCommands = "rm /dev/mmcblk0rpmb"; which they didn't try, but I suspect that should also make it work.

@arximboldi
Copy link

arximboldi commented Mar 3, 2018 via email

jprvita added a commit to endlessm/systemd that referenced this issue Mar 29, 2018
Filter-out RPMB partitions and boot partitions from MMC devices when
comparing the size of the kernel and blkid partition lists.

This complement the previous fix to the problem reported in
systemd/systemd#5806

https://phabricator.endlessm.com/T21744
jprvita added a commit to endlessm/systemd that referenced this issue Mar 29, 2018
Filter-out RPMB partitions and boot partitions from MMC devices when
counting partitions enumerated by the kernel.

This complement the previous fixes to the problem reported in
systemd/systemd#5806

https://phabricator.endlessm.com/T21744
jprvita added a commit to jprvita/systemd that referenced this issue Mar 29, 2018
Filter-out RPMB partitions and boot partitions from MMC devices when
counting partitions enumerated by the kernel.

This complement the previous fixes to the problem reported in
systemd#5806
@jprvita
Copy link
Contributor

jprvita commented Mar 29, 2018

I'm still seeing this problem on eMMC systems with systemd v237, and I believe the cause is not filtering-out RPMB and boot partitions when counting the partitions enumerated by the kernel, so the following check fails (with a little extra debug on my system I see n=6 and z+1=4):

if (n > z + 1) {
        log_debug("blkid and kernel partition list do not match.");
        return -EIO;
}

The commit on #8609 fixes the problem for me.

jprvita added a commit to jprvita/systemd that referenced this issue Apr 2, 2018
Filter-out RPMB partitions and boot partitions from MMC devices when
counting partitions enumerated by the kernel. Also factor out the now
duplicated code into a separate function.

This complement the previous fixes to the problem reported in
systemd#5806
jprvita added a commit to endlessm/systemd that referenced this issue Apr 2, 2018
Filter-out RPMB partitions and boot partitions from MMC devices when
counting partitions enumerated by the kernel. Also factor out the now
duplicated code into a separate function.

This complement the previous fixes to the problem reported in
systemd/systemd#5806

https://phabricator.endlessm.com/T21744
poettering pushed a commit that referenced this issue Apr 3, 2018
Filter-out RPMB partitions and boot partitions from MMC devices when
counting partitions enumerated by the kernel. Also factor out the now
duplicated code into a separate function.

This complement the previous fixes to the problem reported in
#5806
@Axeltherabbit
Copy link

I'm still getting it
journalctl
systemd-gpt-auto-generator[191]: Failed to dissect: Input/output error systemd[185]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1

uname
Linux xxx 4.16.8-1-ARCH #1 SMP PREEMPT Wed May 9 11:25:02 UTC 2018 x86_64 GNU/Linux

blkid
/dev/mmcblk1: PTUUID="14a5bba8-81e5-4671-be96-065e157d19af" PTTYPE="gpt" /dev/mmcblk1p1: LABEL="SYSTEM_DRV" UUID="C2A4-67E8" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="299e4e53-d88a-4acd-b4d7-5186acb871a3" /dev/mmcblk1p2: UUID="cfb93a67-37d7-41dd-9a3c-81e7ac4ac2b6" TYPE="ext4" PARTUUID="84a2cf61-1919-4f99-93b6-b43fcf96fa15"

fdisk

Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 14A5BBA8-81E5-4671-BE96-065E157D19AF

Device          Start      End  Sectors  Size Type
/dev/mmcblk1p1   2048   534527   532480  260M EFI System
/dev/mmcblk1p2 534528 61069311 60534784 28.9G Linux filesystem


Disk /dev/mmcblk1boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes`

@tallero
Copy link

tallero commented Jul 25, 2018

The same happens to me with the same configuration as Axeltherabbit.

@boucman
Copy link
Contributor

boucman commented Jul 26, 2018

@tallero this is supposed to be fixed in newer systemd... with what version did you test ?

@tallero
Copy link

tallero commented Jul 26, 2018

@gusarg81
Copy link

Hi,

I am facing this issue as well. It was fixed in systemd 237? I have that version in Ubuntu 18.04 and still I can see that error:

systemd-gpt-auto-generator[18839]: Failed to dissect: Input/output error

My hardware is a SBC, Rock64 (Rpi like): https://www.pine64.org/?page_id=7147

@Axeltherabbit
Copy link

@tallero this is supposed to be fixed in newer systemd... with what version did you test ?

I confirm, it's been fixed

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

No branches or pull requests