I created a loop device with
$ truncate -s 20G test.img
$ losetup -fP ./test.img
$ losetup -a
/dev/loop0: [0032]:4051 (/tmp/test/test.img)
lsblk is able to see it just fine
$ test]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 20G 0 loop
...
Now I'd like to create partitions with parted on that device, however, parted is unable to detect /dev/loop0
$ parted -l
Model: SAMSUNG MZVLB512HAJQ-000L7 (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI boot, esp
2 538MB 512GB 512GB primary
Why is parted not detecting the loop device?
Updated
$ partprobe -s
Warning: Unable to open /dev/sdb read-write (Read-only file system).
/dev/nvme0n1: gpt partitions 1 2