Why is my block device busy?

Adam Trhon adam.trhon at tbs-biometrics.com
Mon Jan 20 07:51:15 EST 2020


I have an embedded x86 machine with Linux 5.2.21. The system is
built using OpenEmbedded. When I update the machine from a live USB
(/dev/sda), I override the whole internal memory (/dev/mmcblk1), and
then I get this error:

fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy

(I use fdisk for notifying kernel about the changes).

To find out where it is mounted I run

mount | grep mmc

before overwriting /dev/mmcblk1, but it prints nothing. So I run

dmesg | grep mmc

and I see this:

(... a lot of kernel prints ...)
Freeing unused kernel image memory: 1000K
Write protecting kernel text and read-only data: 14468k
NX-protecting the kernel data: 7000k
Run /init as init process
EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
(... a lot of kernel prints ...)

Next I modified the ext driver to print stack when mounting, and I got:

Call Trace:
 ? ext4_calculate_overhead+0x520/0x520
 ? mount_bdev+0x15a/0x180
 ? ext4_nfs_get_inode+0x50/0x50
 ? ext4_calculate_overhead+0x520/0x520

but I don't see anything that makes sense to me. What causes the
device to be busy?

Thank you

Ing. Adam Trhoň, Software Engineer
Touchless Biometric Systems s.r.o. | 
Palackého třída 180/44 | 61200 Brno | CZECH REPUBLIC | 
Mobile: +42(0) 721 565 113 | tbs-biometrics.cz

More information about the Kernelnewbies mailing list