Comment 2 for bug 1511493

Revision history for this message
Ryan Harper (raharper) wrote : Re: Unable to create partitions on a bcache device

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.