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 > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 01-09-2010, 04:32 PM
Hans de Goede
 
Default mdraid: various changes to options for new mdraid array creation

As discussed on the mailinglist, mdadm will be moving to creating
version 1.1 metadata by default, and we should be creating arrays with
bitmaps (except for /boot and swap).

So this patch makes the following changes:
1) For /boot force metadata version to 1.0, as grub cannot handle 1.1,
no bitmap.
2) For swap force metadata 1.1 (temporary until this becomes the default),
no bitmap
3) Everything else force metadata 1.1 and create with bitmap
---
storage/devicelibs/mdraid.py | 14 +++++++++++++-
storage/devices.py | 3 ++-
2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/storage/devicelibs/mdraid.py b/storage/devicelibs/mdraid.py
index 985f7a4..f02ae91 100644
--- a/storage/devicelibs/mdraid.py
+++ b/storage/devicelibs/mdraid.py
@@ -139,12 +139,24 @@ def mdadm(args, progress=None):

raise MDRaidError(msg)

-def mdcreate(device, level, disks, spares=0, progress=None):
+def mdcreate(device, level, disks, spares=0, progress=None, format=None):
argv = ["--create", device, "--run", "--level=%s" % level]
raid_devs = len(disks) - spares
argv.append("--raid-devices=%d" % raid_devs)
if spares:
argv.append("--spare-devices=%d" % spares)
+ # Figure out format specific options
+ # FIXME, the --metadata=1.1 is needed because current mdadm has a default
+ # metadata format which does not support --bitmap, once this
+ # is changed the appending of --metadata=1.1 should be removed
+ if format:
+ if hasattr(format, "mountpoint") and format.mountpoint == "/boot":
+ argv.append("--metadata=1.0")
+ elif format.type != "swap":
+ argv.append("--bitmap=internal")
+ argv.append("--metadata=1.1")
+ else:
+ argv.append("--metadata=1.1")
argv.extend(disks)

try:
diff --git a/storage/devices.py b/storage/devices.py
index d5a43a3..d87dd2c 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2698,7 +2698,8 @@ class MDRaidArrayDevice(StorageDevice):
self.level,
disks,
spares,
- progress=w)
+ progress=w,
+ format=self.format)
except Exception:
raise
else:
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-12-2010, 06:34 PM
Hans de Goede
 
Default mdraid: various changes to options for new mdraid array creation

As discussed on the mailinglist, mdadm will be moving to creating
version 1.1 metadata by default, and we should be creating arrays with
bitmaps (except for /boot and swap).

So this patch adds parameters to mdcreate to specify wether to use a
bitmap or not and which metadata version to use.

It then changes MDRaidArrayDevice.create() to:
1) For /boot force metadata version to 1.0, as grub cannot handle 1.1,
and don't use a bitmap.
2) For swap don't use a bitmap.
3) Everything else create with bitmap
---
storage/devicelibs/mdraid.py | 7 ++++++-
storage/devices.py | 10 ++++++++++
2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/storage/devicelibs/mdraid.py b/storage/devicelibs/mdraid.py
index 985f7a4..589fb36 100644
--- a/storage/devicelibs/mdraid.py
+++ b/storage/devicelibs/mdraid.py
@@ -139,12 +139,17 @@ def mdadm(args, progress=None):

raise MDRaidError(msg)

-def mdcreate(device, level, disks, spares=0, progress=None):
+def mdcreate(device, level, disks, spares=0, metadataVer=None, bitmap=False,
+ progress=None):
argv = ["--create", device, "--run", "--level=%s" % level]
raid_devs = len(disks) - spares
argv.append("--raid-devices=%d" % raid_devs)
if spares:
argv.append("--spare-devices=%d" % spares)
+ if metadataVer:
+ argv.append("--metadata=%s" % metadataVer)
+ if bitmap:
+ argv.append("--bitmap=internal")
argv.extend(disks)

try:
diff --git a/storage/devices.py b/storage/devices.py
index d5a43a3..f308ed5 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2694,10 +2694,20 @@ class MDRaidArrayDevice(StorageDevice):

disks = [disk.path for disk in self.devices]
spares = len(self.devices) - self.memberDevices
+ # Figure out format specific options
+ metadata="1.1"
+ bitmap=True
+ if getattr(self.format, "mountpoint", None) == "/boot":
+ metadata="1.0"
+ bitmap=False
+ elif self.format.type == "swap":
+ bitmap=False
mdraid.mdcreate(self.path,
self.level,
disks,
spares,
+ metadataVer=metadata,
+ bitmap=bitmap,
progress=w)
except Exception:
raise
--
1.6.5.2

_______________________________________________
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 07:30 PM.

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