[Bug 11941] New: losetup and partprobe fail when partitions exist

bugzilla at busybox.net bugzilla at busybox.net
Wed Jun 5 07:56:40 UTC 2019


            Bug ID: 11941
           Summary: losetup and partprobe fail when partitions exist
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: alkisg at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Hi! I have the following issue with busybox:
$ busybox losetup /dev/loop0 /dev/sda
$ busybox partprobe /dev/loop0
partprobe: /dev/loop0: Invalid argument

While partprobe from libparted works fine.
Additionally, `losetup -P /dev/loop0 /dev/sda` from util-linux also works fine;
if `busybox losetup` supported -P, it would solve the problem.

I think the reason for this issue is stated in

> - kernels >= 3.2 enable PT scanner only if max_part= is non-zero or if the
>   LO_FLAGS_PARTSCAN flag is set for the device. The PT scanner is disabled
>   by default.

So, `losetup -P` could set LO_FLAGS_PARTSCAN and solve the issue.

As a workaround, I'm currently using `modprobe loop max_part=9`, when loop
isn't built-in to the kernel, and `loop.max_part=9` in the kernel cmdline when
it is.
This indirectly re-enables the PT scanner, but this is a bad workaround, and
not always easy to implement.
Please allow busybox to handle loop devices with partitions without having to
specify max_part.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the busybox-cvs mailing list