RE: [patch 1/1] [mdadm] Add partition checks when creating a new array

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

 




> -----Original Message-----
> From: Asdo [mailto:asdo@xxxxxxxxxxxxx]
> Sent: Saturday, December 12, 2009 11:50 PM
> To: Neil Brown; Trela, Maciej; linux-raid@xxxxxxxxxxxxxxx; Williams,
> Dan J; Ciechanowski, Ed
> Subject: Re: [patch 1/1] [mdadm] Add partition checks when creating a
> new array
> 
> 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. (*)
> 

It is ok to create an array if partition exists on a device.
We just want to check if the metadata will overwrite the existing partition data.
If there is not enough space for metadata, the user will be warned.
However, this check is reasonable only if the user may want to preserve the partition data,
like when creating Raid1...

Regards,
Maciek.




--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux