Should not allow partitions to be created on bcache device

Bug #1511493 reported by Blake Rouse on 2015-10-29
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Critical
Lee Trager
curtin
High
Unassigned

Bug Description

Curtin does not allow partitions to be added to bcache devices. This seems incorrect?

http://bazaar.launchpad.net/~curtin-dev/curtin/trunk/view/head:/curtin/commands/block_meta.py#L916

Related branches

looks like a cut-n-paste error given the message.

On Thu, Oct 29, 2015 at 1:37 PM, Blake Rouse <email address hidden>
wrote:

> Public bug reported:
>
> Curtin does not allow partitions to be added to bcache devices. This
> seems incorrect?
>
> http://bazaar.launchpad.net/~curtin-
> dev/curtin/trunk/view/head:/curtin/commands/block_meta.py#L916
>
> ** Affects: curtin
> Importance: High
> Status: Confirmed
>
> --
> You received this bug notification because you are subscribed to curtin.
> Matching subscriptions: curtin-bugs-all
> https://bugs.launchpad.net/bugs/1511493
>
> Title:
> Unable to create partitions on a bcache device
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1511493/+subscriptions
>

Hrm, I don't think bcache allows you to partition the bcache device itself.

make-bcache -B /dev/md0 -C /dev/vdb6
sgdisk --new 1:2048:1026048 --typecode=1:8300 /dev/bcache0

this succeeds:

# parted -s /dev/bcache0 unit B print
    Model: Unknown (unknown)
    Disk /dev/bcache0: 1072095232B
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags:

    Number Start End Size File system Name Flags
     1 1048576B 525337087B 524288512B

# fdisk -l /dev/bcache0
    Disk /dev/bcache0: 1022.4 MiB, 1072095232 bytes, 2093936 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: 08DC92BD-3754-44A8-A512-6956816E0ADB

    Device Start End Sectors Size Type
    /dev/bcache0p1 2048 1026048 1024001 500M Linux filesystem

but the kernel's partition table doesn't see it, even after partprobe and udevadm settle...

# cat /proc/partitions | grep -v ram
    major minor #blocks name

     253 0 2097152 vda
     253 16 20971520 vdb
     253 17 1024 vdb1
     253 18 3144705 vdb2
     253 19 1047554 vdb3
     253 20 1047555 vdb4
     253 21 1047556 vdb5
     253 22 1047557 vdb6
      11 0 1048575 sr0
       2 0 4 fd0
       9 0 1046976 md0
     251 0 1046968 bcache0

and no such file /dev/bcache0p1 either.

I'm searching around to see if partitioning the bcache device is supported.
Otherwise, it appears that we'll need to pre-partition the backing device, and then
make a bcache device per backing device (/dev/bcache{0...n}) if we want to partition
the backing store.

I'm also going to investigate if this is related to the md device in the bcache; as it is known that md doesn't support partitioning.

Ryan Harper (raharper) wrote :

I quick replacement of md0 with another partition still fails. I don't think we can partition bcache devices with partition tables. Instead I suggest that if users want to partition a bcache backing device, that they use LVM instead.

Please reopen if I've somehow missed how we can partition a /dev/bcacheX besides LVM.

Changed in curtin:
status: Confirmed → Invalid
Blake Rouse (blake-rouse) wrote :

Okay thanks for looking into this.

I have targeted MAAS so we can't prevent users from creating partitions on bcache devices since it is not supported.

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
milestone: none → 1.9.0
summary: - Unable to create partitions on a bcache device
+ Should not allow partitions to be created on bcache device
Lee Trager (ltrager) on 2015-11-02
Changed in maas:
assignee: nobody → Lee Trager (ltrager)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers