hi,
   Im trying to clear a harddisk of its old partitions and create a single
partition to cover the complete disk, so that i can use it as a single
physical volume for my Volume Group (LVM)

here's what i did.

#!/usr/bin/env python
import parted

parted.init()
parted.device_probe_all()

# my disk mount point is /dev/sdb

device = parted.device_get('/dev/sdb')        # depreciated but im using
ubuntu (could not find parted.PedDevice.get(path) )
disk = device.disk_open()

# delete all old stuffs
disk.delete_all()
disk.write()

fs_default = parted.file_system_type_get('reiserfs')
part = parted.Partition(disk, parted.PARTITION_PRIMARY,fs_default, 1, 1024)
disk.add_partition(part)   # returns 0 (expecting 1)


i have a 40GB harddisk. is there any thing i missed out.
Im new to parted and could find no help in the net. Please help :)

Note: My aim is to delete all old partitions and fill the harddisk with a
single one (any file system)

-- 
Vishnu,
_______________________________________________
bug-parted mailing list
bug-parted@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to