First, create a partition for sdb.
sdb 8:16 0 50G 0 disk
├─sdb1 8:17 0 1G 0 part
Then run the following commands:
dmsetup create sdb1-mapper --table "0 2097152 linear /dev/sdb 0"
kpartx -as /dev/mapper/sdb1-mapper
parted --script --machine /dev/mapper/sdb1-mapper unit s print
growpart /dev/mapper/sdb1-mapper 1
When the growpart /dev/mapper/sdb1-mapper 1 command is executed, an error is reported.
[root@openEuler ~]# growpart /dev/mapper/sdb1-mapper 1
FAILED: failed to get start and end for /dev/dm-31 in /dev/dm-3
I think the problem may be that the dm device is incorrectly concatenated. For the sdb1-mapper partition, 1 should be concatenated to the end of sdb1-mapper, instead of dm-3.
[root@openEuler ~]# ll /dev/mapper/
total 0
lrwxrwxrwx. 1 root root 7 May 8 16:24 sdb1-mapper ->../dm-3
lrwxrwxrwx. 1 root root 7 May 8 16:25 sdb1-mapper1 ->../dm-4
Or, is it that the growpart command itself does not support Device Mapper devices?
First, create a partition for sdb.
Then run the following commands:
When the
growpart /dev/mapper/sdb1-mapper 1command is executed, an error is reported.I think the problem may be that the dm device is incorrectly concatenated. For the sdb1-mapper partition, 1 should be concatenated to the end of sdb1-mapper, instead of dm-3.
Or, is it that the growpart command itself does not support Device Mapper devices?