canonical / canonical/cloud-utils

FAILED: failed to get start and end for /dev/dm-31 in /dev/dm-3

Open
#69 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
124
Forks
36
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the listed dmsetup, kpartx, parted, and growpart commands, then inspect growpart's handling of /dev/mapper and /dev/dm device names. Trace how it obtains the partition start and end, and verify the behavior against the sdb1-mapper and sdb1-mapper1 links. Done means the reported Device Mapper case is handled correctly or its unsupported status is made explicit and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.