linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Asdo <asdo@shiftmail.org>
To: Neil Brown <neilb@suse.de>,
	"Trela, Maciej" <Maciej.Trela@intel.com>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	Ciecha
Subject: Re: [patch 1/1] [mdadm] Add partition checks when creating a new array
Date: Sat, 12 Dec 2009 23:50:16 +0100	[thread overview]
Message-ID: <4B241E28.8060706@shiftmail.org> (raw)
In-Reply-To: <20091120170350.GA20882@maude.comedia.it>

Luca Berra wrote:
> On Fri, Nov 13, 2009 at 01:49:24PM +1100, Neil Brown wrote:
>> Is there a good library that we could use?
>> libparted might be a possibility, but it seems rather over-weight.
>> /lib/libparted-1.9.so.12.0.0 is larger than /sbin/mdadm !!!
>>
>> Are there any other libraries for reading different partition tables?
>> I guess we can open-code it if we have to but I'd be happy if another
>> solution could be found.
>
> i don't think so,
> but there are two tools
> partx from util-linux
> kpartix from multipath-tools (which is based on the former)
>
> so we could either grab code from those or just invoke
> partx -l (i believe every distro installs util-linux by default)
>
> L.

I'm probably missing something obvious but...
why don't you use the kernel directly to detect if there are partitions
on the device?

Like if the user wants to make a raid on /dev/sdg but the device
/dev/sdg1 exists, that's a problem, you fail the creation. (*)

This would support all the partition types that the kernel supports.

Probing the partitions on the disks and adding them to /dev/sd?N is done
automatically in all recent distributions even for hotpluggable devices 
so it's quite guaranteed that it would work

(*) Are there other situations that would overwrite a partition?


  parent reply	other threads:[~2009-12-12 22:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12 12:39 [patch 1/1] [mdadm] Add partition checks when creating a new array Trela, Maciej
2009-11-13  2:49 ` Neil Brown
2009-11-19 15:40   ` Trela, Maciej
2009-12-08  5:10     ` Neil Brown
2009-11-20 17:03   ` Luca Berra
2009-11-20 17:22     ` Mr. James W. Laferriere
2009-11-20 17:25       ` Mr. James W. Laferriere
2009-12-12 22:50     ` Asdo [this message]
2009-12-14 11:33       ` Trela, Maciej
  -- strict thread matches above, loose matches on Subject: below --
2009-11-05 12:01 Trela, Maciej

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B241E28.8060706@shiftmail.org \
    --to=asdo@shiftmail.org \
    --cc=Maciej.Trela@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).