bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

add_partition error


From: vishnu
Subject: add_partition error
Date: Thu, 6 Dec 2007 18:46:24 +0530


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,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]