[Libguestfs] Change partition type

Marcos Amorim marcos.amorim at mandic.net.br
Mon Sep 29 23:15:59 UTC 2014


Hi, 

Is there any way to change the partition type using python-guestfs?

I'm trying to recreate an NTFS partition, but can not change the type to NTFS (7 identifier in frisk)

Filesystem from my disk
g.list_filesystems()
{'/dev/sda1': 'ntfs', '/dev/sda2': 'ntfs’}

Fdisk
print g.sfdisk_l(device)

Disk /dev/sda: 51200 cylinders, 64 heads, 32 sectors/track
Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      1     100     100     102400    7  HPFS/NTFS
/dev/sda2        101   51199   51099   52325376   83  Linux
/dev/sda3          0       -       0          0    0  Empty
/dev/sda4          0       -       0          0    0  Empty



Marcos Amorim









More information about the Libguestfs mailing list