FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 04-20-2010, 08:43 AM
Hans de Goede
 
Default Don't create mappings for extended partitions (#583484)

Various tools create different mappings for extended partitions:
dmraid: Does not create a mapping for extended parts
kpartx: Creates a mapping with a size of 2 sectors (*)
parted: Creates a mapping with the actual extended partition size

We won't recognize kpartx' 2 sector mapping as a pre-existing
mapping, try to create one and fail with EBUSY. This happens ie
with a livecd install. Note the kernel does the same for extended
partitions on regular disk, so this is not a kpartx bug.

To avoid this problem, simply don't create a mapping for the
extended partition at all, as there is no use for one anyways.
---
device.py | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/device.py b/device.py
index e097222..984d802 100644
--- a/device.py
+++ b/device.py
@@ -510,7 +510,9 @@ class MultiPath:
return

for part in disk.partitions:
- if part.active:
+ # Don't create mappings for extended partitions see the comment
+ # in RaidSet.buildPartMaps()
+ if part.active and part.type != _parted.PARTITION_EXTENDED:
name = "%sp%s" % (self.name, part.number)
bdev = BlockDev(self.prefix + self.name)
bdev.mode = 0600
@@ -760,7 +762,19 @@ class RaidSet:
return

for part in disk.partitions:
- if part.active:
+ # Various tools create different mappings for extended partitions:
+ # dmraid: Does not create a mapping for extended parts
+ # kpartx: Creates a mapping with a size of 2 sectors (*)
+ # parted: Creates a mapping with the actual extended partition size
+ #
+ # We won't recognize kpartx' 2 sector mapping as a pre-existing
+ # mapping, try to create one and fail with EBUSY. This happens ie
+ # with a livecd install. Note the kernel does the same for extended
+ # partitions on regular disk, so this is not a kpartx bug.
+ #
+ # To avoid this problem, we simply don't create a mapping for the
+ # extended partition at all, as there is no use for one anyways.
+ if part.active and part.type != _parted.PARTITION_EXTENDED:
name = "%sp%s" % (self.name, part.number)
bdev = BlockDev(self.prefix + self.name)
bdev.mode = 0600
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-20-2010, 08:53 AM
Ales Kozumplik
 
Default Don't create mappings for extended partitions (#583484)

On 04/20/2010 10:43 AM, Hans de Goede wrote:

Various tools create different mappings for extended partitions:
dmraid: Does not create a mapping for extended parts
kpartx: Creates a mapping with a size of 2 sectors (*)
parted: Creates a mapping with the actual extended partition size

We won't recognize kpartx' 2 sector mapping as a pre-existing
mapping, try to create one and fail with EBUSY. This happens ie
with a livecd install. Note the kernel does the same for extended
partitions on regular disk, so this is not a kpartx bug.

To avoid this problem, simply don't create a mapping for the
extended partition at all, as there is no use for one anyways.
---


Ack.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org