Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to use getPedDevice() with a loop device #81

Open
Lunarequest opened this issue Mar 2, 2021 · 3 comments
Open

unable to use getPedDevice() with a loop device #81

Lunarequest opened this issue Mar 2, 2021 · 3 comments

Comments

@Lunarequest
Copy link

If I use a loop device as the disk when getPedDevice(), for example running the following code reliably has issues.

# Create a disk image then attach it to a loopback device (e.g. /dev/loop0)
'''
dd if=/dev/zero of=disk.img bs=512 count=2097152
losetup -f disk.img
kpartx -a /dev/loop0
'''

device = '/dev/loop0'
loop0 = parted.getDevice(device)
loop0.clobber()  # destroy existing partition table
disk = parted.newDisk(loop0)

the following error is raised

    peddisk = disk_new(device.getPedDevice())
_ped.DiskException: /dev/loop0: unrecognised disk label

is there a way I can work around this on my end?

@Lunarequest
Copy link
Author

I can recreate this issue with the git branch aswell

@svartkanin
Copy link

Any updates on this issue?

@Lunarequest
Copy link
Author

nope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants