| Summary: | losetup and partprobe fail when partitions exist | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Alkis Georgopoulos <alkisg> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Alkis Georgopoulos
2019-06-05 07:56:40 UTC
This happens for blockdev too: $ busybox losetup /dev/loop0 /dev/sda $ busybox blockdev --rereadpt /dev/loop0 blockdev: /dev/loop0: Invalid argument And again the workaround works, i.e. it doesn't happen if `modprobe loop max_part=9` was used before those 2 commands. commit 726cbb1be8620496cdf05d23bd98bdeb0983b4f0 Author: Jack O'Sullivan <jackos1998@gmail.com> Date: Tue May 28 15:28:27 2019 +0100 losetup: Add partition scanning option Add -P option from util-linux losetup to scan for partitions. losetup -P was implemented this May. This does not solve partprobe / blockdev --rereadpt examples (in busybox, they both boil down to calling ioctl(BLKRRPART)) - from what I see in strace, partprobe from GNU parted 3.2 does not use this ioctl at all, it does some complicated magic with newer APIs designed to set up arbitrary pertitioning schemes from userspace without having kernel to know anything about partition tables. "blockdev --rereadpt" does not work for util-linux's blockdev as well, since it also simply calls ioctl(BLKRRPART). IOW: "losetup -P" issue is fixed, "extend partprobe" issue is a significantly taller order. When I saw your commit link in Comment #2, it took me a while to realize how you were able to solve the issue 10 days before the bug report! :) `losetup -P` is more than enough, thank you very much. |