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

Re: Detect already installed partitions.




On Dec 30, 2008, at 6:24 AM, Wouter Verhelst wrote:

On Tue, Dec 30, 2008 at 02:47:58PM +0530, Rabbul Nawaz wrote:
Thanks for the quick respose. Installing libparted, and all its dependencies including all the libraries inside the rootfs environment would definetely
increase the size of the rootfs. Moreover it would require a static
compilation. Is there any other way, by which I can just get the
partition-label information which is lighter than using libparted.

parted actually reads data from the partition to get at the labels.
AFAIK, this data is not available through the kernel.

Take a look at the source code for the mount(8) command. It has some heuristics for figuring out things like the filesystem type and the label/UUID. I haven't done this myself, and maybe it uses libparted so it won't help you, but if it's self-contained it may be easier to hack those heuristics than to put up with the size of parted and friends...

Rick


Reply to: